@@ -220,14 +220,12 @@ class AllineateInputSpec(AFNICommandInputSpec):
220
220
out_file = File (
221
221
desc = 'output file from 3dAllineate' ,
222
222
argstr = '-prefix %s' ,
223
- name_source = 'in_file' ,
224
- name_template = '%s_allineate' ,
225
223
genfile = True ,
226
224
xor = ['allcostx' ])
227
225
out_param_file = File (
228
226
argstr = '-1Dparam_save %s' ,
229
227
desc = 'Save the warp parameters in ASCII (.1D) format.' ,
230
- xor = ['in_param_file' ])
228
+ xor = ['in_param_file' , 'allcostx' ])
231
229
in_param_file = File (
232
230
exists = True ,
233
231
argstr = '-1Dparam_apply %s' ,
@@ -237,7 +235,7 @@ class AllineateInputSpec(AFNICommandInputSpec):
237
235
out_matrix = File (
238
236
argstr = '-1Dmatrix_save %s' ,
239
237
desc = 'Save the transformation matrix for each volume.' ,
240
- xor = ['in_matrix' ])
238
+ xor = ['in_matrix' , 'allcostx' ])
241
239
in_matrix = File (
242
240
desc = 'matrix to align input file' ,
243
241
argstr = '-1Dmatrix_apply %s' ,
@@ -247,14 +245,12 @@ class AllineateInputSpec(AFNICommandInputSpec):
247
245
desc = 'overwrite output file if it already exists' ,
248
246
argstr = '-overwrite' )
249
247
250
- # TODO: implement sensible xors for allcostx and suppres prefix in command when allcosx is used
251
248
allcostx = File (
252
249
desc = 'Compute and print ALL available cost functionals for the un-warped inputs'
253
250
'AND THEN QUIT. If you use this option none of the other expected outputs will be produced' ,
254
251
argstr = '-allcostx |& tee %s' ,
255
252
position = - 1 ,
256
- xor = ['out_file' ])
257
-
253
+ xor = ['out_file' , 'out_matrix' , 'out_param_file' , 'out_weight_file' ])
258
254
_cost_funcs = [
259
255
'leastsq' , 'ls' ,
260
256
'mutualinfo' , 'mi' ,
@@ -365,7 +361,8 @@ class AllineateInputSpec(AFNICommandInputSpec):
365
361
'Must be defined on the same grid as the base dataset' )
366
362
out_weight_file = traits .File (
367
363
argstr = '-wtprefix %s' ,
368
- desc = 'Write the weight volume to disk as a dataset' )
364
+ desc = 'Write the weight volume to disk as a dataset' ,
365
+ xor = ['allcostx' ])
369
366
source_mask = File (
370
367
exists = True ,
371
368
argstr = '-source_mask %s' ,
@@ -445,7 +442,7 @@ class Allineate(AFNICommand):
445
442
>>> allineate.inputs.out_file = 'functional_allineate.nii'
446
443
>>> allineate.inputs.in_matrix = 'cmatrix.mat'
447
444
>>> allineate.cmdline # doctest: +ALLOW_UNICODE
448
- '3dAllineate -source functional.nii -1Dmatrix_apply cmatrix.mat -prefix functional_allineate.nii '
445
+ '3dAllineate -source functional.nii -prefix functional_allineate.nii -1Dmatrix_apply cmatrix.mat '
449
446
>>> res = allineate.run() # doctest: +SKIP
450
447
451
448
>>> from nipype.interfaces import afni
@@ -454,7 +451,7 @@ class Allineate(AFNICommand):
454
451
>>> allineate.inputs.reference = 'structural.nii'
455
452
>>> allineate.inputs.allcostx = 'out.allcostX.txt'
456
453
>>> allineate.cmdline # doctest: +ALLOW_UNICODE
457
- '3dAllineate -source functional.nii -prefix functional_allineate - base structural.nii -allcostx |& tee out.allcostX.txt'
454
+ '3dAllineate -source functional.nii -base structural.nii -allcostx |& tee out.allcostX.txt'
458
455
>>> res = allineate.run() # doctest: +SKIP
459
456
"""
460
457
@@ -493,8 +490,8 @@ def _list_outputs(self):
493
490
else :
494
491
outputs ['out_param_file' ] = op .abspath (self .inputs .out_param_file )
495
492
496
- if isdefined (self .inputs .allcostX ):
497
- outputs ['allcostX' ] = os .path .abspath (os .path .join (os .getcwd (),\
493
+ if isdefined (self .inputs .allcostx ):
494
+ outputs ['allcostX' ] = os .path .abspath (os .path .join (os .getcwd (),
498
495
self .inputs .allcostx ))
499
496
return outputs
500
497
0 commit comments