Use this skill whenever the user wants to perform fMRI preprocessing, first-level analysis, ROI extraction, functional connectivity, effective connectivity, or atlas-based alignment to MNI152 space using either fMRIPrep, HCP-style pipelines, or CONN Toolbox. Triggers include: 'fmri', 'fMRI analysis', 'functional connectivity', 'effective connectivity', 'ROI extraction', 'seed-based correlation', 'PPI', 'DCM', 'atlas alignment', 'MNI152', 'HCP pipeline', 'CONN toolbox', or any request involving BOLD data.
fmri-skill is the NeuroClaw modality-layer interface skill responsible for all fMRI data processing and analysis tasks.
It strictly follows the NeuroClaw hierarchical design principles:
fmriprep-tool, hcppipeline-tool, conn-tool, fsl-tool, bids-organizer, and claw-shell.Core workflow (never bypassed):
claw-shellfmri_output/).Research use only.
| Task | What needs to be done | Delegate to which tool skill | Expected output |
|---|---|---|---|
| BIDS organization | Convert raw DICOM/NIfTI into valid BIDS structure (dataset_description.json + proper naming) | bids-organizer | BIDS-compliant dataset with metadata |
| Standardized preprocessing (fMRIPrep) | Motion correction, slice timing, distortion correction, coregistration to T1w, FreeSurfer integration | fmriprep-tool | Preprocessed BOLD in native/T1w space + anatomical derivatives |
| Post-processing denoising (XCP-D) | Spatial smoothing, band-pass filtering (0.01–0.08 Hz), nuisance regression (36P model), scrubbing (FD > 0.2mm) | fmriprep-tool (XCP-D integration) | Clean 4D BOLD + ROI timeseries (.tsv) + functional connectivity matrices |
| High-quality HCP-style preprocessing | Structural + functional (ICA-FIX) + diffusion + MSMAll surface alignment | hcppipeline-tool | HCP-style preprocessed data |
| Atlas alignment to T1w / MNI152 | Register functional/anatomical data to T1w native or MNI152 template | fmriprep-tool or hcppipeline-tool | Data in T1w or MNI152 space |
| ROI time-series extraction | Extract mean/spatial ROI time-series from atlas-defined ROIs (e.g., Schaefer, Glasser, Gordon, Tian) | fmriprep-tool (XCP-D) or nilearn-tool | ROI timeseries (TSV / CSV / .npy) |
| Functional connectivity (clean) | Compute Pearson correlation matrices from denoised ROI time-series (after XCP-D) | Post-XCP-D analysis or conn-tool | Whole-brain connectivity matrices, networks |
| Effective connectivity | Psychophysiological Interaction (PPI/gPPI), Granger causality, Dynamic Causal Modeling (DCM) | fsl-tool or conn-tool | PPI maps, causality matrices, DCM parameters |
| First-level GLM (task-based) | Task regressors + contrast estimation | fsl-tool (FEAT) | Z-stat maps, cope files |
| Group-level analysis | Second-level statistics across subjects | fsl-tool (randomise / FEAT) | Group statistical maps |
| Full ADNI-style rsfMRI pipeline | BIDS → fMRIPrep → XCP-D → connectivity analysis (resting state optimized) | bids-organizer + fmriprep-tool + fmriprep-tool (XCP-D) | Clean BOLD + timeseries + connectivity matrices + QC |
| Advanced connectivity (CONN) | ROI-to-ROI, seed-to-voxel, ICA networks, PPI/gPPI, DCM | conn-tool | Comprehensive connectivity results |
No manual installation required at this layer.
When first used, fmri-skill automatically calls dependency-planner to ensure fmriprep-tool, hcppipeline-tool, conn-tool, fsl-tool, and bids-organizer are ready.
For resting-state fMRI datasets (like ADNI), the most validated workflow combines fMRIPrep (preprocessing) + XCP-D (denoising/post-processing):
bids-organizer)Input: Raw NIfTI files from DICOM conversion (e.g., nifti/130_S_0969/T1/ and nifti/130_S_0969/fMRI/)
Tasks:
dataset_description.json at BIDS root:
{
"Name": "ADNI rsfMRI T1 subset",
"BIDSVersion": "1.8.0",
"DatasetType": "raw"
}
bids/sub-130S0969/ses-M00/anat/
bids/sub-130S0969/ses-M00/func/
sub-130S0969_ses-M00_T1w.nii.gz + sub-130S0969_ses-M00_T1w.jsonsub-130S0969_ses-M00_task-rest_bold.nii.gz + sub-130S0969_ses-M00_task-rest_bold.jsonOutput: Valid BIDS-structured bids/ directory
fmriprep-tool)Input: BIDS directory from Stage 1
Key Operations:
Command structure (Docker):
docker run --rm -it \
-v <BIDS_PATH>:/data:ro \
-v <OUTPUT_PATH>:/out \
-v <WORK_PATH>:/work \
-v <FREESURFER_LICENSE_PATH>:/fs \
nipreps/fmriprep:23.2.1 \
/data /out participant \
--participant-label <SUBID> \
--fs-license-file /fs/license.txt \
--output-spaces T1w \
--work-dir /work \
--clean-workdir
Output:
derivatives/fmriprep/sub-*/func/*_space-T1w_desc-preproc_bold.nii.gzderivatives/fmriprep/sub-*/func/*_desc-confounds_timeseries.tsv (includes motion, signal, etc.)derivatives/fmriprep/sub-*/anat/ (T1w in MNI, brain masks, tissue probability maps)Input: fMRIPrep derivatives (derivatives/fmriprep/)
Key Denoising Operations:
Command structure (Docker):
docker run -ti --rm \
-v <FMRIPREP_DERIVATIVES>:/fmriprep:ro \
-v <XCPD_OUTPUT>:/out \
-v <FREESURFER_LICENSE>:/opt/freesurfer/license.txt:ro \
pennlinc/xcp_d:latest \
/fmriprep /out participant \
--participant-label <SUBID> \
--nuisance-regressors 36P \
--despike \
--lower-bpf 0.01 --upper-bpf 0.08 \
--smoothing 6 \
--fd-thresh 0.2 \
--nthreads 8 \
--mem_gb 32
Core Parameter Guide:
| Parameter | Value | Explanation |
|---|---|---|
--nuisance-regressors | 36P | 36-parameter motion + signal regression model (most effective for motion artifact suppression) |
--despike | (flag) | Suppress time-series spikes before filtering/regression |
--lower-bpf / --upper-bpf | 0.01 / 0.08 | Resting-state frequency band (classic choice) |
--smoothing | 6 | 6 mm FWHM Gaussian smoothing (standard for group analysis) |
--fd-thresh | 0.2 | Framewise displacement threshold (0.2 mm = moderate scrubbing) |
--nthreads | 8 | Number of CPU threads |
--mem_gb | 32 | Memory allocation (adjust to your system) |
Output:
derivatives/xcpd/sub-*/func/*_desc-denoised_bold.nii.gz*_desc-schaefer*, *_desc-glasser*, *_desc-gordon*, *_desc-tian*_timeseries.tsv*_timeseries.tsv (Pearson correlations pre-computed)No wrapper script is needed at the modality layer.
All execution is routed through bids-organizer, fmriprep-tool, hcppipeline-tool, conn-tool, fsl-tool, and claw-shell.
.nii.gz).tsv)Resting-state (ADNI model):
Task-based fMRI:
RepetitionTime, FlipAngle, EchoTime (for proper preprocessing)After completing the full pipeline (BIDS → fMRIPrep → XCP-D), outputs are organized as:
fmri_output/
├── bids/ # Original BIDS dataset
│ ├── dataset_description.json
│ └── sub-*/ses-*/func/ # Raw BOLD + JSON metadata
├── fmriprep/ # fMRIPrep derivatives
│ ├── dataset_description.json
│ └── sub-*/
│ ├── anat/
│ │ ├── *_T1w.nii.gz # T1w in native space
│ │ ├── *_T1w_brain_mask.nii.gz # Brain mask
│ │ ├── *_space-MNI_T1w.nii.gz # T1w in MNI152 (if --output-spaces MNI152NLin2009cAsym)
│ │ └── *_label-*.nii.gz # Tissue probability maps (GM/WM/CSF)
│ ├── func/
│ │ ├── *_space-T1w_desc-preproc_bold.nii.gz # Preprocessed BOLD (in native T1w space)
│ │ ├── *_desc-confounds_timeseries.tsv # Motion + signal confounds
│ │ └── *_desc-confounds_regressors.json # Confound descriptions
│ └── freesurfer/ # FreeSurfer outputs (symlink or copy)
├── xcpd/ # XCP-D post-processing derivatives
│ ├── dataset_description.json
│ └── sub-*/
│ ├── anat/
│ │ └── *_space-T1w_desc-brain_mask.nii.gz
│ └── func/
│ ├── *_desc-denoised_bold.nii.gz # Clean 4D BOLD (denoised, smoothed, filtered)
│ ├── *_desc-schaefer100_timeseries.tsv # Schaefer 100-region timeseries
│ ├── *_desc-schaefer200_timeseries.tsv # Schaefer 200-region timeseries
│ ├── *_desc-schaefer400_timeseries.tsv # Schaefer 400-region timeseries
│ ├── *_desc-glasser360_timeseries.tsv # Glasser 360 multimodal parcellation
│ ├── *_desc-gordon333_timeseries.tsv # Gordon 333 network atlas
│ ├── *_desc-tian96_timeseries.tsv # Tian 96 subcortical atlas
│ ├── *_desc-schaefer100_correlations.tsv # Pre-computed Pearson correlations (Schaefer 100)
│ ├── *_desc-glasser360_correlations.tsv # Pre-computed Pearson correlations (Glasser 360)
│ └── *_desc-qc_metrics.json # Quality control: FD ranges, valid frames, etc.
├── roi/ # ROI time-series extractions (optional, for custom analysis)
│ └── *.csv # Custom ROI CSV tables (if further analysis required)
├── connectivity/ # Connectivity analysis (if post-hoc analysis was run)
│ ├── *_connectivity_matrix.npy # Numpy arrays of connectivity matrices
│ └── *.tsv # Pairwise connectivity stats
├── stats/ # Group-level statistics (if group analysis was run)
│ └── *.nii.gz # Group-level Z-stat maps, T-stat maps
└── logs/ # Processing logs
├── fmriprep_*.log
├── xcpd_*.log
└── qc_report_*.html # QC reports from fMRIPrep / XCP-D
Key files for downstream analysis:
xcpd/sub-*/func/*_desc-denoised_bold.nii.gzxcpd/sub-*/func/*_timeseries.tsv (pick your atlas)fmriprep/sub-*/func/*_confounds_timeseries.tsvfmriprep/sub-*/anat/*_T1w.nii.gzbids-organizer when raw resting-state or task-based fMRI data needs preprocessing.conn-tool or fsl-tool.research-idea or method-design when the experiment involves fMRI data (resting-state networks, task activation, or dual-regression).bids-organizer → organize raw DICOM/NIfTI data into BIDS structuredcm2nii → convert raw DICOM to NIfTI (if not already done)smri-skill → prepare T1w structural images (FreeSurfer preprocessing)fmriprep-tool → standardized preprocessing (motion correction, distortion correction, FreeSurfer integration, coregistration to T1w)fmriprep-tool (XCP-D integration) → post-processing denoising, scrubbing, connectivity extraction (recommended for resting-state)hcppipeline-tool → high-quality HCP-style preprocessing (ICA-FIX, MSMAll, advanced diffusion pipeline)conn-tool → advanced functional & effective connectivity analysis (ROI-to-ROI, seed-to-voxel, network ICA, PPI/gPPI, DCM)fsl-tool → ROI extraction, basic connectivity, PPI design, FEAT GLM (task-based analysis)nilearn-tool → custom ROI extraction and post-hoc connectivity analysis from NIfTI filesdependency-planner → environment & dependency managementAligned with NeuroClaw modality-skill pattern (see smri-skill, eeg-skill, dwi-skill).
Validated pipeline: ADNI resting-state fMRI processing workflow (fMRIPrep 23.x + XCP-D).
Core tools used:
fmriprep-tool (v23.2.1+): Motion correction, coregistration, FreeSurfer wrapperxcp-d (integrated or separate): Spatial smoothing, band-pass filtering (0.01–0.08 Hz), nuisance regression (36P), scrubbinghcppipeline-tool: HCP-grade structural + functional processing (alternative)conn-tool: Advanced connectivity & effective connectivity (complementary)fsl-tool: ROI extraction, GLM, basic connectivity (complementary)nilearn: Custom ROI extraction and downstream analysis (complementary)Key references:
Created At: 2026-03-25 16:02 HKT
Last Updated At: 2026-03-28 17:53 HKT
Author: chengwang9638:["$","$L3f",null,{"content":"$40","frontMatter":{"name":"fmri-skill","description":"Use this skill whenever the user wants to perform fMRI preprocessing, first-level analysis, ROI extraction, functional connectivity, effective connectivity, or atlas-based alignment to MNI152 space using either fMRIPrep, HCP-style pipelines, or CONN Toolbox. Triggers include: 'fmri', 'fMRI analysis', 'functional connectivity', 'effective connectivity', 'ROI extraction', 'seed-based correlation', 'PPI', 'DCM', 'atlas alignment', 'MNI152', 'HCP pipeline', 'CONN toolbox', or any request involving BOLD data.","license":"MIT License (NeuroClaw custom skill – freely modifiable within the project)"}}]