Hi Marie,

I think I had a similar problem with my script. I believe the problem is with the two lines of chars (the creation string). For whatever reason, I think that it worked better
if the second line was empty.

This is the relevant section from my script:

fs_fwrite3(fid,TRIANGLE_FILE_MAGIC_NUMBER) ;
fprintf(fid,'created by %s on %s\n\n',user,datestr(now)); % creation date text line
fwrite(fid,nverts,'int32');
fwrite(fid,nfaces,'int32');
fwrite(fid,coords,'float32');
fwrite(fid,faces,'int32');

Comparing to the one you are using, only the creation string line is significantly different.

Don

From: Marie Schaer <[EMAIL PROTECTED]>
To: freesurfer@nmr.mgh.harvard.edu
Subject: [Freesurfer] writing surface file
Date: Thu, 02 Aug 2007 16:39:31 +0200


Hello everybody,

I would like to write a surface in freesurfer format from a matlab triangular mesh (e.g. list of 67120 vertices associated with 134236 faces). To read the freesurfer surfaces, I usually use the very useful bioelectromagnetism toolbox by Darren Weber, but I am not able to find out why the freesurfer_write_surface function (attached to this mail) do not work with my mesh. It indeed seems to write a surface of adequate size (2.3MB), but when I try to visualize it, tkmedit respond:

"(null): vertex 0 x coordinate 282617032931096509022208.000000 ! "

Does someone has any hints on that or an available matlab script to write a freesurfer surface?

Many thanks for your help,

Marie Schaer



<< freesurfer_write_surf.m >>


_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

_________________________________________________________________
Puzzles, trivia teasers, word scrambles and more. Play for your chance to win! http://club.live.com/home.aspx?icid=CLUB_hotmailtextlink
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

Reply via email to