@@ -23,7 +23,9 @@ class MathsInput(FSLCommandInputSpec):
23
23
output_datatype = traits .Enum (* _dtypes ,
24
24
position = - 1 , argstr = "-odt %s" ,
25
25
desc = "datatype to use for output (default uses input type)" )
26
-
26
+
27
+ nan2zeros = traits .Bool (position = 3 , argstr = '-nan' ,
28
+ desc = 'change NaNs to zeros before doing anything' )
27
29
28
30
class MathsOutput (TraitedSpec ):
29
31
@@ -69,7 +71,7 @@ class ChangeDataType(MathsCommand):
69
71
70
72
class ThresholdInputSpec (MathsInput ):
71
73
72
- thresh = traits .Float (mandatory = True , position = 3 , argstr = "%s" ,
74
+ thresh = traits .Float (mandatory = True , position = 4 , argstr = "%s" ,
73
75
desc = "threshold value" )
74
76
direction = traits .Enum ("below" , "above" , usedefault = True ,
75
77
desc = "zero-out either below or above thresh value" )
@@ -104,7 +106,7 @@ def _format_arg(self, name, spec, value):
104
106
105
107
class MeanImageInput (MathsInput ):
106
108
107
- dimension = traits .Enum ("T" , "X" , "Y" , "Z" , usedefault = True , argstr = "-%smean" , position = 3 ,
109
+ dimension = traits .Enum ("T" , "X" , "Y" , "Z" , usedefault = True , argstr = "-%smean" , position = 4 ,
108
110
desc = "dimension to mean across" )
109
111
110
112
@@ -118,9 +120,9 @@ class MeanImage(MathsCommand):
118
120
119
121
class IsotropicSmoothInput (MathsInput ):
120
122
121
- fwhm = traits .Float (mandatory = True , xor = ["sigma" ], position = 3 , argstr = "-s %.5f" ,
123
+ fwhm = traits .Float (mandatory = True , xor = ["sigma" ], position = 4 , argstr = "-s %.5f" ,
122
124
desc = "fwhm of smoothing kernel" )
123
- sigma = traits .Float (mandatory = True , xor = ["fwhm" ], position = 3 , argstr = "-s %.5f" ,
125
+ sigma = traits .Float (mandatory = True , xor = ["fwhm" ], position = 4 , argstr = "-s %.5f" ,
124
126
desc = "sigma of smoothing kernel" )
125
127
126
128
@@ -140,7 +142,7 @@ def _format_arg(self, name, spec, value):
140
142
141
143
class ApplyMaskInput (MathsInput ):
142
144
143
- mask_file = File (exists = True , mandatory = True , argstr = "-mas %s" , position = 3 ,
145
+ mask_file = File (exists = True , mandatory = True , argstr = "-mas %s" , position = 4 ,
144
146
desc = "binary image defining mask space" )
145
147
146
148
@@ -155,16 +157,16 @@ class ApplyMask(MathsCommand):
155
157
class KernelInput (MathsInput ):
156
158
157
159
kernel_shape = traits .Enum ("3D" , "2D" , "box" , "boxv" , "gauss" , "sphere" , "file" ,
158
- argstr = "-kernel %s" , position = 3 , desc = "kernel shape to use" )
159
- kernel_size = traits .Float (argstr = "%.4f" , position = 4 , xor = ["kernel_file" ],
160
+ argstr = "-kernel %s" , position = 4 , desc = "kernel shape to use" )
161
+ kernel_size = traits .Float (argstr = "%.4f" , position = 5 , xor = ["kernel_file" ],
160
162
desc = "kernel size - voxels for box/boxv, mm for sphere, mm sigma for gauss" )
161
- kernel_file = File (exists = True , argstr = "%s" , position = 4 , xor = ["kernel_size" ],
163
+ kernel_file = File (exists = True , argstr = "%s" , position = 5 , xor = ["kernel_size" ],
162
164
desc = "use external file for kernel" )
163
165
164
166
165
167
class DilateInput (KernelInput ):
166
168
167
- operation = traits .Enum ("mean" , "modal" , "max" , argstr = "-dil%s" , position = 5 , mandatory = True ,
169
+ operation = traits .Enum ("mean" , "modal" , "max" , argstr = "-dil%s" , position = 6 , mandatory = True ,
168
170
desc = "filtering operation to perfoem in dilation" )
169
171
170
172
@@ -183,7 +185,7 @@ def _format_arg(self, name, spec, value):
183
185
184
186
class ErodeInput (KernelInput ):
185
187
186
- minimum_filter = traits .Bool (argstr = "%s" , position = 5 , usedefault = True , default_value = False ,
188
+ minimum_filter = traits .Bool (argstr = "%s" , position = 6 , usedefault = True , default_value = False ,
187
189
desc = "if true, minimum filter rather than erosion by zeroing-out" )
188
190
189
191
@@ -204,7 +206,7 @@ def _format_arg(self, name, spec, value):
204
206
205
207
class SpatialFilterInput (KernelInput ):
206
208
207
- operation = traits .Enum ("mean" , "median" , "meanu" , argstr = "-f%s" , position = 5 , mandatory = True ,
209
+ operation = traits .Enum ("mean" , "median" , "meanu" , argstr = "-f%s" , position = 6 , mandatory = True ,
208
210
desc = "operation to filter with" )
209
211
210
212
@@ -219,7 +221,7 @@ class SpatialFilter(MathsCommand):
219
221
class UnaryMathsInput (MathsInput ):
220
222
221
223
operation = traits .Enum ("exp" , "log" , "sin" , "cos" , "sqr" , "sqrt" , "recip" , "abs" , "bin" , "index" ,
222
- argstr = "-%s" , position = 3 , mandatory = True ,
224
+ argstr = "-%s" , position = 4 , mandatory = True ,
223
225
desc = "operation to perform" )
224
226
225
227
@@ -237,11 +239,11 @@ def _list_outputs(self):
237
239
class BinaryMathsInput (MathsInput ):
238
240
239
241
operation = traits .Enum ("add" , "sub" , "mul" , "div" , "rem" , "max" , "min" ,
240
- mandatory = True , argstr = "-%s" , position = 3 ,
242
+ mandatory = True , argstr = "-%s" , position = 4 ,
241
243
desc = "operation to perform" )
242
- operand_file = File (exists = True , argstr = "%s" , mandatory = True , position = 4 , xor = ["operand_value" ],
244
+ operand_file = File (exists = True , argstr = "%s" , mandatory = True , position = 5 , xor = ["operand_value" ],
243
245
desc = "second image to perform operation with" )
244
- operand_value = traits .Float (argstr = "%.8f" , mandatory = True , position = 4 , xor = ["operand_file" ],
246
+ operand_value = traits .Float (argstr = "%.8f" , mandatory = True , position = 5 , xor = ["operand_file" ],
245
247
desc = "value to perform operation with" )
246
248
247
249
@@ -254,7 +256,7 @@ class BinaryMaths(MathsCommand):
254
256
255
257
class MultiImageMathsInput (MathsInput ):
256
258
257
- op_string = traits .String (position = 3 , argstr = "%s" , mandatory = True ,
259
+ op_string = traits .String (position = 4 , argstr = "%s" , mandatory = True ,
258
260
desc = "python formatted string of operations to perform" )
259
261
operand_files = InputMultiPath (File (exists = True ), mandatory = True ,
260
262
desc = "list of file names to plug into op string" )
@@ -285,9 +287,9 @@ def _format_arg(self, name, spec, value):
285
287
286
288
class TemporalFilterInput (MathsInput ):
287
289
288
- lowpass_sigma = traits .Float (- 1 , argstr = "%.6f" , position = 4 , usedefault = True ,
290
+ lowpass_sigma = traits .Float (- 1 , argstr = "%.6f" , position = 5 , usedefault = True ,
289
291
desc = "lowpass filter sigma (in volumes)" )
290
- highpass_sigma = traits .Float (- 1 , argstr = "-bptf %.6f" , position = 3 , usedefault = True ,
292
+ highpass_sigma = traits .Float (- 1 , argstr = "-bptf %.6f" , position = 4 , usedefault = True ,
291
293
desc = "highpass filter sigma (in volumes)" )
292
294
293
295
0 commit comments