Hi,
We have segmented hippocampus using Freesurfer, and want to generate a surface which can be read into matlab.
We use mri_tesselate and mris_smooth. However, the resulting file can not be read into matlab using read_surf. The error we get is
??? Undefined function or variable "vertex_coords".
Error in ==> read_surf at 77 vertex_coords = reshape(vertex_coords, 3, vnum)' ;
It seems the 'magic' number is 16777213, whereas only 16777214 and 16777215 are supported in read_surf.m
How can we read the result of mris_smooth into matlab?
Thanks!
Kim.
Kim,
Which version of freesurfer is being used?
An alternative approach is to convert the surface to ascii:
mris_convert surface_file surface_file.asc
where the .asc extension is an output ascii file listing the vertices and faces.
Nick
On Thu, 2007-11-15 at 16:18 +0100, Kim Mouridsen wrote:
Hi,
We have segmented hippocampus using Freesurfer, and want to generate a surface which can be read into matlab.
We use mri_tesselate and mris_smooth. However, the resulting file can not be read into matlab using read_surf. The error we get is
??? Undefined function or variable "vertex_coords".
Error in ==> read_surf at 77 vertex_coords = reshape(vertex_coords, 3, vnum)' ;
It seems the 'magic' number is 16777213, whereas only 16777214 and 16777215 are supported in read_surf.m
How can we read the result of mris_smooth into matlab?
Thanks!
Kim. _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Hi Nick,
The Freesurfer version I use has build stamp freesurfer-Darwin-tiger-i686-stable-pub-v4.0.1
After conversion, read_asc.m doesn't work - seemingly due to a dimension problem. In the code I see that 5 elements are expected for faces and indicies, whereas only 4 elements are provided in the .asc file. I changed lines 45-46 into
f = fscanf(fp, '%d', S(3)*4); f = reshape(f, [4 S(3)])';
Using patch in Matlab with v(:,1:3) as vertices and f(:,[1 3 2]) as faces, I get an image of the hippocampus surface.
The surface looks good(!) but is a bit rough and 'spiky'. Is this because the segmentation procedure does not employ a smoothness constraint?
The aim of all this is to prepare hippocampal volumes for deformation analysis (two groups, two time points). Is the following line of processing appropriate:
Topology correction: mri_topologycorrection -label "hippocampus" subject/mri/norm.mgz subject/mri/aseg.mgz aseg_corrected
Tesselate surface: mri_tessellate
Smooth surface: mris_smooth
Convert to ascii for use with Matlab: mris_convert
Cheers! Kim.
2007/11/16, Nick Schmansky nicks@nmr.mgh.harvard.edu:
Kim,
Which version of freesurfer is being used?
An alternative approach is to convert the surface to ascii:
mris_convert surface_file surface_file.asc
where the .asc extension is an output ascii file listing the vertices and faces.
Nick
On Thu, 2007-11-15 at 16:18 +0100, Kim Mouridsen wrote:
Hi,
We have segmented hippocampus using Freesurfer, and want to generate a surface which can be read into matlab.
We use mri_tesselate and mris_smooth. However, the resulting file can not be read into matlab using read_surf. The error we get is
??? Undefined function or variable "vertex_coords".
Error in ==> read_surf at 77 vertex_coords = reshape(vertex_coords, 3, vnum)' ;
It seems the 'magic' number is 16777213, whereas only 16777214 and 16777215 are supported in read_surf.m
How can we read the result of mris_smooth into matlab?
Thanks!
Kim. _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Hi Kim,
we do have some tools for smoothing the hippocampal surfaces, but we haven't distributed them. I could try to get you a beta version if you like.
cheers, Bruce On Fri, 16 Nov 2007, Kim Mouridsen wrote:
Hi Nick,
The Freesurfer version I use has build stamp freesurfer-Darwin-tiger-i686-stable-pub-v4.0.1
After conversion, read_asc.m doesn't work - seemingly due to a dimension problem. In the code I see that 5 elements are expected for faces and indicies, whereas only 4 elements are provided in the .asc file. I changed lines 45-46 into
f = fscanf(fp, '%d', S(3)*4); f = reshape(f, [4 S(3)])';
Using patch in Matlab with v(:,1:3) as vertices and f(:,[1 3 2]) as faces, I get an image of the hippocampus surface.
The surface looks good(!) but is a bit rough and 'spiky'. Is this because the segmentation procedure does not employ a smoothness constraint?
The aim of all this is to prepare hippocampal volumes for deformation analysis (two groups, two time points). Is the following line of processing appropriate:
Topology correction: mri_topologycorrection -label "hippocampus" subject/mri/norm.mgz subject/mri/aseg.mgz aseg_corrected
Tesselate surface: mri_tessellate
Smooth surface: mris_smooth
Convert to ascii for use with Matlab: mris_convert
Cheers! Kim.
2007/11/16, Nick Schmansky nicks@nmr.mgh.harvard.edu:
Kim,
Which version of freesurfer is being used?
An alternative approach is to convert the surface to ascii:
mris_convert surface_file surface_file.asc
where the .asc extension is an output ascii file listing the vertices and faces.
Nick
On Thu, 2007-11-15 at 16:18 +0100, Kim Mouridsen wrote:
Hi,
We have segmented hippocampus using Freesurfer, and want to generate a surface which can be read into matlab.
We use mri_tesselate and mris_smooth. However, the resulting file can not be read into matlab using read_surf. The error we get is
??? Undefined function or variable "vertex_coords".
Error in ==> read_surf at 77 vertex_coords = reshape(vertex_coords, 3, vnum)' ;
It seems the 'magic' number is 16777213, whereas only 16777214 and 16777215 are supported in read_surf.m
How can we read the result of mris_smooth into matlab?
Thanks!
Kim. _______________________________________________ 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
Hi Bruce,
Thanks, that would be perfect!
I tried increasing the number of smoothing iterations in mris_smooth, and this improves the result, but this is probably not the best way to do it.
We would be very happy if you could send us a beta version of your smoothing tools.
Cheers, Kim.
2007/11/16, Bruce Fischl fischl@nmr.mgh.harvard.edu:
Hi Kim,
we do have some tools for smoothing the hippocampal surfaces, but we haven't distributed them. I could try to get you a beta version if you like.
cheers, Bruce On Fri, 16 Nov 2007, Kim Mouridsen wrote:
Hi Nick,
The Freesurfer version I use has build stamp freesurfer-Darwin-tiger-i686-stable-pub-v4.0.1
After conversion, read_asc.m doesn't work - seemingly due to a dimension problem. In the code I see that 5 elements are expected for faces and indicies, whereas only 4 elements are provided in the .asc file. I changed lines 45-46 into
f = fscanf(fp, '%d', S(3)*4); f = reshape(f, [4 S(3)])';
Using patch in Matlab with v(:,1:3) as vertices and f(:,[1 3 2]) as faces, I get an image of the hippocampus surface.
The surface looks good(!) but is a bit rough and 'spiky'. Is this because the segmentation procedure does not employ a smoothness constraint?
The aim of all this is to prepare hippocampal volumes for deformation analysis (two groups, two time points). Is the following line of processing appropriate:
Topology correction: mri_topologycorrection -label "hippocampus" subject/mri/norm.mgz subject/mri/aseg.mgz aseg_corrected
Tesselate surface: mri_tessellate
Smooth surface: mris_smooth
Convert to ascii for use with Matlab: mris_convert
Cheers! Kim.
2007/11/16, Nick Schmansky nicks@nmr.mgh.harvard.edu:
Kim,
Which version of freesurfer is being used?
An alternative approach is to convert the surface to ascii:
mris_convert surface_file surface_file.asc
where the .asc extension is an output ascii file listing the vertices and faces.
Nick
On Thu, 2007-11-15 at 16:18 +0100, Kim Mouridsen wrote:
Hi,
We have segmented hippocampus using Freesurfer, and want to generate a surface which can be read into matlab.
We use mri_tesselate and mris_smooth. However, the resulting file can not be read into matlab using read_surf. The error we get is
??? Undefined function or variable "vertex_coords".
Error in ==> read_surf at 77 vertex_coords = reshape(vertex_coords, 3, vnum)' ;
It seems the 'magic' number is 16777213, whereas only 16777214 and 16777215 are supported in read_surf.m
How can we read the result of mris_smooth into matlab?
Thanks!
Kim. _______________________________________________ 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
Hello Bruce
We are also very interested in your hippocampal surface smoothing tools.
Can you provide us with the beta version of your software?
I advance Thank you
Jorge
--- Bruce Fischl fischl@nmr.mgh.harvard.edu escribió:
Hi Kim,
we do have some tools for smoothing the hippocampal surfaces, but we haven't distributed them. I could try to get you a beta version if you like.
cheers, Bruce
.
______________________________________________ Pregunta, Responde, Descubre. Comparte tus consejos y opiniones con los usuarios de Yahoo! Respuestas http://es.answers.yahoo.com/info/welcome
There is a freely available MATLAB codes for smoothing arbitrary surface objects using spherical harmonics. It's a different technique. But this technique will provide surface-to-surface alignment automatically without additional computation. See
http://www.stat.wisc.edu/~mchung/softwares/weighted-SPHARM/weighted-SPHARM.h...
You may have to change code a bit since "mesh connectivity" will be different from one surface to another.
Hi Moo,
this application is a bit different as it's not a linear smoothing. The idea is to get rid of anatomically unlikely shapes while preserving the surface elsewhere.
cheers, Bruce On Mon, 19 Nov 2007, Moo K. Chung wrote:
There is a freely available MATLAB codes for smoothing arbitrary surface objects using spherical harmonics. It's a different technique. But this technique will provide surface-to-surface alignment automatically without additional computation. See
http://www.stat.wisc.edu/~mchung/softwares/weighted-SPHARM/weighted-SPHARM.h...
You may have to change code a bit since "mesh connectivity" will be different from one surface to another.
freesurfer@nmr.mgh.harvard.edu