@@ -39,14 +39,14 @@ class RigidInputSpec(CommandLineInputSpec):
39
39
similarity_metric = traits .Enum ('EDS' , 'GDS' , 'DDS' , 'NMI' ,
40
40
mandatory = True , position = 2 , argstr = "%s" ,
41
41
desc = "similarity metric" , usedefault = True )
42
- samplingXYZ = traits .Tuple ((4 , 4 , 4 ), mandatory = True , position = 3 ,
43
- argstr = "%g %g %g" , usedefault = True ,
44
- desc = "dist between samp points (mm) (x,y,z)" )
42
+ sampling_xyz = traits .Tuple ((4 , 4 , 4 ), mandatory = True , position = 3 ,
43
+ argstr = "%g %g %g" , usedefault = True ,
44
+ desc = "dist between samp points (mm) (x,y,z)" )
45
45
ftol = traits .Float (mandatory = True , position = 4 , argstr = "%g" ,
46
46
desc = "cost function tolerance" , default_value = 0.01 ,
47
47
usedefault = True )
48
- useInTrans = traits .Bool (position = 5 , argstr = "1" ,
49
- desc = "to initialize with existing xfm set as 1 " )
48
+ use_in_trans = traits .Bool (position = 5 , argstr = "1" ,
49
+ desc = "initialize with existing transform " )
50
50
51
51
52
52
class RigidOutputSpec (TraitedSpec ):
@@ -65,9 +65,9 @@ class Rigid(CommandLineDtitk):
65
65
>>> node.inputs.fixed_file = 'im1.nii'
66
66
>>> node.inputs.moving_file = 'im2.nii'
67
67
>>> node.inputs.similarity_metric = 'EDS'
68
- >>> node.inputs.samplingXYZ = (4,4,4)
68
+ >>> node.inputs.sampling_xyz = (4,4,4)
69
69
>>> node.inputs.ftol = 0.01
70
- >>> node.inputs.useInTrans = True
70
+ >>> node.inputs.use_in_trans = True
71
71
>>> node.cmdline
72
72
'dti_rigid_reg im1.nii im2.nii EDS 4 4 4 0.01 1'
73
73
>>> node.run() # doctest: +SKIP
@@ -96,9 +96,9 @@ class Affine(Rigid):
96
96
>>> node.inputs.fixed_file = 'im1.nii'
97
97
>>> node.inputs.moving_file = 'im2.nii'
98
98
>>> node.inputs.similarity_metric = 'EDS'
99
- >>> node.inputs.samplingXYZ = (4,4,4)
99
+ >>> node.inputs.sampling_xyz = (4,4,4)
100
100
>>> node.inputs.ftol = 0.01
101
- >>> node.inputs.useInTrans = True
101
+ >>> node.inputs.use_in_trans = True
102
102
>>> node.cmdline
103
103
'dti_affine_reg im1.nii im2.nii EDS 4 4 4 0.01 1'
104
104
>>> node.run() # doctest: +SKIP
@@ -116,10 +116,10 @@ class DiffeoInputSpec(CommandLineInputSpec):
116
116
usedefault = True , mandatory = True ,
117
117
position = 3 , argstr = "%d" )
118
118
n_iters = traits .Int (6 , desc = "number of iterations" ,
119
- exists = True , mandatory = True ,
119
+ mandatory = True ,
120
120
position = 4 , argstr = "%d" , usedefault = True )
121
121
ftol = traits .Float (0.002 , desc = "iteration for the optimization to stop" ,
122
- exists = True , mandatory = True , position = 5 , argstr = "%g" ,
122
+ mandatory = True , position = 5 , argstr = "%g" ,
123
123
usedefault = True )
124
124
125
125
@@ -152,7 +152,7 @@ class Diffeo(CommandLineDtitk):
152
152
153
153
def _list_outputs (self ):
154
154
outputs = self .output_spec ().get ()
155
- moving = self .inputs .moving_file ()
155
+ moving = self .inputs .moving_file
156
156
outputs ['out_file_xfm' ] = fname_presuffix (moving , suffix = '_diffeo.df' )
157
157
outputs ['out_file' ] = fname_presuffix (moving , suffix = '_diffeo' )
158
158
return outputs
@@ -184,8 +184,8 @@ class ComposeXfm(CommandLineDtitk):
184
184
>>> node = dtitk.ComposeXfm()
185
185
>>> node.inputs.in_df = 'im_warp.df.nii'
186
186
>>> node.inputs.in_aff= 'im_affine.aff'
187
- >>> node.cmdline #doctest:
188
- 'dfRightComposeAffine -aff im_affine.aff -df im_warp.df.nii -out\
187
+ >>> node.cmdline
188
+ 'dfRightComposeAffine -aff im_affine.aff -df im_warp.df.nii -out
189
189
im_warp.df_affdf.nii'
190
190
>>> node.run() # doctest: +SKIP
191
191
"""
@@ -194,7 +194,7 @@ class ComposeXfm(CommandLineDtitk):
194
194
_cmd = 'dfRightComposeAffine'
195
195
196
196
197
- class affSymTensor3DVolInputSpec (CommandLineInputSpec ):
197
+ class AffSymTensor3DVolInputSpec (CommandLineInputSpec ):
198
198
in_file = File (desc = 'moving tensor volume' , exists = True ,
199
199
argstr = "-in %s" , mandatory = True )
200
200
out_file = File (desc = 'output filename' ,
@@ -215,7 +215,7 @@ class affSymTensor3DVolInputSpec(CommandLineInputSpec):
215
215
desc = 'output volume specification read from the target '
216
216
'volume if specified' )
217
217
translation = traits .Tuple ((traits .Float (), traits .Float (),
218
- traits .Float ()),
218
+ traits .Float ()),
219
219
desc = 'translation (x,y,z) in mm' ,
220
220
argstr = '-translation %g %g %g' ,
221
221
xor = ['transform' ])
@@ -227,32 +227,32 @@ class affSymTensor3DVolInputSpec(CommandLineInputSpec):
227
227
argstr = '-deformation %g %g %g %g %g %g' )
228
228
229
229
230
- class affSymTensor3DVolOutputSpec (TraitedSpec ):
230
+ class AffSymTensor3DVolOutputSpec (TraitedSpec ):
231
231
out_file = File (exists = True )
232
232
233
233
234
- class affSymTensor3DVol (CommandLineDtitk ):
234
+ class AffSymTensor3DVol (CommandLineDtitk ):
235
235
"""
236
236
Applies affine transform to a tensor volume
237
237
238
238
Example
239
239
-------
240
240
241
241
>>> from nipype.interfaces import dtitk
242
- >>> node = dtitk.affSymTensor3DVol ()
242
+ >>> node = dtitk.AffSymTensor3DVol ()
243
243
>>> node.inputs.in_file = 'im1.nii'
244
244
>>> node.inputs.transform = 'im_affine.aff'
245
- >>> node.cmdline #doctest:
246
- 'affineSymTensor3DVolume -in im1.nii -interp LEI -out im1_affxfmd.nii\
245
+ >>> node.cmdline
246
+ 'affineSymTensor3DVolume -in im1.nii -interp LEI -out im1_affxfmd.nii
247
247
-reorient PPD -trans im_affine.aff'
248
248
>>> node.run() # doctest: +SKIP
249
249
"""
250
- input_spec = affSymTensor3DVolInputSpec
251
- output_spec = affSymTensor3DVolOutputSpec
250
+ input_spec = AffSymTensor3DVolInputSpec
251
+ output_spec = AffSymTensor3DVolOutputSpec
252
252
_cmd = 'affineSymTensor3DVolume'
253
253
254
254
255
- class affScalarVolInputSpec (CommandLineInputSpec ):
255
+ class AffScalarVolInputSpec (CommandLineInputSpec ):
256
256
in_file = File (desc = 'moving scalar volume' , exists = True ,
257
257
argstr = "-in %s" , mandatory = True )
258
258
out_file = File (desc = 'output filename' ,
@@ -270,7 +270,7 @@ class affScalarVolInputSpec(CommandLineInputSpec):
270
270
desc = 'output volume specification read from the target '
271
271
'volume if specified' )
272
272
translation = traits .Tuple ((traits .Float (), traits .Float (),
273
- traits .Float ()),
273
+ traits .Float ()),
274
274
desc = 'translation (x,y,z) in mm' ,
275
275
argstr = '-translation %g %g %g' ,
276
276
xor = ['transform' ])
@@ -282,37 +282,37 @@ class affScalarVolInputSpec(CommandLineInputSpec):
282
282
argstr = '-deformation %g %g %g %g %g %g' )
283
283
284
284
285
- class affScalarVolOutputSpec (TraitedSpec ):
285
+ class AffScalarVolOutputSpec (TraitedSpec ):
286
286
out_file = File (desc = 'moved volume' , exists = True )
287
287
288
288
289
- class affScalarVol (CommandLineDtitk ):
289
+ class AffScalarVol (CommandLineDtitk ):
290
290
"""
291
291
Applies affine transform to a scalar volume
292
292
293
293
Example
294
294
-------
295
295
296
296
>>> from nipype.interfaces import dtitk
297
- >>> node = dtitk.affScalarVol ()
297
+ >>> node = dtitk.AffScalarVol ()
298
298
>>> node.inputs.in_file = 'im1.nii'
299
299
>>> node.inputs.transform = 'im_affine.aff'
300
- >>> node.cmdline #doctest:
301
- 'affineScalarVolume -in im1.nii -interp 0 -out im1_affxfmd.nii -trans\
300
+ >>> node.cmdline
301
+ 'affineScalarVolume -in im1.nii -interp 0 -out im1_affxfmd.nii -trans
302
302
im_affine.aff'
303
303
>>> node.run() # doctest: +SKIP
304
304
"""
305
- input_spec = affScalarVolInputSpec
306
- output_spec = affScalarVolOutputSpec
305
+ input_spec = AffScalarVolInputSpec
306
+ output_spec = AffScalarVolOutputSpec
307
307
_cmd = 'affineScalarVolume'
308
308
309
309
def _format_arg (self , name , spec , value ):
310
310
if name == 'interpolation' :
311
311
value = {'trilinear' : 0 , 'NN' : 1 }[value ]
312
- return super (affScalarVol , self )._format_arg (name , spec , value )
312
+ return super (AffScalarVol , self )._format_arg (name , spec , value )
313
313
314
314
315
- class diffeoSymTensor3DVolInputSpec (CommandLineInputSpec ):
315
+ class DiffeoSymTensor3DVolInputSpec (CommandLineInputSpec ):
316
316
in_file = File (desc = 'moving tensor volume' , exists = True ,
317
317
argstr = "-in %s" , mandatory = True )
318
318
out_file = File (desc = 'output filename' ,
@@ -335,44 +335,44 @@ class diffeoSymTensor3DVolInputSpec(CommandLineInputSpec):
335
335
desc = 'xyz voxel size (superseded by target)' ,
336
336
argstr = "-vsize %g %g %g" , xor = ['target' ])
337
337
flip = traits .Tuple ((traits .Int (), traits .Int (), traits .Int ()),
338
- exists = True , argstr = "-flip %d %d %d" )
338
+ argstr = "-flip %d %d %d" )
339
339
resampling_type = traits .Enum ('backward' , 'forward' ,
340
340
desc = 'use backward or forward resampling' ,
341
- exists = True , argstr = "-type %s" )
341
+ argstr = "-type %s" )
342
342
343
343
344
- class diffeoSymTensor3DVolOutputSpec (TraitedSpec ):
344
+ class DiffeoSymTensor3DVolOutputSpec (TraitedSpec ):
345
345
out_file = File (exists = True )
346
346
347
347
348
- class diffeoSymTensor3DVol (CommandLineDtitk ):
348
+ class DiffeoSymTensor3DVol (CommandLineDtitk ):
349
349
"""
350
350
Applies diffeomorphic transform to a tensor volume
351
351
352
352
Example
353
353
-------
354
354
355
355
>>> from nipype.interfaces import dtitk
356
- >>> node = dtitk.diffeoSymTensor3DVol ()
356
+ >>> node = dtitk.DiffeoSymTensor3DVol ()
357
357
>>> node.inputs.in_file = 'im1.nii'
358
358
>>> node.inputs.transform = 'im_warp.df.nii'
359
- >>> node.cmdline #doctest:
360
- 'deformationSymTensor3DVolume -df FD -in im1.nii -interp LEI -out\
359
+ >>> node.cmdline
360
+ 'deformationSymTensor3DVolume -df FD -in im1.nii -interp LEI -out
361
361
im1_diffeoxfmd.nii -reorient PPD -trans im_warp.df.nii'
362
362
>>> node.run() # doctest: +SKIP
363
363
"""
364
364
365
- input_spec = diffeoSymTensor3DVolInputSpec
366
- output_spec = diffeoSymTensor3DVolOutputSpec
365
+ input_spec = DiffeoSymTensor3DVolInputSpec
366
+ output_spec = DiffeoSymTensor3DVolOutputSpec
367
367
_cmd = 'deformationSymTensor3DVolume'
368
368
369
369
def _format_arg (self , name , spec , value ):
370
370
if name == 'resampling_type' :
371
371
value = {'forward' : 0 , 'backward' : 1 }[value ]
372
- return super (diffeoSymTensor3DVol , self )._format_arg (name , spec , value )
372
+ return super (DiffeoSymTensor3DVol , self )._format_arg (name , spec , value )
373
373
374
374
375
- class diffeoScalarVolInputSpec (CommandLineInputSpec ):
375
+ class DiffeoScalarVolInputSpec (CommandLineInputSpec ):
376
376
in_file = File (desc = 'moving scalar volume' , exists = True ,
377
377
argstr = "-in %s" , mandatory = True )
378
378
out_file = File (desc = 'output filename' ,
@@ -387,45 +387,44 @@ class diffeoScalarVolInputSpec(CommandLineInputSpec):
387
387
desc = 'xyz voxel size (superseded by target)' ,
388
388
argstr = "-vsize %g %g %g" , xor = ['target' ])
389
389
flip = traits .Tuple ((traits .Int (), traits .Int (), traits .Int ()),
390
- exists = True , argstr = "-flip %d %d %d" )
390
+ argstr = "-flip %d %d %d" )
391
391
resampling_type = traits .Enum ('backward' , 'forward' ,
392
392
desc = 'use backward or forward resampling' ,
393
- exists = True , argstr = "-type %s" )
393
+ argstr = "-type %s" )
394
394
interpolation = traits .Enum ('trilinear' , 'NN' ,
395
395
desc = 'trilinear, or nearest neighbor' ,
396
- exists = True , argstr = "-interp %s" ,
396
+ argstr = "-interp %s" ,
397
397
usedefault = True )
398
398
399
399
400
- class diffeoScalarVolOutputSpec (TraitedSpec ):
400
+ class DiffeoScalarVolOutputSpec (TraitedSpec ):
401
401
out_file = File (desc = 'moved volume' , exists = True )
402
402
403
403
404
- class diffeoScalarVol (CommandLineDtitk ):
404
+ class DiffeoScalarVol (CommandLineDtitk ):
405
405
"""
406
406
Applies diffeomorphic transform to a scalar volume
407
407
408
408
Example
409
409
-------
410
410
411
411
>>> from nipype.interfaces import dtitk
412
- >>> node = dtitk.diffeoScalarVol ()
412
+ >>> node = dtitk.DiffeoScalarVol ()
413
413
>>> node.inputs.in_file = 'im1.nii'
414
414
>>> node.inputs.transform = 'im_warp.df.nii'
415
415
>>> node.cmdline
416
- 'deformationScalarVolume -in im1.nii -interp 0 -out im1_diffeoxfmd.nii\
416
+ 'deformationScalarVolume -in im1.nii -interp 0 -out im1_diffeoxfmd.nii
417
417
-trans im_warp.df.nii'
418
418
>>> node.run() # doctest: +SKIP
419
419
"""
420
420
421
- input_spec = diffeoScalarVolInputSpec
422
- output_spec = diffeoScalarVolOutputSpec
421
+ input_spec = DiffeoScalarVolInputSpec
422
+ output_spec = DiffeoScalarVolOutputSpec
423
423
_cmd = 'deformationScalarVolume'
424
424
425
425
def _format_arg (self , name , spec , value ):
426
426
if name == 'resampling_type' :
427
427
value = {'forward' : 0 , 'backward' : 1 }[value ]
428
- super (diffeoScalarVol , self )._format_arg (name , spec , value )
429
- if name == 'interpolation' :
428
+ elif name == 'interpolation' :
430
429
value = {'trilinear' : 0 , 'NN' : 1 }[value ]
431
- return super (diffeoScalarVol , self )._format_arg (name , spec , value )
430
+ return super (DiffeoScalarVol , self )._format_arg (name , spec , value )
0 commit comments