Summary of what happened:
I’m trying to use an specific ROI file to mask a functional image (output from fmriprep) to get the average timeseries for that ROI (vmPFC). I’ve generated a NiftiMasker image, but am unsure how to apply it to the functional image.
Command used (and if a helper script was used, a link to the helper script or the command generated):
# Load mask
mask_file = 'vmpfc_association-test_z_FDR_0.01.nii.gz'
mask_file = nilearn.image.math_img("a>=7", a=mask_file)
%matplotlib inline
nilearn.plotting.plot_roi(mask_file)
plt.savefig('vmPFCMask.eps',format='eps')
# Create a masker
fwhm = 4
masker = nilearn.input_data.NiftiMasker(mask_img=mask_file,
smoothing_fwhm=fwhm, standardize=False,
detrend=False, verbose=5)
When trying to do the following, I get an error: ‘NiftiMasker’ object has no attribute 'maps’
ts = roi.extract_timecourse_from_nii(masker,
func_file,
confounds=confounds.values,
t_r=1.0,
high_pass=1./128,
)
Would appreciate any help on this! Thanks.