@@ -84,8 +84,8 @@ def _gen_outfilename(self):
84
84
class DWI2TensorInputSpec (CommandLineInputSpec ):
85
85
in_file = InputMultiPath (File (exists = True ), argstr = '%s' , mandatory = True ,
86
86
position = - 2 , desc = 'Diffusion-weighted images' )
87
- out_filename = File (genfile = True , argstr = '%s' , position = - 1 ,
88
- desc = ' Output tensor filename' )
87
+ out_filename = File (name_template = "%s_tensor.mif" , name_source = "in_file" , output_name = "tensor" ,
88
+ argstr = '%s' , posidesc = ' Output tensor filename', position = - 1 )
89
89
encoding_file = File (argstr = '-grad %s' , position = 2 ,
90
90
desc = ('Encoding file supplied as a 4xN text file with '
91
91
'each line is in the format [ X Y Z b ], where '
@@ -114,27 +114,15 @@ class DWI2Tensor(CommandLine):
114
114
>>> dwi2tensor = mrt.DWI2Tensor()
115
115
>>> dwi2tensor.inputs.in_file = 'dwi.mif'
116
116
>>> dwi2tensor.inputs.encoding_file = 'encoding.txt'
117
+ >>> dwi2tensor.cmdline
118
+ 'dwi2tensor -grad encoding.txt dwi.mif dwi_tensor.mif'
117
119
>>> dwi2tensor.run() # doctest: +SKIP
118
120
"""
119
121
120
122
_cmd = 'dwi2tensor'
121
123
input_spec = DWI2TensorInputSpec
122
124
output_spec = DWI2TensorOutputSpec
123
125
124
- def _list_outputs (self ):
125
- outputs = self .output_spec ().get ()
126
- outputs ['tensor' ] = op .abspath (self ._gen_outfilename ())
127
- return outputs
128
-
129
- def _gen_filename (self , name ):
130
- if name is 'out_filename' :
131
- return self ._gen_outfilename ()
132
- else :
133
- return None
134
- def _gen_outfilename (self ):
135
- _ , name , _ = split_filename (self .inputs .in_file [0 ])
136
- return name + '_tensor.mif'
137
-
138
126
class Tensor2VectorInputSpec (CommandLineInputSpec ):
139
127
in_file = File (exists = True , argstr = '%s' , mandatory = True , position = - 2 ,
140
128
desc = 'Diffusion tensor image' )
0 commit comments