External Email - Use Caution
Hello,
I was wondering what the best way would be to extract the coordinates of each voxel in my nifti volume in mm. I have used MRIread to load the nifti volume into Matlab (=mri) and wanted to essentially create a new variable that takes each (voxel) entry in mri.vol and exports its three coordinates in mm. Would I just need to multiply the mri.vox2ras 4x4 matrix to each voxel’s [X Y Z 1]’ (where X,Y,Z are the voxel’s coordinates in mri.vol) or are there different steps involved?
Thank you in advance for your time and help!
Best, Panos
Hi Panos,
Yes that is correct. Taking a voxel value and multiplying it by the vox2ras matrix will give you a coordinate in the "patient coordinate system" which is in mm. RAS denotes that the directions (R)ight, (A)nterior and (S)uperior are positive.
-Paul ________________________________ From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Fotiadis, Panagiotis Panagiotis.Fotiadis@pennmedicine.upenn.edu Sent: Wednesday, September 21, 2022 5:07 PM To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Voxel to mm coordinates
External Email - Use Caution
Hello,
I was wondering what the best way would be to extract the coordinates of each voxel in my nifti volume in mm. I have used MRIread to load the nifti volume into Matlab (=mri) and wanted to essentially create a new variable that takes each (voxel) entry in mri.vol and exports its three coordinates in mm. Would I just need to multiply the mri.vox2ras 4x4 matrix to each voxel’s [X Y Z 1]’ (where X,Y,Z are the voxel’s coordinates in mri.vol) or are there different steps involved?
Thank you in advance for your time and help!
Best,
Panos
External Email - Use Caution
Awesome, thank you Paul!
Best, Panos
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Wighton, Paul PWIGHTON@mgh.harvard.edu Date: Wednesday, September 21, 2022 at 5:24 PM To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: [External] Re: [Freesurfer] Voxel to mm coordinates Hi Panos,
Yes that is correct. Taking a voxel value and multiplying it by the vox2ras matrix will give you a coordinate in the "patient coordinate system" which is in mm. RAS denotes that the directions (R)ight, (A)nterior and (S)uperior are positive.
-Paul ________________________________ From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Fotiadis, Panagiotis Panagiotis.Fotiadis@pennmedicine.upenn.edu Sent: Wednesday, September 21, 2022 5:07 PM To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Voxel to mm coordinates
External Email - Use Caution
Hello,
I was wondering what the best way would be to extract the coordinates of each voxel in my nifti volume in mm. I have used MRIread to load the nifti volume into Matlab (=mri) and wanted to essentially create a new variable that takes each (voxel) entry in mri.vol and exports its three coordinates in mm. Would I just need to multiply the mri.vox2ras 4x4 matrix to each voxel’s [X Y Z 1]’ (where X,Y,Z are the voxel’s coordinates in mri.vol) or are there different steps involved?
Thank you in advance for your time and help!
Best,
Panos
freesurfer@nmr.mgh.harvard.edu