-
Notifications
You must be signed in to change notification settings - Fork 3
Additional options for rolling ball background subtraction #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+202
−31
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3ca94fa
feat: Enhance rolling ball background subtraction with additional opt…
lguerard 6659e11
fix: Correct spelling of 'Subtract Background' in rolling ball backgr…
lguerard cd48fac
refactor: Extract rolling ball options into a separate function for c…
lguerard 7741f5e
Merge branch 'devel' into pr/143
ehrenfeu edaa79e
Update docstring
ehrenfeu 373a05c
Add test for the rolling_ball_options function
ehrenfeu 4a4a10b
Add pure helpers for processing options
c76580d
Test processing option strings
9fe0a64
Add processing helper coverage
27f4165
Enhance docstrings for filter and threshold options functions
56d003b
Fix parameter name for disable smoothing in rolling ball functions an…
555c60c
docs: 📝 add information about available methods
65daf40
fix(docs): add missing dots at the end of docstrings.
94bea93
fix(docs): 📝 add missing dots at the end of docstrings and remove new…
lguerard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| """Tests for the imcflibs.imagej.processing module.""" | ||
|
|
||
| from imcflibs.imagej.processing import ( | ||
| filter_options, | ||
| rolling_ball_options, | ||
| threshold_options, | ||
| ) | ||
|
|
||
|
|
||
| def test_rolling_ball_options(): | ||
| """Test the rolling_ball_options function.""" | ||
|
|
||
| options = rolling_ball_options(42.23) | ||
| assert options == "rolling=42.23" | ||
|
|
||
|
|
||
| def test_rolling_ball_options_with_flags(): | ||
| """Test `rolling_ball_options()` string concatenation with all flags.""" | ||
|
|
||
| options = rolling_ball_options( | ||
| 12, | ||
| light_background=True, | ||
| sliding=True, | ||
| disable_smoothing=True, | ||
| do_3d=True, | ||
| ) | ||
| assert options == "rolling=12 light sliding disable stack" | ||
|
|
||
|
|
||
| def test_filter_options(): | ||
| """Test `filter_options()` string concatenation.""" | ||
|
|
||
| command, options = filter_options("Mean", 5, do_3d=True) | ||
| assert command == "Mean 3D..." | ||
| assert options == "radius=5 stack" | ||
|
|
||
|
|
||
| def test_filter_options_gaussian_blur(): | ||
| """Test `filter_options()` with the Gaussian Blur branch.""" | ||
|
|
||
| command, options = filter_options("Gaussian Blur", 5) | ||
| assert command == "Gaussian Blur..." | ||
| assert options == "sigma=5 stack" | ||
|
|
||
|
|
||
| def test_threshold_options(): | ||
| """Test `threshold_options()` string concatenation.""" | ||
|
|
||
| auto_threshold, convert_to_binary = threshold_options("Otsu", do_3d=True) | ||
| assert auto_threshold == "Otsu dark stack" | ||
| assert convert_to_binary == "method=Otsu background=Dark black" | ||
|
|
||
|
|
||
| def test_threshold_options_without_stack(): | ||
| """Test `threshold_options()` when 3D stacking is disabled.""" | ||
|
|
||
| auto_threshold, convert_to_binary = threshold_options("Otsu", do_3d=False) | ||
| assert auto_threshold == "" | ||
| assert convert_to_binary == "method=Otsu background=Dark black" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.