@@ -14,6 +14,20 @@ class RigidInputSpec(CommandLineInputSpec):
14
14
similarity_metric = traits .Enum ('EDS' , 'GDS' , 'DDS' , 'NMI' , exists = True ,
15
15
mandatory = True , position = 2 , argstr = "%s" ,
16
16
desc = "similarity metric" )
17
+ samplingX = traits .Float (mandatory = True , position = 3 , argstr = "%s" ,
18
+ desc = "dist between samp points (mm)" ,
19
+ default_value = 4 )
20
+ samplingY = traits .Float (mandatory = True , position = 4 , argstr = "%s" ,
21
+ desc = "dist between samp points (mm)" ,
22
+ default_value = 4 )
23
+ samplingZ = traits .Float (mandatory = True , position = 5 , argstr = "%s" ,
24
+ desc = "dist between samp points (mm)" ,
25
+ default_value = 4 )
26
+ ftol = traits .Float (mandatory = True , position = 6 , argstr = "%s" ,
27
+ desc = "cost function tolerance" , default_value = 0.01 )
28
+ useInTrans = traits .Float (mandatory = False , position = 7 , argstr = "%s" ,
29
+ desc = "to initialize with existing xfm set as 1" ,
30
+ default_value = 1 )
17
31
18
32
19
33
class RigidOutputSpec (TraitedSpec ):
@@ -33,23 +47,30 @@ class RigidTask(CommandLineDtitk):
33
47
>>> node.inputs.fixed_file = 'diffusion.nii'
34
48
>>> node.inputs.moving_file = 'diffusion.nii'
35
49
>>> node.inputs.similarity_metric = 'EDS'
50
+ >>> node.inputs.samplingX = 4
51
+ >>> node.inputs.samplingY = 4
52
+ >>> node.inputs.samplingZ = 4
53
+ >>> node.inputs.ftol = 0.01
54
+ >>> node.inputs.useInTrans = 1
36
55
>>> node.run() # doctest: +SKIP
37
56
"""
38
57
input_spec = RigidInputSpec
39
58
output_spec = RigidOutputSpec
40
- _cmd = 'dti_rigid_sn '
59
+ _cmd = 'dti_rigid_reg '
41
60
42
61
def _gen_outfilename (self ):
43
- out_file = self .inputs .out_file
44
- if not isdefined (out_file ) and isdefined (self .inputs .in_file ):
45
- out_file = self ._gen_fname (self .inputs .in_file ,
46
- suffix = '.aff' , change_ext = False )
62
+ # out_file = self.inputs.out_file
63
+ # if not isdefined(out_file) and isdefined(self.inputs.in_file):
64
+ out_file = self ._gen_fname (self .inputs .in_file ,
65
+ suffix = '.aff' , change_ext = False )
66
+ return out_file
47
67
48
68
def _list_outputs (self ):
49
69
outputs = self .output_spec ().get ()
50
- outputs ['out_file_xfm' ] = self ._gen_outfilename ()
51
- outputs ['out_file' ] = self .inputs .in_file .replace ('.nii.gz' ,
52
- '_aff.nii.gz' )
70
+ outputs ['out_file_xfm' ] = self .inputs .moving_file .replace ('.nii.gz' ,
71
+ '.aff' )
72
+ outputs ['out_file' ] = self .inputs .moving_file .replace ('.nii.gz' ,
73
+ '_aff.nii.gz' )
53
74
return outputs
54
75
55
76
def _gen_fname (self , name ):
0 commit comments