@@ -56,8 +56,10 @@ class DcmStackInputSpec(NiftiGeneratorBaseInputSpec):
5656 traits .Str (),
5757 mandatory = True )
5858 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" )
6163
6264class DcmStackOutputSpec (TraitedSpec ):
6365 out_file = traits .File (exists = True )
@@ -92,7 +94,8 @@ def _run_interface(self, runtime):
9294 stack .add_dcm (src_dcm )
9395 nii = stack .to_nifti (embed_meta = True )
9496 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' )))
9699 if not self .inputs .embed_meta :
97100 nw .remove_extension ()
98101 nb .save (nii , self .out_path )
@@ -122,7 +125,8 @@ def _run_interface(self, runtime):
122125 self .out_list = []
123126 for key , stack in stacks .iteritems ():
124127 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 )
126130 nb .save (nw .nii_img , out_path )
127131 self .out_list .append (out_path )
128132
@@ -267,7 +271,8 @@ def _run_interface(self, runtime):
267271 else :
268272 merge_dim = self .inputs .merge_dim
269273 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 )
271276 nb .save (merged .nii_img , self .out_path )
272277 return runtime
273278
@@ -303,7 +308,8 @@ def _run_interface(self, runtime):
303308 else :
304309 split_dim = self .inputs .split_dim
305310 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 )
307313 nb .save (split_nw .nii_img , out_path )
308314 self .out_list .append (out_path )
309315
0 commit comments