File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/fmripost_aroma/interfaces Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ class ICADenoise(SimpleInterface):
155
155
output_spec = _ICADenoiseOutputSpec
156
156
157
157
def _run_interface (self , runtime ):
158
+ import nibabel as nb
158
159
import numpy as np
159
160
import pandas as pd
160
161
from nilearn .maskers import NiftiMasker
@@ -225,7 +226,8 @@ def _run_interface(self, runtime):
225
226
else :
226
227
# Non-aggressive denoising
227
228
# Apply the mask to the data image to get a 2d array
228
- data = apply_mask (bold_file , self .inputs .mask_file )
229
+ bold_img = nb .load (bold_file )
230
+ data = apply_mask (bold_img , self .inputs .mask_file )
229
231
230
232
# Fit GLM to accepted components and rejected components (after adding a constant term)
231
233
regressors = np .hstack (
@@ -244,6 +246,8 @@ def _run_interface(self, runtime):
244
246
245
247
# Save to file
246
248
denoised_img = unmask (data_denoised , self .inputs .mask_file )
249
+ denoised_img .header .set_zooms (bold_img .header .get_zooms ())
250
+ denoised_img .header .set_xyzt_units (* bold_img .header .get_xyzt_units ())
247
251
248
252
self ._results ['denoised_file' ] = os .path .abspath ('denoised.nii.gz' )
249
253
denoised_img .to_filename (self ._results ['denoised_file' ])
You can’t perform that action at this time.
0 commit comments