External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
There's a lot of stuff going on there, so it's hard to say withhout more detail. But it sounds like you might not be taking into account that the voxel coords in matlab are 1-based.
On 6/26/2020 12:04 PM, Franziska Klein wrote:
External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
I know, a lot of steps.
1-based vs. 0-based, that is basically what I mean and what I think is the problem, but I need to be sure. When I load in the *.nii file generated from the mesh and display it in SPM, then the origin shown in the SPM Gui is the last column in vox2ras1. Oversimplified, when I want to compare a voxel from SPM with a voxel from freesurfer, I need to shift the coordinates of that voxel from freesurfer by +1, right? (or substract one from the SPM one).
Kind regards,
Franziska
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 16:44:34 An: freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
There's a lot of stuff going on there, so it's hard to say withhout more detail. But it sounds like you might not be taking into account that the voxel coords in matlab are 1-based.
On 6/26/2020 12:04 PM, Franziska Klein wrote:
External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
How did you generate the nii file from the mesh?
On 6/29/2020 12:21 PM, Franziska Klein wrote:
External Email - Use Caution
I know, a lot of steps.
1-based vs. 0-based, that is basically what I mean and what I think is the problem, but I need to be sure. When I load in the *.nii file generated from the mesh and display it in SPM, then the origin shown in the SPM Gui is the last column in vox2ras1. Oversimplified, when I want to compare a voxel from SPM with a voxel from freesurfer, I need to shift the coordinates of that voxel from freesurfer by +1, right? (or substract one from the SPM one).
Kind regards,
Franziska
*Von:* freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDU *Gesendet:* Montag, 29. Juni 2020 16:44:34 *An:* freesurfer@nmr.mgh.harvard.edu *Betreff:* Re: [Freesurfer] Question regarding MRIread There's a lot of stuff going on there, so it's hard to say withhout more detail. But it sounds like you might not be taking into account that the voxel coords in matlab are 1-based.
On 6/26/2020 12:04 PM, Franziska Klein wrote:
External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
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
External Email - Use Caution
I've used the MRIwrite function.
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 18:55:01 An: freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
How did you generate the nii file from the mesh?
On 6/29/2020 12:21 PM, Franziska Klein wrote:
External Email - Use Caution
I know, a lot of steps.
1-based vs. 0-based, that is basically what I mean and what I think is the problem, but I need to be sure. When I load in the *.nii file generated from the mesh and display it in SPM, then the origin shown in the SPM Gui is the last column in vox2ras1. Oversimplified, when I want to compare a voxel from SPM with a voxel from freesurfer, I need to shift the coordinates of that voxel from freesurfer by +1, right? (or substract one from the SPM one).
Kind regards,
Franziska
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDUmailto:dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 16:44:34 An: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
There's a lot of stuff going on there, so it's hard to say withhout more detail. But it sounds like you might not be taking into account that the voxel coords in matlab are 1-based.
On 6/26/2020 12:04 PM, Franziska Klein wrote:
External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Sorry. I am not using the mesh for this, but the volume.
________________________________ Von: Franziska Klein Gesendet: Montag, 29. Juni 2020 19:15:01 An: freesurfer@nmr.mgh.harvard.edu Betreff: AW: [Freesurfer] Question regarding MRIread
I've used the MRIwrite function.
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 18:55:01 An: freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
How did you generate the nii file from the mesh?
On 6/29/2020 12:21 PM, Franziska Klein wrote:
External Email - Use Caution
I know, a lot of steps.
1-based vs. 0-based, that is basically what I mean and what I think is the problem, but I need to be sure. When I load in the *.nii file generated from the mesh and display it in SPM, then the origin shown in the SPM Gui is the last column in vox2ras1. Oversimplified, when I want to compare a voxel from SPM with a voxel from freesurfer, I need to shift the coordinates of that voxel from freesurfer by +1, right? (or substract one from the SPM one).
Kind regards,
Franziska
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDUmailto:dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 16:44:34 An: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
There's a lot of stuff going on there, so it's hard to say withhout more detail. But it sounds like you might not be taking into account that the voxel coords in matlab are 1-based.
On 6/26/2020 12:04 PM, Franziska Klein wrote:
External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
what volume? how did you create it? please give some details
On 6/29/2020 1:19 PM, Franziska Klein wrote:
External Email - Use Caution
Sorry. I am not using the mesh for this, but the volume.
*Von:* Franziska Klein *Gesendet:* Montag, 29. Juni 2020 19:15:01 *An:* freesurfer@nmr.mgh.harvard.edu *Betreff:* AW: [Freesurfer] Question regarding MRIread
I've used the MRIwrite function.
*Von:* freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDU *Gesendet:* Montag, 29. Juni 2020 18:55:01 *An:* freesurfer@nmr.mgh.harvard.edu *Betreff:* Re: [Freesurfer] Question regarding MRIread How did you generate the nii file from the mesh?
On 6/29/2020 12:21 PM, Franziska Klein wrote:
External Email - Use Caution
I know, a lot of steps.
1-based vs. 0-based, that is basically what I mean and what I think is the problem, but I need to be sure. When I load in the *.nii file generated from the mesh and display it in SPM, then the origin shown in the SPM Gui is the last column in vox2ras1. Oversimplified, when I want to compare a voxel from SPM with a voxel from freesurfer, I need to shift the coordinates of that voxel from freesurfer by +1, right? (or substract one from the SPM one).
Kind regards,
Franziska
*Von:* freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDU *Gesendet:* Montag, 29. Juni 2020 16:44:34 *An:* freesurfer@nmr.mgh.harvard.edu *Betreff:* Re: [Freesurfer] Question regarding MRIread There's a lot of stuff going on there, so it's hard to say withhout more detail. But it sounds like you might not be taking into account that the voxel coords in matlab are 1-based.
On 6/26/2020 12:04 PM, Franziska Klein wrote:
External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
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
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
External Email - Use Caution
Okay. I'll try.
The basic steps are, loading in a slightly adapted and I guess repaired version of the T1.mgz file called hseg.mgz (this is created by the AtlasViewer toolbox because I need to set the fiducials and some other reference points and this toolbox also calculates all other 10-20 points based on those reference points) and the ribbon.mgz file
head = load_mgh(fullfile(DIR, 'mri/hseg.mgz')); brain = load_mgh(fullfile(DIR, 'mri/ribbon.mgz'));
for both I am creating a mesh with isosurface function
mesh_head = isosurface(head, .9); mesh_brain = isosurface(brain, .9);
v = mesh_head .vertices(:, [2 1 3]); % isosurface flips x- and y-axes f = mesh_head .faces;
Then I am doing the coregistration based on the meshes, resulting in some mesh voxel coordinates.
In order to get a *.nii.gz file I simply use
MRIwrite(head, filename)
I checked already: hseg.vol and T1.vol (when loading T1.mgz instead of hseg.mgz) are identical.
I want to use the new .nii file to generate a deformations field in SPM12 in order to normalize my mesh voxel coordinates to the normalized T1 generated in SPM12 for some specific analyses. Therefore the mesh coordinates (freesurfer 0-based) should be identical with those in the .nii file (SPM Matlab 1-based).
I hope this is detailed enough.
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 20:08:04 An: freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
what volume? how did you create it? please give some details
On 6/29/2020 1:19 PM, Franziska Klein wrote:
External Email - Use Caution
Sorry. I am not using the mesh for this, but the volume.
________________________________ Von: Franziska Klein Gesendet: Montag, 29. Juni 2020 19:15:01 An: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu Betreff: AW: [Freesurfer] Question regarding MRIread
I've used the MRIwrite function.
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDUmailto:dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 18:55:01 An: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
How did you generate the nii file from the mesh?
On 6/29/2020 12:21 PM, Franziska Klein wrote:
External Email - Use Caution
I know, a lot of steps.
1-based vs. 0-based, that is basically what I mean and what I think is the problem, but I need to be sure. When I load in the *.nii file generated from the mesh and display it in SPM, then the origin shown in the SPM Gui is the last column in vox2ras1. Oversimplified, when I want to compare a voxel from SPM with a voxel from freesurfer, I need to shift the coordinates of that voxel from freesurfer by +1, right? (or substract one from the SPM one).
Kind regards,
Franziska
________________________________ Von: freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edumailto:freesurfer-bounces@nmr.mgh.harvard.edu im Auftrag von Douglas N. Greve dgreve@MGH.HARVARD.EDUmailto:dgreve@MGH.HARVARD.EDU Gesendet: Montag, 29. Juni 2020 16:44:34 An: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu Betreff: Re: [Freesurfer] Question regarding MRIread
There's a lot of stuff going on there, so it's hard to say withhout more detail. But it sounds like you might not be taking into account that the voxel coords in matlab are 1-based.
On 6/26/2020 12:04 PM, Franziska Klein wrote:
External Email - Use Caution
Hello,
I am using the isosurface() function in order to create a mesh based on the T1.mgz and on the ribbon.mgz. I need those meshes for the coregistration of some channels.
After coregistration I do project the channels onto the cortex and extract the corresponding voxel coordinates. Until here, everything works fine.
Next, I am using MRIwrite in order to save the T1.mgz as *.nii.mgz which I am using to generate a deformation field with SPM12 to transform the voxel coordinates to normalized MNI coordinates. However, when I put the voxel coordinates (not normalized yet) into SPM12 while displaying my generated *.nii image it happens that the coordinates on the right hemisphere (MNI space) are slightly outside of the cortex which is of course not the case on my cortex mesh after projection.
Now I am wondering whether there is a mismatch between the mesh and the *.nii image (one voxel maybe)? And whether that is introduced by MRIwrite? If so, do I have to shift all points of the meshes by +1 in order to get correct results the way I want to? If not, any ideas on where that mismatch could come from?
Thank you and kind regards,
Franziska
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
_______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edumailto:Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu