Hi Darshan,

If you'd like to go directly from FreeSurfer .asc to OBJ, the attached little script should do the trick...

Hope it helps!

All the best,

Anderson



On 21/02/12 16:59, Pedro Paulo de Magalhães Oliveira Junior wrote:
There's a how-to in the FreeSurfer website: http://surfer.nmr.mgh.harvard.edu/fswiki/HowTo/HowTo

Pedro Paulo Jr.

On Mon, Feb 20, 2012 at 23:32, Manfred G Kitzbichler <manfr...@nmr.mgh.harvard.edu <mailto:manfr...@nmr.mgh.harvard.edu>> wrote:

    Hi Darshan,

    as Bruce suggested, you can use mris_convert to get an STL file
    which you can import into Blender or MeshLab. Both write Wavefront
    OBJ files.

        - Manfred



    On 02/20/2012 07:24 PM, Darshan P wrote:
    Hello all,

    I was wondering if I can convert the surface outputs to an OBJ
    mesh file format .
    Since most of the applications are in windows I was hoping if
    there is conversion tool to do this .

    Regards
    Darshan


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


-- Manfred G. Kitzbichler
    
<https://www.nmr.mgh.harvard.edu/martinos/people/showPerson.php?people_id=1377>,
    Research Fellow
    Harvard Medical School & Mass General Hospital
    Martinos Center for Biomedical Imaging
    149 Thirteenth Street, Rm 10.018
    Charlestown, MA 02129, USA

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


    The information in this e-mail is intended only for the person to
    whom it is
    addressed. If you believe this e-mail was sent to you in error and
    the e-mail
    contains patient information, please contact the Partners
    Compliance HelpLine at
    http://www.partners.org/complianceline . If the e-mail was sent to
    you in error
    but does not contain patient information, please contact the
    sender and properly
    dispose of the e-mail.



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


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

#!/bin/gawk -f

BEGIN { if (ARGV[1] == "") { 
print "Convert Surface ASCII format to OBJ."
print ""
print "Usage:"
print "srf2obj <input.srf>  >  <output.obj>"
print ""
print "The output goes to stdout. Use > to redirect to"
print "a file, as shown above"
print ""
print "_____________________________________"
print "Anderson M. Winkler"
print "Yale University / Institute of Living"
print "Jan/2010"
exit } }

# Count number of vertices and faces from the 2nd record
NR == 2 { nV=$1 ; nF=$2 }

# Print vertex coordinates
NR>=3 && NR<=nV+2 { print "v", $1, $2, $3}

# Print faces' vertex indices
NR>=nV+3 && NR<=nV+nF+2 { print "f", $1+1, $2+1, $3+1 }
_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

Reply via email to