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 <[EMAIL PROTECTED]>:
> 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

Reply via email to