Summary of what happened:
Dear Sir/Madam
I am a beginner in Python and I am working on constructing functional connectivity from preprocessed fMRI data. Before that, I am trying to apply some denoising steps. First, I used nilearn.interfaces.fmriprep.load_confounds_strategy
to extract the confounds I need, then I applied nilearn.image.clean_img
for denoising. However, I noticed that while the simple_mask
parameter can be passed to nilearn.signal.clean
, it cannot be used with nilearn.image.clean_img
(which is more convenient for me as it takes images as input). I am wondering if there is a way to resolve this?
Additionally, I would like to use an atlas (not included in nilearn.datasets.fetch
) to extract time series signals. How can I import my custom atlas for use in this process?
Command used (and if a helper script was used, a link to the helper script or the command generated):
clean_img = nilearn.image.clean_img(img, runs=None, detrend=True, standardize=True,
confounds=None, low_pass=None, high_pass=None,
t_r=None, ensure_finite=False, mask_img=None)
nib.save(clean_img, 'path/to/save/rest_cleaned.nii.gz')
img_files = 'C:/Users/10852/Desktop/HUproject/derivatives/fmriprep/sub-0002/func/sub-0002_task-gstroop_acq-seq_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz'
[confounds, simplemask] = nilearn.interfaces.fmriprep.load_confounds_strategy(img_files, denoise_strategy='simple')
Version:
(nilearn.version)
0.10.3
Environment (Docker, Singularity / Apptainer, custom installation):
Data formatted according to a validatable standard? Please provide the output of the validator:
PASTE VALIDATOR OUTPUT HERE
Relevant log outputs (up to 20 lines):
PASTE LOG OUTPUT HERE
Screenshots / relevant information:
When using fMRIPrep for preprocessing data, what are the recommended post-processing steps before constructing functional connectivity for both resting-state and task-based data?
Thank you very much!