@@ -2947,7 +2947,10 @@ class GennlxfmInputSpec(CommandLineInputSpec):
2947
2947
desc = 'output file' ,
2948
2948
genfile = True ,
2949
2949
argstr = '%s' ,
2950
- position = - 1 ,)
2950
+ position = - 1 ,
2951
+ name_source = ['like' ],
2952
+ hash_files = False ,
2953
+ name_template = '%s_gennlxfm.xfm' )
2951
2954
2952
2955
verbose = traits .Bool (
2953
2956
desc = 'Print out log messages. Default: False.' ,
@@ -2987,39 +2990,19 @@ class Gennlxfm(CommandLine):
2987
2990
--------
2988
2991
2989
2992
>>> from nipype.interfaces.minc import Gennlxfm
2990
- >>> gennlxfm = Gennlxfm(step=1)
2991
- >>> gennlxfmiso.run() # doctest: +SKIP
2993
+ >>> from nipype.interfaces.minc.testdata import minc2Dfile
2994
+ >>> gennlxfm = Gennlxfm(step=1, like=minc2Dfile)
2995
+ >>> gennlxfm.run() # doctest: +SKIP
2992
2996
2993
2997
"""
2994
2998
2995
2999
input_spec = GennlxfmInputSpec
2996
3000
output_spec = GennlxfmOutputSpec
2997
3001
_cmd = 'gennlxfm'
2998
3002
2999
- def _gen_filename (self , name ):
3000
- if name == 'output_file' :
3001
- output_file = self .inputs .output_file
3002
-
3003
- if isdefined (output_file ):
3004
- return os .path .abspath (output_file )
3005
- elif isdefined (self .inputs .like ):
3006
- return aggregate_filename (
3007
- [self .inputs .like ], 'gennlxfm_output' ) + '.xfm'
3008
- else :
3009
- assert False , 'Cannot determine output file as neither "output_file" nor "like" were specified.'
3010
- else :
3011
- raise NotImplemented
3012
-
3013
- def _gen_outfilename (self ):
3014
- return self ._gen_filename ('output_file' )
3015
-
3016
3003
def _list_outputs (self ):
3017
- # FIXME The xfm output has only the basename of the grid file, will this cause problems?
3018
- # See also lines 89-92 of gennlxfm.
3019
- outputs = self .output_spec ().get ()
3020
- outputs ['output_file' ] = os .path .abspath (self ._gen_outfilename ())
3021
- outputs ['output_grid' ] = re .sub (
3022
- '.(nlxfm|xfm)$' , '_grid_0.mnc' , outputs ['output_file' ])
3004
+ outputs = super (Gennlxfm , self )._list_outputs ()
3005
+ outputs ['output_grid' ] = re .sub ('.(nlxfm|xfm)$' , '_grid_0.mnc' , outputs ['output_file' ])
3023
3006
return outputs
3024
3007
3025
3008
0 commit comments