@@ -213,17 +213,27 @@ def _parse_inputs(self):
213
213
def _list_outputs (self ):
214
214
outputs = self ._outputs ().get ()
215
215
pth , _ = os .path .split (self .inputs .spm_mat_file )
216
- mask = os .path .join (pth , 'mask.img' )
216
+ spm12 = '12' in self .version .split ('.' )[0 ]
217
+ if spm12 :
218
+ mask = os .path .join (pth , 'mask.nii' )
219
+ else :
220
+ mask = os .path .join (pth , 'mask.img' )
217
221
outputs ['mask_image' ] = mask
218
222
spm = sio .loadmat (self .inputs .spm_mat_file , struct_as_record = False )
219
223
betas = []
220
224
for vbeta in spm ['SPM' ][0 , 0 ].Vbeta [0 ]:
221
225
betas .append (str (os .path .join (pth , vbeta .fname [0 ])))
222
226
if betas :
223
227
outputs ['beta_images' ] = betas
224
- resms = os .path .join (pth , 'ResMS.img' )
228
+ if spm12 :
229
+ resms = os .path .join (pth , 'ResMS.nii' )
230
+ else :
231
+ resms = os .path .join (pth , 'ResMS.img' )
225
232
outputs ['residual_image' ] = resms
226
- rpv = os .path .join (pth , 'RPV.img' )
233
+ if spm12 :
234
+ rpv = os .path .join (pth , 'RPV.nii' )
235
+ else :
236
+ rpv = os .path .join (pth , 'RPV.img' )
227
237
outputs ['RPVimage' ] = rpv
228
238
spm = os .path .join (pth , 'SPM.mat' )
229
239
outputs ['spm_mat_file' ] = spm
@@ -382,10 +392,17 @@ def _list_outputs(self):
382
392
if con_images :
383
393
outputs ['con_images' ] = con_images
384
394
outputs ['spmT_images' ] = spmT_images
385
- ess = glob (os .path .join (pth , 'ess*.img' ))
395
+ spm12 = '12' in self .version .split ('.' )[0 ]
396
+ if spm12 :
397
+ ess = glob (os .path .join (pth , 'ess*.nii' ))
398
+ else :
399
+ ess = glob (os .path .join (pth , 'ess*.img' ))
386
400
if len (ess ) > 0 :
387
401
outputs ['ess_images' ] = sorted (ess )
388
- spmf = glob (os .path .join (pth , 'spmF*.img' ))
402
+ if spm12 :
403
+ spmf = glob (os .path .join (pth , 'spmF*.nii' ))
404
+ else :
405
+ spmf = glob (os .path .join (pth , 'spmF*.img' ))
389
406
if len (spmf ) > 0 :
390
407
outputs ['spmF_images' ] = sorted (spmf )
391
408
outputs ['spm_mat_file' ] = self .inputs .spm_mat_file
0 commit comments