@@ -220,14 +220,12 @@ class AllineateInputSpec(AFNICommandInputSpec):
220220 out_file = File (
221221 desc = 'output file from 3dAllineate' ,
222222 argstr = '-prefix %s' ,
223- name_source = 'in_file' ,
224- name_template = '%s_allineate' ,
225223 genfile = True ,
226224 xor = ['allcostx' ])
227225 out_param_file = File (
228226 argstr = '-1Dparam_save %s' ,
229227 desc = 'Save the warp parameters in ASCII (.1D) format.' ,
230- xor = ['in_param_file' ])
228+ xor = ['in_param_file' , 'allcostx' ])
231229 in_param_file = File (
232230 exists = True ,
233231 argstr = '-1Dparam_apply %s' ,
@@ -237,7 +235,7 @@ class AllineateInputSpec(AFNICommandInputSpec):
237235 out_matrix = File (
238236 argstr = '-1Dmatrix_save %s' ,
239237 desc = 'Save the transformation matrix for each volume.' ,
240- xor = ['in_matrix' ])
238+ xor = ['in_matrix' , 'allcostx' ])
241239 in_matrix = File (
242240 desc = 'matrix to align input file' ,
243241 argstr = '-1Dmatrix_apply %s' ,
@@ -247,14 +245,12 @@ class AllineateInputSpec(AFNICommandInputSpec):
247245 desc = 'overwrite output file if it already exists' ,
248246 argstr = '-overwrite' )
249247
250- # TODO: implement sensible xors for allcostx and suppres prefix in command when allcosx is used
251248 allcostx = File (
252249 desc = 'Compute and print ALL available cost functionals for the un-warped inputs'
253250 'AND THEN QUIT. If you use this option none of the other expected outputs will be produced' ,
254251 argstr = '-allcostx |& tee %s' ,
255252 position = - 1 ,
256- xor = ['out_file' ])
257-
253+ xor = ['out_file' , 'out_matrix' , 'out_param_file' , 'out_weight_file' ])
258254 _cost_funcs = [
259255 'leastsq' , 'ls' ,
260256 'mutualinfo' , 'mi' ,
@@ -365,7 +361,8 @@ class AllineateInputSpec(AFNICommandInputSpec):
365361 'Must be defined on the same grid as the base dataset' )
366362 out_weight_file = traits .File (
367363 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' ])
369366 source_mask = File (
370367 exists = True ,
371368 argstr = '-source_mask %s' ,
@@ -445,7 +442,7 @@ class Allineate(AFNICommand):
445442 >>> allineate.inputs.out_file = 'functional_allineate.nii'
446443 >>> allineate.inputs.in_matrix = 'cmatrix.mat'
447444 >>> 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 '
449446 >>> res = allineate.run() # doctest: +SKIP
450447
451448 >>> from nipype.interfaces import afni
@@ -454,7 +451,7 @@ class Allineate(AFNICommand):
454451 >>> allineate.inputs.reference = 'structural.nii'
455452 >>> allineate.inputs.allcostx = 'out.allcostX.txt'
456453 >>> 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'
458455 >>> res = allineate.run() # doctest: +SKIP
459456 """
460457
@@ -493,8 +490,8 @@ def _list_outputs(self):
493490 else :
494491 outputs ['out_param_file' ] = op .abspath (self .inputs .out_param_file )
495492
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 (),
498495 self .inputs .allcostx ))
499496 return outputs
500497
0 commit comments