image-20250312160055023

fMRIPrep

DependencyPurpose
FSL (FLIRT, FNIRT, MCFLIRT, SUSAN, FAST)Motion correction, skull stripping, bias field correction, nonlinear warping
ANTs (Advanced Normalization Tools)Spatial normalization (T1→MNI), bias field correction
FreeSurferCortical surface reconstruction (optional, but recommended)
AFNI (3dTshift, 3dSkullStrip)Slice-timing correction, alternative skull stripping
Workflows from Nilearn & NipypePipeline orchestration and image processing
NumPy, SciPy, NiBabel, pandasData processing
Matplotlib, seabornQuality control (QC) reporting
TemplateFlowStandardized brain templates

FSL::feat


fMRIPrep Outputs Needed for Nilearn

fMRIPrep OutputUsed for
sub-*_task-*_bold_space-MNI152NLin2009cAsym_preproc.nii.gzPreprocessed functional images
sub-*_desc-brain_mask.nii.gzBrain mask for extracting signal
sub-*_desc-confounds_timeseries.tsvMotion parameters, CompCor regressors
sub-*_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii.gzSmoothed images (if needed)
sub-*_from-T1w_to-MNI152_desc-linear_xfm.h5Transformation matrices (for custom ROI masking)

Nilearn Equivalent of FEAT Steps

FEAT StepNilearn Alternative
Motion CorrectionAlready handled by fMRIPrep
Spatial NormalizationAlready handled by fMRIPrep
Confound Regressionnilearn.image.clean_img()
GLM First-Levelnilearn.glm.first_level.FirstLevelModel()
Statistical Maps (t-stats, z-stats).compute_contrast() in FirstLevelModel
ROI Extractionnilearn.input_data.NiftiMasker
MVPA/Decodingnilearn.decoding.SearchLight

Per Person


Group Level

FSL::feat Group-Level

  1. Collect First-Level Outputs: Gather cope.nii.gz and varcope.nii.gz files from each subject.

  2. Prepare a Group Design Matrix: Create a design.mat and design.con for higher-level analysis.

  3. Run Higher-Level FEAT: Perform mixed-effects analysis to model group differences.

  4. Apply Statistical Thresholding: Use FSL's thresholding options (cluster-based correction, TFCE, etc.).

  5. Interpret Results: Review thresh_zstat.nii.gz for significant group-level activations.

Nilearn Group-Level

  1. Load Individual Subject Maps: Use nilearn.image.load_img() to import first-level statistical maps.

  2. Apply Standardization: Use nilearn.image.mean_img() or nilearn.image.math_img() for normalization.

  3. Perform Group-Level GLM: Use nilearn.glm.second_level.SecondLevelModel() for a random-effects model.

  4. Define Contrasts: Specify conditions or groups for comparison.

  5. Run Statistical Analysis: Compute group contrasts and extract statistical maps.

  6. Multiple Comparison Correction: Use nilearn.stats.threshold_stats_img() for FDR correction.

  7. Visualize Results: Use nilearn.plotting.plot_stat_map() to render group-level activation.