Nilearn: newbie question about how to normalize a proton-density image to template

Nilearn: newbie question: how to normalize a proton-density image to the Talairach atlas (or to the MNI template) ? If Nilearn is not appropriate, please suggest another tool. Thank you much for your feedback.

Hi @alexis.amadon,

Many tools can do this (I personally prefer ANTs, which also has a python package). You can find the MNI PD image via templateflow, and then calculate the registration between the two.

import ants
import numpy

fi_path = '/PATH/TO/TEMPLATE/PD.nii.gz'
fi = ants.image_read(fi_path)

mo = '/PATH/TO/SUBJECT/PD.nii.gz'
mo = ants.image_read(mo_path)

xfm = ants.registration(fixed=fi, moving=mo, outprefix='/PATH/TO/OUTDIR/')

registered_PD = ants.apply_transforms(fi, mo, transformlist=xfm['fwdtransforms'], interpolator='lanczosWindowedSinc', imagetype=2)

ants.image_write(moved, '/PATH/TO/OUTDIR/PD_REGISTERED.nii.gz')

Best,
Steven

1 Like

Thank you for your advice.

Anojan