@@ -56,8 +56,10 @@ class DcmStackInputSpec(NiftiGeneratorBaseInputSpec):
56
56
traits .Str (),
57
57
mandatory = True )
58
58
embed_meta = traits .Bool (desc = "Embed DICOM meta data into result" )
59
- exclude_regexes = traits .List (desc = "Meta data to exclude, suplementing any default exclude filters" )
60
- include_regexes = traits .List (desc = "Meta data to include, overriding any exclude filters" )
59
+ exclude_regexes = traits .List (desc = "Meta data to exclude, suplementing "
60
+ "any default exclude filters" )
61
+ include_regexes = traits .List (desc = "Meta data to include, overriding any "
62
+ "exclude filters" )
61
63
62
64
class DcmStackOutputSpec (TraitedSpec ):
63
65
out_file = traits .File (exists = True )
@@ -92,7 +94,8 @@ def _run_interface(self, runtime):
92
94
stack .add_dcm (src_dcm )
93
95
nii = stack .to_nifti (embed_meta = True )
94
96
nw = NiftiWrapper (nii )
95
- self .out_path = self ._get_out_path (nw .meta_ext .get_class_dict (('global' , 'const' )))
97
+ self .out_path = \
98
+ self ._get_out_path (nw .meta_ext .get_class_dict (('global' , 'const' )))
96
99
if not self .inputs .embed_meta :
97
100
nw .remove_extension ()
98
101
nb .save (nii , self .out_path )
@@ -122,7 +125,8 @@ def _run_interface(self, runtime):
122
125
self .out_list = []
123
126
for key , stack in stacks .iteritems ():
124
127
nw = NiftiWrapper (stack .to_nifti (embed_meta = self .inputs .embed_meta ))
125
- out_path = self ._get_out_path (nw .meta_ext .get_class_dict (('global' , 'const' )))
128
+ const_meta = nw .meta_ext .get_class_dict (('global' , 'const' ))
129
+ out_path = self ._get_out_path (const_meta )
126
130
nb .save (nw .nii_img , out_path )
127
131
self .out_list .append (out_path )
128
132
@@ -267,7 +271,8 @@ def _run_interface(self, runtime):
267
271
else :
268
272
merge_dim = self .inputs .merge_dim
269
273
merged = NiftiWrapper .from_sequence (nws , merge_dim )
270
- self .out_path = self ._get_out_path (merged .meta_ext .get_class_dict (('global' , 'const' )))
274
+ const_meta = merged .meta_ext .get_class_dict (('global' , 'const' ))
275
+ self .out_path = self ._get_out_path (const_meta )
271
276
nb .save (merged .nii_img , self .out_path )
272
277
return runtime
273
278
@@ -303,7 +308,8 @@ def _run_interface(self, runtime):
303
308
else :
304
309
split_dim = self .inputs .split_dim
305
310
for split_nw in nw .split (split_dim ):
306
- out_path = self ._get_out_path (split_nw .meta_ext .get_class_dict (('global' , 'const' )))
311
+ const_meta = split_nw .meta_ext .get_class_dict (('global' , 'const' ))
312
+ out_path = self ._get_out_path (const_meta )
307
313
nb .save (split_nw .nii_img , out_path )
308
314
self .out_list .append (out_path )
309
315
0 commit comments