Hi, I'm working on a fractal dimension analysis of the pial- and white-matter surface. The matlab script that calculates the fractal dimension needs binary nifti-files as input. Since FreeSurfer creates the surfaces I need, here's what I want to do: I'd like to convert the pial and white-matter surfaces (separately) to .nii-volumes (e.g. 256x256) where the voxels intersected by the respective surfaces are white, and everything else is black. Furthermore, I'd like to do this for individual subregions of each surface; for example only the precentral gyrus or the whole frontal lobe, so that only the voxels intersected by the surface belonging to the specific label I choose appear white, and everything else is black. How do I get this output from FreeSurfer?
Thanks, Martin Ystad PhD-candidate, University of Bergen, Norway
Use mri_surf2vol to create volumes. You can binarize aparc+aseg.mgz to give a mask of an area (use --match), then take the intersection of the mask with the surface-in-volume.
doug
Martin Ystad wrote:
Hi, I'm working on a fractal dimension analysis of the pial- and white-matter surface. The matlab script that calculates the fractal dimension needs binary nifti-files as input. Since FreeSurfer creates the surfaces I need, here's what I want to do: I'd like to convert the pial and white-matter surfaces (separately) to .nii-volumes (e.g. 256x256) where the voxels intersected by the respective surfaces are white, and everything else is black. Furthermore, I'd like to do this for individual subregions of each surface; for example only the precentral gyrus or the whole frontal lobe, so that only the voxels intersected by the surface belonging to the specific label I choose appear white, and everything else is black. How do I get this output from FreeSurfer?
Thanks, Martin Ystad PhD-candidate, University of Bergen, Norway _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
I tried this, but something is going wrong. Here's what I did: 1. I ran $ mri_binarize --i subjid/mri/aparc+asec.mgz --match xx --match yy --o lobe.mgz - this produces a nice binary mask of, say, the left frontal lobe. 2. Then I ran $ mri_surf2vol --mkmask --surf pial --hemi lh --template lobe.mgz --identity subjid --o lobe_surface.mgz - this produces a nice binary image of the pial surface, but it contains the whole surface, not only the intersection with lobe.mgz. What am I doing wrong?
Thanks, Martin
Douglas N Greve wrote:
Use mri_surf2vol to create volumes. You can binarize aparc+aseg.mgz to give a mask of an area (use --match), then take the intersection of the mask with the surface-in-volume.
doug
Martin Ystad wrote:
Hi, I'm working on a fractal dimension analysis of the pial- and white-matter surface. The matlab script that calculates the fractal dimension needs binary nifti-files as input. Since FreeSurfer creates the surfaces I need, here's what I want to do: I'd like to convert the pial and white-matter surfaces (separately) to .nii-volumes (e.g. 256x256) where the voxels intersected by the respective surfaces are white, and everything else is black. Furthermore, I'd like to do this for individual subregions of each surface; for example only the precentral gyrus or the whole frontal lobe, so that only the voxels intersected by the surface belonging to the specific label I choose appear white, and everything else is black. How do I get this output from FreeSurfer?
Thanks, Martin Ystad PhD-candidate, University of Bergen, Norway _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The 2nd step only creates a mask of the entire surface. You need a step 3 in which you multiply them together:
3. mris_calc -o product.mgz lobe.mgz mul lobe_surface.mgz
Martin Ystad wrote:
I tried this, but something is going wrong. Here's what I did:
- I ran $ mri_binarize --i subjid/mri/aparc+asec.mgz --match xx
--match yy --o lobe.mgz
- this produces a nice binary mask of, say, the left frontal lobe.
- Then I ran $ mri_surf2vol --mkmask --surf pial --hemi lh --template
lobe.mgz --identity subjid --o lobe_surface.mgz
- this produces a nice binary image of the pial surface, but it
contains the whole surface, not only the intersection with lobe.mgz. What am I doing wrong?
Thanks, Martin
Douglas N Greve wrote:
Use mri_surf2vol to create volumes. You can binarize aparc+aseg.mgz to give a mask of an area (use --match), then take the intersection of the mask with the surface-in-volume.
doug
Martin Ystad wrote:
Hi, I'm working on a fractal dimension analysis of the pial- and white-matter surface. The matlab script that calculates the fractal dimension needs binary nifti-files as input. Since FreeSurfer creates the surfaces I need, here's what I want to do: I'd like to convert the pial and white-matter surfaces (separately) to .nii-volumes (e.g. 256x256) where the voxels intersected by the respective surfaces are white, and everything else is black. Furthermore, I'd like to do this for individual subregions of each surface; for example only the precentral gyrus or the whole frontal lobe, so that only the voxels intersected by the surface belonging to the specific label I choose appear white, and everything else is black. How do I get this output from FreeSurfer?
Thanks, Martin Ystad PhD-candidate, University of Bergen, Norway _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Hi, thanks for the answer. Sorry for my delayed response. I tried the mris_calc command, but it didn't work. Here's the error message I got:
"mris_calc: curvature file 'lobe.mgz' has wrong magic number."
The multiplication was easily done i Matlab, but is there any way to do this with FreeSurfer?
Thanks, Martin
Douglas N Greve wrote:
The 2nd step only creates a mask of the entire surface. You need a step 3 in which you multiply them together:
- mris_calc -o product.mgz lobe.mgz mul lobe_surface.mgz
Martin Ystad wrote:
I tried this, but something is going wrong. Here's what I did:
- I ran $ mri_binarize --i subjid/mri/aparc+asec.mgz --match xx
--match yy --o lobe.mgz
- this produces a nice binary mask of, say, the left frontal lobe.
- Then I ran $ mri_surf2vol --mkmask --surf pial --hemi lh
--template lobe.mgz --identity subjid --o lobe_surface.mgz
- this produces a nice binary image of the pial surface, but it
contains the whole surface, not only the intersection with lobe.mgz. What am I doing wrong?
Thanks, Martin
Douglas N Greve wrote:
Use mri_surf2vol to create volumes. You can binarize aparc+aseg.mgz to give a mask of an area (use --match), then take the intersection of the mask with the surface-in-volume.
doug
Martin Ystad wrote:
Hi, I'm working on a fractal dimension analysis of the pial- and white-matter surface. The matlab script that calculates the fractal dimension needs binary nifti-files as input. Since FreeSurfer creates the surfaces I need, here's what I want to do: I'd like to convert the pial and white-matter surfaces (separately) to .nii-volumes (e.g. 256x256) where the voxels intersected by the respective surfaces are white, and everything else is black. Furthermore, I'd like to do this for individual subregions of each surface; for example only the precentral gyrus or the whole frontal lobe, so that only the voxels intersected by the surface belonging to the specific label I choose appear white, and everything else is black. How do I get this output from FreeSurfer?
Thanks, Martin Ystad PhD-candidate, University of Bergen, Norway _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu