Dear All,
I have created a volume of interest in itksnap and imported it in FS as a .mgz volume filled binary mask. How can I: 1. export it from FS in matlab and generate a .mat array containing only the volume pixels within the volume (intensity 1) ?
2. Is there a way to generate a 3D surface mesh of the boundary of the volume of interest, as, for example, with the brain pial surface? If not, is there a way to import into FS formats such as VTK, STL or BYU meshes?
Thank you,
Octavian
On 12/17/2012 05:56 PM, octavian lie wrote:
Dear All,
I have created a volume of interest in itksnap and imported it in FS as a .mgz volume filled binary mask. How can I:
- export it from FS in matlab and generate a .mat array containing
only the volume pixels within the volume (intensity 1) ?
You can use MRIread, like a = MRIread('youfile.mgz'); ind = find(a.vol); save('ind.mat','ind');
- Is there a way to generate a 3D surface mesh of the boundary of the
volume of interest, as, for example, with the brain pial surface? If not, is there a way to import into FS formats such as VTK, STL or BYU meshes?
Try mri_tesselate yourfile.mgz 1 yoursurface
Thank you,
Octavian _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Dear Douglas,
Thank you very much for your input.
1. I generated the ind matrix as per your script, but what I wanted is to get a matrix with the RAS coordinates for the pixels indexed in ind. Is there a way to do this?
Thank you,
Octavian
If you load the volume in with MRIread a = MRIread('yourvolume.mgz'); a.vox2ras1 is the one-based vox2ras matrix which takes a 1-based column, row, slice and converts it to RAS. So you just need to convert your indices to col, row, slice and apply this matrix.
doug
On 12/17/2012 06:53 PM, octavian lie wrote:
Dear Douglas,
Thank you very much for your input.
- I generated the ind matrix as per your script, but what I wanted is
to get a matrix with the RAS coordinates for the pixels indexed in ind. Is there a way to do this?
Thank you,
Octavian
freesurfer@nmr.mgh.harvard.edu