External Email - Use Caution
Dear FreeSurfer experts,
given a voxel in the cortex of the fsaverage subject, I would like to find the vertex on the surface that corresponds to the voxel (e.g., if volume data would be projected to the surface).
I found the documentation at http://freesurfer.net/fswiki/CoordinateSystems, which helped me a lot, but it would be great if someone could comment on whether or not what I'm doing is correct:
This seems to be use case 4 on the page (bottom), so I would: 1) get the affine matrix by running: mri_info --vox2ras-tkr $FREESURFER_HOME/subjects/fsaverage/mri/orig.mgz 2) Apply the matrix to my voxel x, y, z to get the coords
At this point I'm not sure how to get the vertex. Should I just compute the distance from the coords to all vertices and pick the one with minimal Euclidian distance?
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
Hi Tim
yes, you can use min Euclidean distance as a metric but it may not be terribly stable, since the center of a voxel might be close to equidistant from two banks of a sulcus. Particularly in cases where there is a thickness asymmetry, like the central sulcus. You might need to do something else, like ensuring the dot product of neighboring voxels with the same aparc label is not negative
cheers Bruce
On Thu, 20 Dec 2018, ts+ml@rcmd.org wrote:
External Email - Use CautionDear FreeSurfer experts,
given a voxel in the cortex of the fsaverage subject, I would like to find the vertex on the surface that corresponds to the voxel (e.g., if volume data would be projected to the surface).
I found the documentation at http://freesurfer.net/fswiki/CoordinateSystems, which helped me a lot, but it would be great if someone could comment on whether or not what I'm doing is correct:
This seems to be use case 4 on the page (bottom), so I would:
- get the affine matrix by running:
mri_info --vox2ras-tkr $FREESURFER_HOME/subjects/fsaverage/mri/orig.mgz 2) Apply the matrix to my voxel x, y, z to get the coords
At this point I'm not sure how to get the vertex. Should I just compute the distance from the coords to all vertices and pick the one with minimal Euclidian distance?
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Dear Bruce,
thanks for the answer, makes sense. I just wanted to ask: does any FreeSurfer tool solve the same problem? Because if so, I guess it would make sense if my code used the same algorithm.
Tim
On December 20, 2018 at 5:54 PM Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
Hi Tim
yes, you can use min Euclidean distance as a metric but it may not be terribly stable, since the center of a voxel might be close to equidistant from two banks of a sulcus. Particularly in cases where there is a thickness asymmetry, like the central sulcus. You might need to do something else, like ensuring the dot product of neighboring voxels with the same aparc label is not negative
cheers Bruce
On Thu, 20 Dec 2018, ts+ml@rcmd.org wrote:
External Email - Use CautionDear FreeSurfer experts,
given a voxel in the cortex of the fsaverage subject, I would like to find the vertex on the surface that corresponds to the voxel (e.g., if volume data would be projected to the surface).
I found the documentation at http://freesurfer.net/fswiki/CoordinateSystems, which helped me a lot, but it would be great if someone could comment on whether or not what I'm doing is correct:
This seems to be use case 4 on the page (bottom), so I would:
- get the affine matrix by running:
mri_info --vox2ras-tkr $FREESURFER_HOME/subjects/fsaverage/mri/orig.mgz 2) Apply the matrix to my voxel x, y, z to get the coords
At this point I'm not sure how to get the vertex. Should I just compute the distance from the coords to all vertices and pick the one with minimal Euclidian distance?
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
yes, we have code that builds a spatial lookup table, and uses it to do a fast lookup of the closest vertex (it is in mrishash.c).
cheers Bruce
On Mon, 24 Dec 2018, ts+ml@rcmd.org wrote:
External Email - Use CautionDear Bruce,
thanks for the answer, makes sense. I just wanted to ask: does any FreeSurfer tool solve the same problem? Because if so, I guess it would make sense if my code used the same algorithm.
Tim
On December 20, 2018 at 5:54 PM Bruce Fischl fischl@nmr.mgh.harvard.edu wrote:
Hi Tim
yes, you can use min Euclidean distance as a metric but it may not be terribly stable, since the center of a voxel might be close to equidistant from two banks of a sulcus. Particularly in cases where there is a thickness asymmetry, like the central sulcus. You might need to do something else, like ensuring the dot product of neighboring voxels with the same aparc label is not negative
cheers Bruce
On Thu, 20 Dec 2018, ts+ml@rcmd.org wrote:
External Email - Use CautionDear FreeSurfer experts,
given a voxel in the cortex of the fsaverage subject, I would like to find the vertex on the surface that corresponds to the voxel (e.g., if volume data would be projected to the surface).
I found the documentation at http://freesurfer.net/fswiki/CoordinateSystems, which helped me a lot, but it would be great if someone could comment on whether or not what I'm doing is correct:
This seems to be use case 4 on the page (bottom), so I would:
- get the affine matrix by running:
mri_info --vox2ras-tkr $FREESURFER_HOME/subjects/fsaverage/mri/orig.mgz 2) Apply the matrix to my voxel x, y, z to get the coords
At this point I'm not sure how to get the vertex. Should I just compute the distance from the coords to all vertices and pick the one with minimal Euclidian distance?
Tim
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
-- Dr. Tim Schäfer Postdoc Computational Neuroimaging Department of Child and Adolescent Psychiatry, Psychosomatics and Psychotherapy University Hospital Frankfurt, Goethe University Frankfurt am Main, Germany
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu