Convert voxel coordinates to MNI coordinates

Is there any way to convert voxel coordinates into MNI coordinates. I tried using FSL for that but I realized the MNI brain in FSL had a different dimension from my MNI image.

Is there a way to do the conversion based on the dimension of my image ?

Hi @Reubebe,

I am not sure I understand the problem if your brain is already in MNI space. A coordinate at any given voxel would be at (x*i, y*j, z*k) where:
x, y, and z are the voxel indices in the x, y, and z direction
i, j, and k are the voxel sizes in the x, y, and z directions

So for a 2mm isotropic voxel image, an image with voxel index (-10, 15, -1), assuming the image is centered around the origin, would be at (-20, 30, -1)mm.


So I used the cluster function in fsl to identify the peak voxel and the output file showed the peak voxel index to be 182 124 142. So I want to identify the mni coordinates for these indices.

You can also use nilearn to do the conversion for you: nilearn.image.coord_transform - Nilearn

They provide this example:

from nilearn import datasets, image
niimg = datasets.load_mni152_template()
# Find the MNI coordinates of the voxel (50, 50, 50)
image.coord_transform(50, 50, 50, niimg.affine)

So you can perform the same conversion using your image and its affine. In general I think this well written tutorial in the nibabel documentation may be of interest for you: Neuroimaging in Python — NiBabel 5.1.0 documentation

1 Like