@@ -137,65 +137,44 @@ def _list_outputs(self):
137
137
self .inputs .output_product_image )
138
138
return outputs
139
139
140
-
141
- class JacobianDeterminantInputSpec (ANTSCommandInputSpec ):
142
- dimension = traits .Enum (3 , 2 , argstr = '%d' , usedefault = False , mandatory = True ,
140
+ class CreateJacobianDeterminantImageInputSpec (ANTSCommandInputSpec ):
141
+ imageDimension = traits .Enum (3 , 2 , argstr = '%d' , usedefault = False , mandatory = True ,
143
142
position = 0 , desc = 'image dimension (2 or 3)' )
144
- warp_file = File (argstr = '%s' , exists = True , mandatory = True ,
145
- position = 1 , desc = 'input warp file' )
146
- output_prefix = File (argstr = '%s' , genfile = True , hash_files = False ,
143
+ deformationField = File (argstr = '%s' , exists = True , mandatory = True ,
144
+ position = 1 , desc = 'deformation transformation file' )
145
+ outputImage = File (argstr = '%s' , mandatory = True ,
147
146
position = 2 ,
148
- desc = ('prefix of the output image filename: '
149
- 'PREFIX(log)jacobian.nii.gz' ))
150
- use_log = traits .Enum (0 , 1 , argstr = '%d' , position = 3 ,
151
- desc = 'log transform the jacobian determinant' )
152
- template_mask = File (argstr = '%s' , exists = True , position = 4 ,
153
- desc = 'template mask to adjust for head size' )
154
- norm_by_total = traits .Enum (0 , 1 , argstr = '%d' , position = 5 ,
155
- desc = ('normalize jacobian by total in mask to '
156
- 'adjust for head size' ))
157
- projection_vector = traits .List (traits .Float (), argstr = '%s' , sep = 'x' ,
158
- position = 6 ,
159
- desc = 'vector to project warp against' )
160
-
147
+ desc = 'output filename' )
148
+ doLogJacobian = traits .Enum (0 , 1 , argstr = '%d' , mandatory = False , position = 3 ,
149
+ desc = 'return the log jacobian' )
150
+ useGeometric = traits .Enum (0 , 1 , argstr = '%d' , mandatory = False , position = 4 ,
151
+ desc = 'return the geometric jacobian' )
161
152
162
- class JacobianDeterminantOutputSpec (TraitedSpec ):
163
- jacobian_image = File (exists = True , desc = '(log transformed) jacobian image' )
153
+ class CreateJacobianDeterminantImageOutputSpec (TraitedSpec ):
154
+ jacobian_image = File (exists = True , desc = 'jacobian image' )
164
155
165
-
166
- class JacobianDeterminant (ANTSCommand ):
156
+ class CreateJacobianDeterminantImage (ANTSCommand ):
167
157
"""
168
158
Examples
169
159
--------
170
- >>> from nipype.interfaces.ants import JacobianDeterminant
171
- >>> jacobian = JacobianDeterminant()
172
- >>> jacobian.inputs.dimension = 3
173
- >>> jacobian.inputs.warp_file = 'ants_Warp.nii.gz'
174
- >>> jacobian.inputs.output_prefix = 'Sub001_'
175
- >>> jacobian.inputs.use_log = 1
160
+ >>> from nipype.interfaces.ants import CreateJacobianDeterminantImage
161
+ >>> jacobian = CreateJacobianDeterminantImage()
162
+ >>> jacobian.inputs.imageDimension = 3
163
+ >>> jacobian.inputs.deformationField = 'ants_Warp.nii.gz'
164
+ >>> jacobian.inputs.outputImage = 'out_name.nii.gz'
176
165
>>> jacobian.cmdline # doctest: +IGNORE_UNICODE
177
- 'ANTSJacobian 3 ants_Warp.nii.gz Sub001_ 1 '
166
+ 'CreateJacobianDeterminantImage 3 ants_Warp.nii.gz out_name.nii.gz '
178
167
"""
179
168
180
- _cmd = 'ANTSJacobian '
181
- input_spec = JacobianDeterminantInputSpec
182
- output_spec = JacobianDeterminantOutputSpec
169
+ _cmd = 'CreateJacobianDeterminantImage '
170
+ input_spec = CreateJacobianDeterminantImageInputSpec
171
+ output_spec = CreateJacobianDeterminantImageOutputSpec
183
172
184
- def _gen_filename (self , name ):
185
- if name == 'output_prefix' :
186
- output = self .inputs .output_prefix
187
- if not isdefined (output ):
188
- _ , name , ext = split_filename (self .inputs .warp_file )
189
- output = name + '_'
190
- return output
191
- return None
173
+ def _format_arg (self , opt , spec , val ):
174
+ return super (CreateJacobianDeterminantImage , self )._format_arg (opt , spec , val )
192
175
193
176
def _list_outputs (self ):
194
177
outputs = self ._outputs ().get ()
195
- if self .inputs .use_log == 1 :
196
- outputs ['jacobian_image' ] = os .path .abspath (
197
- self ._gen_filename ('output_prefix' ) + 'logjacobian.nii.gz' )
198
- else :
199
- outputs ['jacobian_image' ] = os .path .abspath (
200
- self ._gen_filename ('output_prefix' ) + 'jacobian.nii.gz' )
178
+ outputs ['jacobian_image' ] = os .path .abspath (
179
+ self .inputs .outputImage )
201
180
return outputs
0 commit comments