Quickstart¶
A five-minute lesson: install, normalize one T1-w image, check the result.
Install¶
Get a brain mask¶
Most methods expect a brain mask — a rough one is fine, it only needs to remove most non-brain tissue. ROBEX, HD-BET, and SynthStrip all work. If the image is already skull-stripped, skip the mask: the foreground is estimated as the positive voxels.
Normalize one image¶
FCM normalization is a good default for T1-w brain images: it scales the white-matter mean to 1.
The output has the same type as the input: numpy in → numpy out, nibabel in → nibabel out, affine and header preserved.
Check the result¶
Plot the foreground histogram before and after — the fastest way to catch a bad mask. Install the plotting extra and
rerun with -p:
pip install "intensity-normalization[plot]" # or: uv add ...
intensity-normalize fcm t1w.nii.gz -m brain_mask.nii.gz -p
After FCM normalization of T1-w images, the white-matter peaks should sit at the norm value (1 by default).
Where next¶
- Normalize a dataset, validate a batch, save a fitted transform: How-to guides
- Pick a method for your data: Choosing a method
- The math behind each method: How the methods work