Skip to content

Commit c76580d

Browse files
author
Laurent Guerard
committed
Test processing option strings
1 parent 4a4a10b commit c76580d

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

tests/test_processing.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,43 @@
11
"""Tests for the imcflibs.imagej.processing module."""
22

3-
from imcflibs.imagej.processing import rolling_ball_options
3+
from imcflibs.imagej.processing import (
4+
filter_options,
5+
rolling_ball_options,
6+
threshold_options,
7+
)
48

59

610
def test_rolling_ball_options():
711
"""Test the rolling_ball_options function."""
12+
813
options = rolling_ball_options(42.23)
914
assert options == "rolling=42.23"
15+
16+
17+
def test_rolling_ball_options_with_flags():
18+
"""Test `rolling_ball_options()` string concatenation with all flags."""
19+
20+
options = rolling_ball_options(
21+
12,
22+
light_background=True,
23+
sliding=True,
24+
disable=True,
25+
do_3d=True,
26+
)
27+
assert options == "rolling=12 light sliding disable stack"
28+
29+
30+
def test_filter_options():
31+
"""Test `filter_options()` string concatenation."""
32+
33+
command, options = filter_options("Mean", 5, do_3d=True)
34+
assert command == "Mean 3D..."
35+
assert options == "radius=5 stack"
36+
37+
38+
def test_threshold_options():
39+
"""Test `threshold_options()` string concatenation."""
40+
41+
auto_threshold, convert_to_binary = threshold_options("Otsu", do_3d=True)
42+
assert auto_threshold == "Otsu dark stack"
43+
assert convert_to_binary == "method=Otsu background=Dark black"

0 commit comments

Comments
 (0)