@@ -87,7 +87,7 @@ class DcmStack(NiftiGeneratorBase):
87
87
>>> stacker.inputs.dicom_files = 'path/to/series/'
88
88
>>> stacker.run()
89
89
>>> result.outputs.out_file
90
- 'sequence.nii.gz'
90
+ '/path/to/cwd/ sequence.nii.gz'
91
91
'''
92
92
input_spec = DcmStackInputSpec
93
93
output_spec = DcmStackOutputSpec
@@ -132,23 +132,23 @@ def _list_outputs(self):
132
132
class GroupAndStackOutputSpec (TraitedSpec ):
133
133
out_list = traits .List (desc = "List of output nifti files" )
134
134
135
- class GroupAndStack (NiftiGeneratorBase ):
136
- '''Create (potentially) multiple Nifti files for a set of DICOM files.'''
135
+ class GroupAndStack (DcmStack ):
136
+ '''Create (potentially) multiple Nifti files for a set of DICOM files.
137
+ '''
137
138
input_spec = DcmStackInputSpec
138
139
output_spec = GroupAndStackOutputSpec
139
140
140
141
def _run_interface (self , runtime ):
141
142
src_paths = self ._get_filelist (self .inputs .dicom_files )
142
- stacks = \
143
- dcmstack .parse_and_stack (src_paths ,
144
- key_format = self .inputs .out_format
145
- )
143
+ stacks = dcmstack .parse_and_stack (src_paths )
146
144
147
145
self .out_list = []
148
146
for key , stack in stacks .iteritems ():
149
- nw = NiftiWrapper (stack .to_nifti (embed_meta = self . inputs . embed_meta ))
147
+ nw = NiftiWrapper (stack .to_nifti (embed_meta = True ))
150
148
const_meta = nw .meta_ext .get_class_dict (('global' , 'const' ))
151
149
out_path = self ._get_out_path (const_meta )
150
+ if not self .inputs .embed_meta :
151
+ nw .remove_extension ()
152
152
nb .save (nw .nii_img , out_path )
153
153
self .out_list .append (out_path )
154
154
0 commit comments