1
1
__author__ = 'kjordan'
2
2
3
3
from ..base import TraitedSpec , CommandLineInputSpec , File , \
4
- traits , isdefined , split_filename
4
+ traits , isdefined
5
5
import os
6
6
from .base import CommandLineDtitk
7
7
@@ -44,8 +44,8 @@ def _list_outputs(self):
44
44
outputs ["out_file" ] = self ._gen_fname (self .inputs .in_file ,
45
45
suffix = self ._suffix ,
46
46
ext = '.' + '.' .join (
47
- self .inputs .in_file .split (
48
- "." )[1 :]))
47
+ self .inputs .in_file .
48
+ split ( "." )[1 :]))
49
49
outputs ["out_file" ] = os .path .abspath (outputs ["out_file" ])
50
50
return outputs
51
51
@@ -96,8 +96,8 @@ def _list_outputs(self):
96
96
outputs ["out_file" ] = self ._gen_fname (self .inputs .in_file ,
97
97
suffix = self ._suffix ,
98
98
ext = '.' + '.' .join (
99
- self .inputs .in_file .split (
100
- "." )[1 :]))
99
+ self .inputs .in_file .
100
+ split ( "." )[1 :]))
101
101
outputs ["out_file" ] = os .path .abspath (outputs ["out_file" ])
102
102
return outputs
103
103
@@ -112,13 +112,14 @@ def _gen_filename(self, name):
112
112
113
113
class SVAdjustVoxSpInputSpec (CommandLineInputSpec ):
114
114
in_file = traits .Str (desc = "image to resample" , exists = True ,
115
- mandatory = True , position = 0 , argstr = "-in %s" )
115
+ mandatory = True , position = 0 , argstr = "-in %s" )
116
116
in_target = traits .Str (desc = 'target volume' , exists = True , mandatory = False ,
117
117
position = 2 , argstr = "-target %s" )
118
118
in_voxsz = traits .Str (desc = 'resampled voxel size' , exists = True ,
119
119
mandatory = False , position = 3 , argstr = "-vsize %s" )
120
120
out_path = traits .Str (desc = 'output path' , exists = True , mandatory = False ,
121
- position = 1 , argstr = "-out %s" , name_source = "in_volume" ,
121
+ position = 1 , argstr = "-out %s" ,
122
+ name_source = "in_file" ,
122
123
name_template = '%s_origmvd.nii.gz' )
123
124
origin = traits .Str (desc = 'xyz voxel size' , exists = True , mandatory = False ,
124
125
position = 4 , argstr = '-origin %s' )
@@ -152,8 +153,8 @@ def _list_outputs(self):
152
153
outputs ["out_file" ] = self ._gen_fname (self .inputs .in_file ,
153
154
suffix = self ._suffix ,
154
155
ext = '.' + '.' .join (
155
- self .inputs .in_file .split (
156
- "." )[1 :]))
156
+ self .inputs .in_file .
157
+ plit ( "." )[1 :]))
157
158
outputs ["out_file" ] = os .path .abspath (outputs ["out_file" ])
158
159
return outputs
159
160
@@ -172,7 +173,7 @@ class TVResampleInputSpec(CommandLineInputSpec):
172
173
mandatory = False , position = 2 , argstr = "-vsize %s" )
173
174
out_path = traits .Str (desc = 'output path' , exists = True , mandatory = False ,
174
175
position = 3 , argstr = "-out %s" ,
175
- name_source = "in_volume " ,
176
+ name_source = "in_file " ,
176
177
name_template = "%s_resampled.nii.gz" )
177
178
178
179
@@ -204,8 +205,8 @@ def _list_outputs(self):
204
205
outputs ["out_file" ] = self ._gen_fname (self .inputs .in_file ,
205
206
suffix = self ._suffix ,
206
207
ext = '.' + '.' .join (
207
- self .inputs .in_file .split (
208
- "." )[1 :]))
208
+ self .inputs .in_file .
209
+ split ( "." )[1 :]))
209
210
outputs ["out_file" ] = os .path .abspath (outputs ["out_file" ])
210
211
return outputs
211
212
@@ -217,14 +218,15 @@ def _gen_filename(self, name):
217
218
218
219
class SVResampleInputSpec (CommandLineInputSpec ):
219
220
in_file = traits .Str (desc = "image to resample" , exists = True ,
220
- mandatory = True , position = 0 , argstr = "-in %s" )
221
+ mandatory = True , position = 0 , argstr = "-in %s" )
221
222
in_arraysz = traits .Str (desc = 'resampled array size' , exists = True ,
222
- mandatory = False , position = 1 , \
223
+ mandatory = False , position = 1 ,
223
224
argstr = "-size %s" )
224
225
in_voxsz = traits .Str (desc = 'resampled voxel size' , exists = True ,
225
226
mandatory = False , position = 2 , argstr = "-vsize %s" )
226
227
out_path = traits .Str (desc = 'output path' , exists = True , mandatory = False ,
227
- position = 3 , argstr = "-out %s" , name_source = "in_volume" ,
228
+ position = 3 , argstr = "-out %s" ,
229
+ name_source = "in_file" ,
228
230
name_template = "%s_resampled.nii.gz" )
229
231
230
232
@@ -256,8 +258,8 @@ def _list_outputs(self):
256
258
outputs ["out_file" ] = self ._gen_fname (self .inputs .in_file ,
257
259
suffix = self ._suffix ,
258
260
ext = '.' + '.' .join (
259
- self .inputs .in_file .split (
260
- "." )[1 :]))
261
+ self .inputs .in_file .
262
+ split ( "." )[1 :]))
261
263
outputs ["out_file" ] = os .path .abspath (outputs ["out_file" ])
262
264
return outputs
263
265
@@ -269,7 +271,7 @@ def _gen_filename(self, name):
269
271
270
272
class TVtoolInputSpec (CommandLineInputSpec ):
271
273
in_file = traits .Str (desc = "image to resample" , exists = True ,
272
- mandatory = False , position = 0 , argstr = "-in %s" )
274
+ mandatory = False , position = 0 , argstr = "-in %s" )
273
275
in_flag = traits .Enum ('fa' , 'tr' , 'ad' , 'rd' , 'pd' , 'rgb' , exists = True ,
274
276
mandatory = False , position = 1 , argstr = "-%s" , desc = '' )
275
277
@@ -303,8 +305,8 @@ def _list_outputs(self):
303
305
outputs ["out_file" ] = self ._gen_fname (self .inputs .in_file ,
304
306
suffix = _suffix ,
305
307
ext = '.' + '.' .join (
306
- self .inputs .in_file .split (
307
- "." )[1 :]))
308
+ self .inputs .in_file .
309
+ split ( "." )[1 :]))
308
310
outputs ["out_file" ] = os .path .abspath (outputs ["out_file" ])
309
311
return outputs
310
312
@@ -316,7 +318,7 @@ def _gen_filename(self, name):
316
318
317
319
class BinThreshInputSpec (CommandLineInputSpec ):
318
320
in_file = traits .Str (desc = '' , exists = True , mandatory = False , position = 0 ,
319
- argstr = "%s" )
321
+ argstr = "%s" )
320
322
out_path = traits .Str (desc = '' , exists = True , mandatory = False , position = 1 ,
321
323
argstr = "%s" )
322
324
in_numbers = traits .Str (desc = 'LB UB inside_value outside_value' ,
@@ -354,8 +356,8 @@ def _list_outputs(self):
354
356
outputs ["out_file" ] = self ._gen_fname (self .inputs .in_file ,
355
357
suffix = self ._suffix ,
356
358
ext = '.' + '.' .join (
357
- self .inputs .in_file .split (
358
- "." )[1 :]))
359
+ self .inputs .in_file .
360
+ split ( "." )[1 :]))
359
361
outputs ["out_file" ] = os .path .abspath (outputs ["out_file" ])
360
362
return outputs
361
363
0 commit comments