Lab meeting
2026-04-01
... fMRI ...
... sEEG !?
Similar design ...
... behavior ...
😞
(1 participant)
Preprocessing!
Simple contrasts!
Learning a lot of methods!
Note to self:
Show sample results
Standardization is great.
(Decisions are hard. Let other people make them!)
*
Aligned spins add up a lot
Random spins tend to cancel out
🌊
🌊
🌊
🌊
🌊
H
H
O
When you put the brain in a magnetic field, these spins tend to align with it.
And so the total spin increases.
("net polarization")
this is the main magnet in the MRI machine (+"gradient coils")
If you shine just the right color of light on the brain for a tiny bit*,
you can flip these spins!
*this is a "radio frequency (RF) pulse" created by the "RF coil"
If you wait, this net spin will gradually disappear.
This "relaxation" time* varies across the brain, depending on what tissues are nearby.
And as this happens, the brain emits some light!
*e.g. T1, T2
If you collect this light, using fancy mathemagics, you can plot relaxation time across the brain!
high spatial resolution: ~1 mm
this is measured using the receiver head coil
The presence of nearby oxygenated blood also changes the relaxation times of protons.
So we can measure a "blood oxygen level dependent" signal too.
worse spatial resolution (>2 mm), but temporal resolution of ~1 s 🤷
"echo-planar imaging (EPI)"
🩸
🩸
vs
[x, y, z]
[x, y, z, t]
Note to self:
Show example output.
Deface your data.
(I use mri_deface from the container's FreeSurfer)
Do preliminary QC.
(LPT: giving up early saves time!)
Build the container with all the dependencies. (or use the shared one on Mind)
apptainer build /path/to/fmriprep-container.simg docker://nipreps/fmriprep:{version}Get a FreeSurfer license.
--fs-license-file
/freesurfer/license.txtSpecify the output spaces you want.
any template from TemplateFlow
(default MNI152NLin2009cAsym)
[they have kid templates too]
or non-standard spaces
Run the fMRIPrep command
likely no need to adjust other defaults
(Optionally) Add a lesion mask, e.g. for hemispherectomy
Wait for a long time.
(several hours, ~3 h?, mostly FreeSurfer's surface registration)
If you're lucky, everything ran without errors.
Inspect the quality assessment report.
(sub-XX.html)
fMRIPrep only does preprocessing, not any data analysis.
(e.g. GLMs, contrasts, thresholding, MVPA, etc.)
But it gives you useful confound regressors.
(e.g. motion, noise components from WM/CSF/outside the brain)
Use whatever tools/code/languages you like to analyze the (standardized) outputs of fMRIPrep!
sub-{subject}_task-{task}_run-{run}_space-{space}_desc-preproc_bold.nii.gz
It's a lot of work upfront to organize the data well enough for fMRIPrep to run.
But it's worth it for the peace of mind and ease of releasing data afterward.
And honestly, it's easier than running individual steps manually and stressing about setting hyperparameters.
Highly recommended:
(Credit: Maria!)