@@ -160,6 +160,67 @@ def _list_outputs(self):
160
160
outputs ['posteriors' ].append (os .path .abspath (self .inputs .output_posteriors_name_template % (i + 1 )))
161
161
return outputs
162
162
163
+ class LaplacianThicknessInputSpec (ANTSCommandInputSpec ):
164
+ input_wm = File (argstr = '%s' , mandatory = True , copyfile = True ,
165
+ desc = ('white matter segmentation image' ),
166
+ position = 1 )
167
+ input_gm = File (argstr = '%s' , mandatory = True , copyfile = True ,
168
+ desc = ('gray matter segmentation image' ),
169
+ position = 2 )
170
+ output_image = File (desc = 'name of output file' , argstr = '%s' , position = 3 ,
171
+ genfile = True , hash_files = False )
172
+ smooth_param = traits .Float (argstr = 'smoothparam=%d' , desc = '' , position = 4 )
173
+ prior_thickness = traits .Float (argstr = 'priorthickval=%d' , desc = '' ,
174
+ position = 5 )
175
+ dT = traits .Float (argstr = 'dT=%d' , desc = '' , position = 6 )
176
+ sulcus_prior = traits .Bool (argstr = 'use-sulcus-prior' , desc = '' , position = 7 )
177
+ opt_tolerance = traits .Float (argstr = 'optional-laplacian-tolerance=%d' ,
178
+ desc = '' , position = 8 )
179
+
180
+
181
+ class LaplacianThicknessOutputSpec (TraitedSpec ):
182
+ output_image = File (exists = True , desc = 'Cortical thickness' )
183
+
184
+
185
+ class LaplacianThickness (ANTSCommand ):
186
+ """Calculates the cortical thickness from an anatomical image
187
+
188
+ Examples
189
+ --------
190
+
191
+ >>> from nipype.interfaces.ants import LaplacianThickness
192
+ >>> cort_thick = LaplacianThickness()
193
+ >>> cort_thick.inputs.input_wm = 'white_matter.nii.gz'
194
+ >>> cort_thick.inputs.input_gm = 'gray_matter.nii.gz'
195
+ >>> cort_thick.inputs.output_image = 'output_thickness.nii.gz'
196
+ >>> cort_thick.cmdline
197
+ 'LaplacianThickness white_matter.nii.gz gray_matter.nii.gz output_thickness.nii.gz'
198
+
199
+ """
200
+
201
+ _cmd = 'LaplacianThickness'
202
+ input_spec = LaplacianThicknessInputSpec
203
+ output_spec = LaplacianThicknessOutputSpec
204
+
205
+ def _gen_filename (self , name ):
206
+ if name == 'output_image' :
207
+ output = self .inputs .output_image
208
+ if not isdefined (output ):
209
+ _ , name , ext = split_filename (self .inputs .input_wm )
210
+ output = name + '_thickness' + ext
211
+ return output
212
+ return None
213
+
214
+ def _list_outputs (self ):
215
+ outputs = self ._outputs ().get ()
216
+ _ , name , ext = split_filename (os .path .abspath (self .inputs .input_wm ))
217
+ outputs ['output_image' ] = os .path .join (os .getcwd (),
218
+ '' .join ((name ,
219
+ self .inputs .output_image ,
220
+ ext )))
221
+ return outputs
222
+
223
+
163
224
class N4BiasFieldCorrectionInputSpec (ANTSCommandInputSpec ):
164
225
dimension = traits .Enum (3 , 2 , argstr = '--image-dimension %d' ,
165
226
usedefault = True ,
@@ -228,4 +289,4 @@ def _gen_filename(self, name):
228
289
def _list_outputs (self ):
229
290
outputs = self ._outputs ().get ()
230
291
outputs ['output_image' ] = os .path .abspath (self ._gen_filename ('output_image' ))
231
- return outputs
292
+ return outputs
0 commit comments