File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 18
18
>>> task = Mul(input_image="input.nii", other_image="mask.nii", output_image="output.nii")
19
19
>>> task.cmdline
20
20
'fslmaths input.nii -mul mask.nii output.nii'
21
+
22
+ >>> task = Threshold(input_image="input.nii", threshold=0.3, output_image="output.nii")
23
+ >>> task.cmdline
24
+ 'fslmaths input.nii -thr 0.3 output.nii'
21
25
"""
22
26
23
- __all__ = ["Maths" , "MathsSpec" , "Mul" ]
27
+ __all__ = ["Maths" , "MathsSpec" , "Mul" , "Threshold" ]
24
28
25
29
from os import PathLike
26
30
@@ -80,6 +84,21 @@ class Mul(Maths):
80
84
input_spec = SpecInfo (name = "Input" , bases = (MulSpec ,))
81
85
82
86
87
+ @define (kw_only = True )
88
+ class ThresholdSpec (MathsSpec ):
89
+ """Specifications for fslmaths' threshold."""
90
+
91
+ threshold : float = field (
92
+ metadata = {"help_string" : "value for thresholding the image" , "mandatory" : True , "argstr" : "-thr" }
93
+ )
94
+
95
+
96
+ class Threshold (Maths ):
97
+ """Task definition for fslmaths' threshold."""
98
+
99
+ input_spec = SpecInfo (name = "Input" , bases = (ThresholdSpec ,))
100
+
101
+
83
102
# TODO: Drop compatibility alias for 0.x
84
103
FSLMaths = Maths
85
104
FSLMathsSpec = MathsSpec
You can’t perform that action at this time.
0 commit comments