Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-15 Thread Anderson Winkler

oops, sorry list, this was supposed to go to Pedro...

On 15/10/11 17:39, Anderson Winkler wrote:

Ah Pedro,
Se era isso que você precisava, poderia ter falado. Eu tenho isso 
pronto, que pode ser chamado via linha de comandos. Foi usado no paper 
que vc deve ter visto...

Abração,
Anderson


On 15/10/11 13:09, Pedro Paulo de Magalhães Oliveira Junior wrote:

Michael,

Thanks for the hint.

Here's a program that converts the surface + annotation in a Stanford 
PLY Object file


# Create ply
# Stanford Object format
from surfer import io as io_

surface = io_.read_geometry 
('/Applications/freesurfer/subjects/bert/surf/lh.pial')
labels = io_.read_annot 
('/Applications/freesurfer/subjects/bert/label/lh.aparc.annot')


facenum = len(surface[1])
vertnum = len(surface[0])

print "ply"
print "format ascii 1.0"
print "comment VCGLIB generated"
print "element vertex %d"%vertnum
print "property float x"
print "property float y"
print "property float z"
#print "property int flags"
print "property uchar red"
print "property uchar green"
print "property uchar blue"
print "property uchar alpha"
print "element face %d"%facenum
print "property list uchar int vertex_indices"
print "end_header"
for i in xrange(vertnum):
vert = surface[0][i];
color = labels[1][labels[0][i]]
print "%f %f %f %d %d %d 
%d"%(vert[0],vert[1],vert[2],color[0],color[1],color[2],color[3])


for i in xrange(facenum):
face = surface[1][i]
print "3 %d %d %d"%(face[0],face[1],face[2])




2011/10/9 Michael Waskom >


If you know Python, you can likely do this pretty easily with
tools from the PySurfer package: http://pysurfer.github.com/

(Check out surfer.io.read_annotation).

If you're just using the io routines, you won't need the somewhat
heavy Mayavi visualization dependencies.  You should be able to
read in and manipulate surfaces/annotations just with numpy.

Best,
Michael


2011/10/8 Bruce Fischl mailto:fis...@nmr.mgh.harvard.edu>>

it wouldn't be that hard to put something together if you
want to avoid matlab. Spec out what you need and send me a
sample, maybe on Bert

Bruce

On Sat, 8 Oct 2011, Pedro Paulo de Magalhães Oliveira Junior
wrote:

Thanks.

I suppose I can't do this without matlab. Right?

-- iOS 5.0

Em 08/10/2011, às 19:29, Bruce Fischl
mailto:fis...@nmr.mgh.harvard.edu>> escreveu:

there is a write_annotation.m file you can use
On Sat, 8 Oct 2011, Anderson Winkler wrote:

ops, it seems the comments inside the dpxwrite.m
no longer reflect what it does. You probably
don't need this, but anyway, the version attached
is more up-to-date.
Anderson
On 08/10/11 17:28, Anderson Winkler wrote:
Hi Pedro,

There is probably a way to do that using FS
tools from the command line, but the attached
script should do the same. The result is a
"data-per-vertex" file, which
is the same as the .asc files from
mris_convert. There is no geometry input, hence
the vertex coordinates are all set to (0,0,0).

Hope it helps!

All the best,

Anderson

On 08/10/11 17:17, Pedro Paulo de Magalh�es
Oliveira Junior wrote:
  I need to create a file where I have
the parcellation value (structure name) per vertex.
I've tried�mris_convert --annot
/Applications/freesurfer/subjects/bert/label/lh.aparc.annot
/Applications/freesurfer/subjects/bert/surf/lh.pial
parc.asc
But I get the error:�ERROR: unknown file annot
file type specified for output: saida.asc
Has someone done this before?
Thanks

-
Pedro Paulo de Magalh�es Oliveira Junior
Netfilter & SpeedComm Telecom --
www.netfilter.com.br 
-- For

mobile:�http://itunes.apple.com/br/artist/netfilter/id365306441
___
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 

Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-15 Thread Anderson Winkler

Ah Pedro,
Se era isso que você precisava, poderia ter falado. Eu tenho isso 
pronto, que pode ser chamado via linha de comandos. Foi usado no paper 
que vc deve ter visto...

Abração,
Anderson


On 15/10/11 13:09, Pedro Paulo de Magalhães Oliveira Junior wrote:

Michael,

Thanks for the hint.

Here's a program that converts the surface + annotation in a Stanford 
PLY Object file


# Create ply
# Stanford Object format
from surfer import io as io_

surface = io_.read_geometry 
('/Applications/freesurfer/subjects/bert/surf/lh.pial')
labels = io_.read_annot 
('/Applications/freesurfer/subjects/bert/label/lh.aparc.annot')


facenum = len(surface[1])
vertnum = len(surface[0])

print "ply"
print "format ascii 1.0"
print "comment VCGLIB generated"
print "element vertex %d"%vertnum
print "property float x"
print "property float y"
print "property float z"
#print "property int flags"
print "property uchar red"
print "property uchar green"
print "property uchar blue"
print "property uchar alpha"
print "element face %d"%facenum
print "property list uchar int vertex_indices"
print "end_header"
for i in xrange(vertnum):
vert = surface[0][i];
color = labels[1][labels[0][i]]
print "%f %f %f %d %d %d 
%d"%(vert[0],vert[1],vert[2],color[0],color[1],color[2],color[3])


for i in xrange(facenum):
face = surface[1][i]
print "3 %d %d %d"%(face[0],face[1],face[2])




2011/10/9 Michael Waskom >


If you know Python, you can likely do this pretty easily with
tools from the PySurfer package: http://pysurfer.github.com/

(Check out surfer.io.read_annotation).

If you're just using the io routines, you won't need the somewhat
heavy Mayavi visualization dependencies.  You should be able to
read in and manipulate surfaces/annotations just with numpy.

Best,
Michael


2011/10/8 Bruce Fischl mailto:fis...@nmr.mgh.harvard.edu>>

it wouldn't be that hard to put something together if you want
to avoid matlab. Spec out what you need and send me a sample,
maybe on Bert

Bruce

On Sat, 8 Oct 2011, Pedro Paulo de Magalhães Oliveira Junior
wrote:

Thanks.

I suppose I can't do this without matlab. Right?

-- iOS 5.0

Em 08/10/2011, às 19:29, Bruce Fischl
mailto:fis...@nmr.mgh.harvard.edu>> escreveu:

there is a write_annotation.m file you can use
On Sat, 8 Oct 2011, Anderson Winkler wrote:

ops, it seems the comments inside the dpxwrite.m
no longer reflect what it does. You probably don't
need this, but anyway, the version attached is
more up-to-date.
Anderson
On 08/10/11 17:28, Anderson Winkler wrote:
Hi Pedro,

There is probably a way to do that using FS
tools from the command line, but the attached
script should do the same. The result is a
"data-per-vertex" file, which
is the same as the .asc files from
mris_convert. There is no geometry input, hence
the vertex coordinates are all set to (0,0,0).

Hope it helps!

All the best,

Anderson

On 08/10/11 17:17, Pedro Paulo de Magalh�es
Oliveira Junior wrote:
  I need to create a file where I have the
parcellation value (structure name) per vertex.
I've tried�mris_convert --annot
/Applications/freesurfer/subjects/bert/label/lh.aparc.annot
/Applications/freesurfer/subjects/bert/surf/lh.pial parc.asc
But I get the error:�ERROR: unknown file annot
file type specified for output: saida.asc
Has someone done this before?
Thanks

-
Pedro Paulo de Magalh�es Oliveira Junior
Netfilter & SpeedComm Telecom --
www.netfilter.com.br 
-- For

mobile:�http://itunes.apple.com/br/artist/netfilter/id365306441
___
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 sen

Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-15 Thread Pedro Paulo de Magalhães Oliveira Junior
Michael,

Thanks for the hint.

Here's a program that converts the surface + annotation in a Stanford PLY
Object file

# Create ply
# Stanford Object format
from surfer import io as io_

surface = io_.read_geometry
('/Applications/freesurfer/subjects/bert/surf/lh.pial')
labels = io_.read_annot
('/Applications/freesurfer/subjects/bert/label/lh.aparc.annot')

facenum = len(surface[1])
vertnum = len(surface[0])

print "ply"
print "format ascii 1.0"
print "comment VCGLIB generated"
print "element vertex %d"%vertnum
print "property float x"
print "property float y"
print "property float z"
#print "property int flags"
print "property uchar red"
print "property uchar green"
print "property uchar blue"
print "property uchar alpha"
print "element face %d"%facenum
print "property list uchar int vertex_indices"
print "end_header"
for i in xrange(vertnum):
vert = surface[0][i];
color = labels[1][labels[0][i]]
print "%f %f %f %d %d %d
%d"%(vert[0],vert[1],vert[2],color[0],color[1],color[2],color[3])

for i in xrange(facenum):
face = surface[1][i]
print "3 %d %d %d"%(face[0],face[1],face[2])




2011/10/9 Michael Waskom 

> If you know Python, you can likely do this pretty easily with tools from
> the PySurfer package:  http://pysurfer.github.com/
>
> (Check out surfer.io.read_annotation).
>
> If you're just using the io routines, you won't need the somewhat heavy
> Mayavi visualization dependencies.  You should be able to read in and
> manipulate surfaces/annotations just with numpy.
>
> Best,
> Michael
>
>
> 2011/10/8 Bruce Fischl 
>
>> it wouldn't be that hard to put something together if you want to avoid
>> matlab. Spec out what you need and send me a sample, maybe on Bert
>>
>> Bruce
>>
>> On Sat, 8 Oct 2011, Pedro Paulo de Magalhães Oliveira Junior wrote:
>>
>>  Thanks.
>>>
>>> I suppose I can't do this without matlab. Right?
>>>
>>> -- iOS 5.0
>>>
>>> Em 08/10/2011, às 19:29, Bruce Fischl 
>>> escreveu:
>>>
>>>  there is a write_annotation.m file you can use
 On Sat, 8 Oct 2011, Anderson Winkler wrote:

  ops, it seems the comments inside the dpxwrite.m no longer reflect what
> it does. You probably don't need this, but anyway, the version attached is
> more up-to-date.
> Anderson
> On 08/10/11 17:28, Anderson Winkler wrote:
> Hi Pedro,
>
> There is probably a way to do that using FS tools from the command
> line, but the attached script should do the same. The result is a
> "data-per-vertex" file, which
> is the same as the .asc files from mris_convert. There is no
> geometry input, hence the vertex coordinates are all set to (0,0,0).
>
> Hope it helps!
>
> All the best,
>
> Anderson
>
> On 08/10/11 17:17, Pedro Paulo de Magalh�es Oliveira Junior
> wrote:
>   I need to create a file where I have the parcellation value
> (structure name) per vertex.
> I've tried�mris_convert --annot /Applications/freesurfer/**
> subjects/bert/label/lh.aparc.**annot 
> /Applications/freesurfer/**subjects/bert/surf/lh.pial
> parc.asc
> But I get the error:�ERROR: unknown file annot file type specified
> for output: saida.asc
> Has someone done this before?
> Thanks
> --**--**
> -
> Pedro Paulo de Magalh�es Oliveira Junior
> Netfilter & SpeedComm Telecom -- www.netfilter.com.br
> -- For mobile:�http://itunes.apple.**com/br/artist/netfilter/**
> id365306441 
> __**_
> 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.
> __**_
> 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

Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-15 Thread Pedro Paulo de Magalhães Oliveira Junior
Yes, but --seg in mri_annotation2label --subject bert --hemi lh --seg
saida.mgz produces a volume and not a surface.
-
Pedro Paulo de Magalhães Oliveira Junior
Netfilter & SpeedComm Telecom
-- www.netfilter.com.br
-- For mobile: http://itunes.apple.com/br/artist/netfilter/id365306441




On Tue, Oct 11, 2011 at 13:12, Douglas N Greve wrote:

> Have you tried using mri_annotation2label with the --seg output option?
> doug
>
> Michael Waskom wrote:
>
>> If you know Python, you can likely do this pretty easily with tools from
>> the PySurfer package:  http://pysurfer.github.com/
>>
>> (Check out surfer.io.read_annotation).
>>
>> If you're just using the io routines, you won't need the somewhat heavy
>> Mayavi visualization dependencies.  You should be able to read in and
>> manipulate surfaces/annotations just with numpy.
>> Best,
>> Michael
>>
>> 2011/10/8 Bruce Fischl > fis...@nmr.mgh.**harvard.edu >>
>>
>>
>>it wouldn't be that hard to put something together if you want to
>>avoid matlab. Spec out what you need and send me a sample, maybe
>>on Bert
>>
>>Bruce
>>
>>On Sat, 8 Oct 2011, Pedro Paulo de Magalhães Oliveira Junior wrote:
>>
>>Thanks.
>>
>>I suppose I can't do this without matlab. Right?
>>
>>-- iOS 5.0
>>
>>Em 08/10/2011, às 19:29, Bruce Fischl
>>>>
>> escreveu:
>>
>>
>>there is a write_annotation.m file you can use
>>On Sat, 8 Oct 2011, Anderson Winkler wrote:
>>
>>ops, it seems the comments inside the dpxwrite.m no
>>longer reflect what it does. You probably don't need
>>this, but anyway, the version attached is more up-to-date.
>>Anderson
>>On 08/10/11 17:28, Anderson Winkler wrote:
>>Hi Pedro,
>>
>>There is probably a way to do that using FS tools
>>from the command line, but the attached script should
>>do the same. The result is a "data-per-vertex" file, which
>>is the same as the .asc files from mris_convert.
>>There is no geometry input, hence the vertex
>>coordinates are all set to (0,0,0).
>>
>>Hope it helps!
>>
>>All the best,
>>
>>Anderson
>>
>>On 08/10/11 17:17, Pedro Paulo de Magalh�es
>>Oliveira Junior wrote:
>>  I need to create a file where I have the
>>parcellation value (structure name) per vertex.
>>I've tried�mris_convert --annot
>>/Applications/freesurfer/
>>subjects/bert/label/lh.aparc. annot
>>/Applications/freesurfer/ subjects/bert/surf/lh.pial
>>parc.asc
>>But I get the error:�ERROR: unknown file annot file
>>type specified for output: saida.asc
>>Has someone done this before?
>>Thanks
>>--
>>-- -
>>Pedro Paulo de Magalh�es Oliveira Junior
>>Netfilter & SpeedComm Telecom -- www.netfilter.com.br
>>
>>
>>-- For mobile:�http://itunes.apple.
>>com/br/artist/netfilter/ id365306441
>>
>> 
>> >
>>__ _
>>Freesurfer mailing list
>>Freesurfer@nmr.mgh.harvard.edu
>>
>> > >
>>https://mail.nmr.mgh.harvard. edu/mailman/listinfo/
>>freesurfer
>>
>>> 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.
>>__ _
>>Free

Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-11 Thread Douglas N Greve
Have you tried using mri_annotation2label with the --seg output option?
doug

Michael Waskom wrote:
> If you know Python, you can likely do this pretty easily with tools 
> from the PySurfer package:  http://pysurfer.github.com/
>
> (Check out surfer.io.read_annotation).
>
> If you're just using the io routines, you won't need the somewhat 
> heavy Mayavi visualization dependencies.  You should be able to read 
> in and manipulate surfaces/annotations just with numpy. 
>
> Best,
> Michael
>
> 2011/10/8 Bruce Fischl  >
>
> it wouldn't be that hard to put something together if you want to
> avoid matlab. Spec out what you need and send me a sample, maybe
> on Bert
>
> Bruce
>
> On Sat, 8 Oct 2011, Pedro Paulo de Magalhães Oliveira Junior wrote:
>
> Thanks.
>
> I suppose I can't do this without matlab. Right?
>
> -- iOS 5.0
>
> Em 08/10/2011, às 19:29, Bruce Fischl
>  > escreveu:
>
> there is a write_annotation.m file you can use
> On Sat, 8 Oct 2011, Anderson Winkler wrote:
>
> ops, it seems the comments inside the dpxwrite.m no
> longer reflect what it does. You probably don't need
> this, but anyway, the version attached is more up-to-date.
> Anderson
> On 08/10/11 17:28, Anderson Winkler wrote:
> Hi Pedro,
>
> There is probably a way to do that using FS tools
> from the command line, but the attached script should
> do the same. The result is a "data-per-vertex" file, which
> is the same as the .asc files from mris_convert.
> There is no geometry input, hence the vertex
> coordinates are all set to (0,0,0).
>
> Hope it helps!
>
> All the best,
>
> Anderson
>
> On 08/10/11 17:17, Pedro Paulo de Magalh�es
> Oliveira Junior wrote:
>   I need to create a file where I have the
> parcellation value (structure name) per vertex.
> I've tried�mris_convert --annot
> /Applications/freesurfer/
> subjects/bert/label/lh.aparc. annot
> /Applications/freesurfer/ subjects/bert/surf/lh.pial
> parc.asc
> But I get the error:�ERROR: unknown file annot file
> type specified for output: saida.asc
> Has someone done this before?
> Thanks
> --
> -- -
> Pedro Paulo de Magalh�es Oliveira Junior
> Netfilter & SpeedComm Telecom -- www.netfilter.com.br
> 
> -- For mobile:�http://itunes.apple.
> com/br/artist/netfilter/ id365306441
> 
> __ _
> 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.
> __ _
> 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
>

Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-09 Thread Pedro Paulo de Magalhães Oliveira Junior
Thanks.

It works as I wished.

from surfer import io as sIo
a = sIo.read_annot('label/lh.aparc.annot')
b = sIo.read_geometry('surf/lh.pial')

And now I can have each vertex labeled
-
Pedro Paulo de Magalhães Oliveira Junior
Netfilter & SpeedComm Telecom
-- www.netfilter.com.br
-- For mobile: http://itunes.apple.com/br/artist/netfilter/id365306441




2011/10/9 Michael Waskom 

> If you know Python, you can likely do this pretty easily with tools from
> the PySurfer package:  http://pysurfer.github.com/
>
> (Check out surfer.io.read_annotation).
>
> If you're just using the io routines, you won't need the somewhat heavy
> Mayavi visualization dependencies.  You should be able to read in and
> manipulate surfaces/annotations just with numpy.
>
> Best,
> Michael
>
>
> 2011/10/8 Bruce Fischl 
>
>> it wouldn't be that hard to put something together if you want to avoid
>> matlab. Spec out what you need and send me a sample, maybe on Bert
>>
>> Bruce
>>
>> On Sat, 8 Oct 2011, Pedro Paulo de Magalhães Oliveira Junior wrote:
>>
>>  Thanks.
>>>
>>> I suppose I can't do this without matlab. Right?
>>>
>>> -- iOS 5.0
>>>
>>> Em 08/10/2011, às 19:29, Bruce Fischl 
>>> escreveu:
>>>
>>>  there is a write_annotation.m file you can use
 On Sat, 8 Oct 2011, Anderson Winkler wrote:

  ops, it seems the comments inside the dpxwrite.m no longer reflect what
> it does. You probably don't need this, but anyway, the version attached is
> more up-to-date.
> Anderson
> On 08/10/11 17:28, Anderson Winkler wrote:
> Hi Pedro,
>
> There is probably a way to do that using FS tools from the command
> line, but the attached script should do the same. The result is a
> "data-per-vertex" file, which
> is the same as the .asc files from mris_convert. There is no
> geometry input, hence the vertex coordinates are all set to (0,0,0).
>
> Hope it helps!
>
> All the best,
>
> Anderson
>
> On 08/10/11 17:17, Pedro Paulo de Magalh�es Oliveira Junior
> wrote:
>   I need to create a file where I have the parcellation value
> (structure name) per vertex.
> I've tried�mris_convert --annot /Applications/freesurfer/**
> subjects/bert/label/lh.aparc.**annot 
> /Applications/freesurfer/**subjects/bert/surf/lh.pial
> parc.asc
> But I get the error:�ERROR: unknown file annot file type specified
> for output: saida.asc
> Has someone done this before?
> Thanks
> --**--**
> -
> Pedro Paulo de Magalh�es Oliveira Junior
> Netfilter & SpeedComm Telecom -- www.netfilter.com.br
> -- For mobile:�http://itunes.apple.**com/br/artist/netfilter/**
> id365306441 
> __**_
> 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.
> __**_
> 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.
>
 __**_
 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 

Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-08 Thread Michael Waskom
If you know Python, you can likely do this pretty easily with tools from the
PySurfer package:  http://pysurfer.github.com/

(Check out surfer.io.read_annotation).

If you're just using the io routines, you won't need the somewhat heavy
Mayavi visualization dependencies.  You should be able to read in and
manipulate surfaces/annotations just with numpy.

Best,
Michael

2011/10/8 Bruce Fischl 

> it wouldn't be that hard to put something together if you want to avoid
> matlab. Spec out what you need and send me a sample, maybe on Bert
>
> Bruce
>
> On Sat, 8 Oct 2011, Pedro Paulo de Magalhães Oliveira Junior wrote:
>
>  Thanks.
>>
>> I suppose I can't do this without matlab. Right?
>>
>> -- iOS 5.0
>>
>> Em 08/10/2011, às 19:29, Bruce Fischl 
>> escreveu:
>>
>>  there is a write_annotation.m file you can use
>>> On Sat, 8 Oct 2011, Anderson Winkler wrote:
>>>
>>>  ops, it seems the comments inside the dpxwrite.m no longer reflect what
 it does. You probably don't need this, but anyway, the version attached is
 more up-to-date.
 Anderson
 On 08/10/11 17:28, Anderson Winkler wrote:
 Hi Pedro,

 There is probably a way to do that using FS tools from the command
 line, but the attached script should do the same. The result is a
 "data-per-vertex" file, which
 is the same as the .asc files from mris_convert. There is no
 geometry input, hence the vertex coordinates are all set to (0,0,0).

 Hope it helps!

 All the best,

 Anderson

 On 08/10/11 17:17, Pedro Paulo de Magalh�es Oliveira Junior wrote:
   I need to create a file where I have the parcellation value
 (structure name) per vertex.
 I've tried�mris_convert --annot /Applications/freesurfer/**
 subjects/bert/label/lh.aparc.**annot 
 /Applications/freesurfer/**subjects/bert/surf/lh.pial
 parc.asc
 But I get the error:�ERROR: unknown file annot file type specified for
 output: saida.asc
 Has someone done this before?
 Thanks
 --**--**
 -
 Pedro Paulo de Magalh�es Oliveira Junior
 Netfilter & SpeedComm Telecom -- www.netfilter.com.br
 -- For mobile:�http://itunes.apple.**com/br/artist/netfilter/**
 id365306441 
 __**_
 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.
 __**_
 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.

>>> __**_
>>> 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.
>>>
>>
>>
>>
> ___
> 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 b

Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-08 Thread Bruce Fischl
it wouldn't be that hard to put something together if you want to avoid 
matlab. Spec out what you need and send me a sample, maybe on Bert


Bruce
On Sat, 8 
Oct 2011, Pedro Paulo de Magalhães Oliveira Junior wrote:



Thanks.

I suppose I can't do this without matlab. Right?

-- iOS 5.0

Em 08/10/2011, às 19:29, Bruce Fischl  escreveu:


there is a write_annotation.m file you can use
On Sat, 8 Oct 2011, Anderson Winkler wrote:


ops, it seems the comments inside the dpxwrite.m no longer reflect what it 
does. You probably don't need this, but anyway, the version attached is more 
up-to-date.
Anderson
On 08/10/11 17:28, Anderson Winkler wrote:
 Hi Pedro,

 There is probably a way to do that using FS tools from the command line, but the 
attached script should do the same. The result is a "data-per-vertex" file, 
which
 is the same as the .asc files from mris_convert. There is no geometry 
input, hence the vertex coordinates are all set to (0,0,0).

 Hope it helps!

 All the best,

 Anderson

 On 08/10/11 17:17, Pedro Paulo de Magalh�es Oliveira Junior wrote:
   I need to create a file where I have the parcellation value 
(structure name) per vertex.
I've tried�mris_convert --annot 
/Applications/freesurfer/subjects/bert/label/lh.aparc.annot 
/Applications/freesurfer/subjects/bert/surf/lh.pial parc.asc
But I get the error:�ERROR: unknown file annot file type specified for 
output: saida.asc
Has someone done this before?
Thanks
-
Pedro Paulo de Magalh�es Oliveira Junior
Netfilter & SpeedComm Telecom -- www.netfilter.com.br
-- For mobile:�http://itunes.apple.com/br/artist/netfilter/id365306441
___
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.
___
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.

___
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.



___
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.


Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-08 Thread Pedro Paulo de Magalhães Oliveira Junior
Thanks.

I suppose I can't do this without matlab. Right?

-- iOS 5.0

Em 08/10/2011, às 19:29, Bruce Fischl  escreveu:

> there is a write_annotation.m file you can use
> On Sat, 8 Oct 2011, Anderson Winkler wrote:
>
>> ops, it seems the comments inside the dpxwrite.m no longer reflect what it 
>> does. You probably don't need this, but anyway, the version attached is more 
>> up-to-date.
>> Anderson
>> On 08/10/11 17:28, Anderson Winkler wrote:
>>  Hi Pedro,
>>
>>  There is probably a way to do that using FS tools from the command 
>> line, but the attached script should do the same. The result is a 
>> "data-per-vertex" file, which
>>  is the same as the .asc files from mris_convert. There is no geometry 
>> input, hence the vertex coordinates are all set to (0,0,0).
>>
>>  Hope it helps!
>>
>>  All the best,
>>
>>  Anderson
>>
>>  On 08/10/11 17:17, Pedro Paulo de Magalh�es Oliveira Junior wrote:
>>I need to create a file where I have the parcellation value 
>> (structure name) per vertex.
>> I've tried�mris_convert --annot 
>> /Applications/freesurfer/subjects/bert/label/lh.aparc.annot 
>> /Applications/freesurfer/subjects/bert/surf/lh.pial parc.asc
>> But I get the error:�ERROR: unknown file annot file type specified for 
>> output: saida.asc
>> Has someone done this before?
>> Thanks
>> -
>> Pedro Paulo de Magalh�es Oliveira Junior
>> Netfilter & SpeedComm Telecom -- www.netfilter.com.br
>> -- For mobile:�http://itunes.apple.com/br/artist/netfilter/id365306441
>> ___
>> 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.
>> ___
>> 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.
> ___
> 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.

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


Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-08 Thread Bruce Fischl

there is a write_annotation.m file you can use
On Sat, 8 Oct 2011, Anderson 
Winkler wrote:



ops, it seems the comments inside the dpxwrite.m no longer reflect what it 
does. You probably don't need this, but anyway, the version attached is more 
up-to-date.
Anderson

On 08/10/11 17:28, Anderson Winkler wrote:
  Hi Pedro,

  There is probably a way to do that using FS tools from the command line, but the 
attached script should do the same. The result is a "data-per-vertex" file, 
which
  is the same as the .asc files from mris_convert. There is no geometry 
input, hence the vertex coordinates are all set to (0,0,0).

  Hope it helps!

  All the best,

  Anderson


  On 08/10/11 17:17, Pedro Paulo de Magalhães Oliveira Junior wrote:
I need to create a file where I have the parcellation value 
(structure name) per vertex.
I've tried mris_convert --annot 
/Applications/freesurfer/subjects/bert/label/lh.aparc.annot 
/Applications/freesurfer/subjects/bert/surf/lh.pial parc.asc

But I get the error: ERROR: unknown file annot file type specified for output: 
saida.asc

Has someone done this before?

Thanks
-
Pedro Paulo de Magalhães Oliveira Junior
Netfilter & SpeedComm Telecom -- www.netfilter.com.br
-- For mobile: http://itunes.apple.com/br/artist/netfilter/id365306441


___
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.



___
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.



___
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.


Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-08 Thread Anderson Winkler
ops, it seems the comments inside the dpxwrite.m no longer reflect what 
it does. You probably don't need this, but anyway, the version attached 
is more up-to-date.

Anderson

On 08/10/11 17:28, Anderson Winkler wrote:

Hi Pedro,

There is probably a way to do that using FS tools from the command 
line, but the attached script should do the same. The result is a 
"data-per-vertex" file, which is the same as the .asc files from 
mris_convert. There is no geometry input, hence the vertex coordinates 
are all set to (0,0,0).


Hope it helps!

All the best,

Anderson


On 08/10/11 17:17, Pedro Paulo de Magalhães Oliveira Junior wrote:
I need to create a file where I have the parcellation value 
(structure name) per vertex.


I've tried mris_convert --annot 
/Applications/freesurfer/subjects/bert/label/lh.aparc.annot 
/Applications/freesurfer/subjects/bert/surf/lh.pial parc.asc


But I get the error: ERROR: unknown file annot file type specified 
for output: saida.asc


Has someone done this before?

Thanks
-
Pedro Paulo de Magalhães Oliveira Junior
Netfilter & SpeedComm Telecom
-- www.netfilter.com.br 
-- For mobile: http://itunes.apple.com/br/artist/netfilter/id365306441



___
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.



___
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.


function dpxwrite(varargin)
% Write a curvature file (DPV or DPF), in ASCII format.
%
% dpxwrite(filename,dpx)
% dpxwrite(filename,dpx,crd,idx)
%
% - fname is the file name to be created
% - dpx contains the values for each vertex or face
% - crd contains the vertex coordinates or face indices
% - idx contains vertex or face sequential index
%
% _
% Anderson M. Winkler
% Yale University / Institute of Living
% Oct/2011

% File name
fname = varargin{1};

% Get the actual data
dpx = varargin{2}(:);
nX  = numel(dpx);

% Check if all are integers and use appropriate formating
if all(mod(dpx,1)==0),
fstr = '%d';
else
fstr = '%f';
end

if nargin == 2,

% Organise the data, fill the coords with zeros amd prep to save
dpx = [(0:nX-1) ; zeros(3,nX) ; dpx'];

elseif nargin == 4,

% Organise the coords
crd = varargin{3};
if size(crd,1) > size(crd,2),
crd = crd';
end

% Take the indices
idx = varargin{4}(:);

% Prepare to save
dpx = [idx' ; crd ; dpx'];

else
error('Incorrect number of arguments');
end

% Save
fid = fopen(fname,'w');
fprintf(fid,['%d %g %g %g ' fstr ' \n'],dpx);
fclose(fid);
___
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.


Re: [Freesurfer] mris_convert exporting parcellation per vertex

2011-10-08 Thread Anderson Winkler

Hi Pedro,

There is probably a way to do that using FS tools from the command line, 
but the attached script should do the same. The result is a 
"data-per-vertex" file, which is the same as the .asc files from 
mris_convert. There is no geometry input, hence the vertex coordinates 
are all set to (0,0,0).


Hope it helps!

All the best,

Anderson


On 08/10/11 17:17, Pedro Paulo de Magalhães Oliveira Junior wrote:
I need to create a file where I have the parcellation value (structure 
name) per vertex.


I've tried mris_convert --annot 
/Applications/freesurfer/subjects/bert/label/lh.aparc.annot 
/Applications/freesurfer/subjects/bert/surf/lh.pial parc.asc


But I get the error: ERROR: unknown file annot file type specified for 
output: saida.asc


Has someone done this before?

Thanks
-
Pedro Paulo de Magalhães Oliveira Junior
Netfilter & SpeedComm Telecom
-- www.netfilter.com.br 
-- For mobile: http://itunes.apple.com/br/artist/netfilter/id365306441



___
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.


function annot2dpv(annotfile,dpvfile)
% Convert an annotation file to a DPV file.
%
% Usage:
% annot2dpv(annotfile,dpvfile)
%
% Inputs:
% annotfile : Annotation file.
% dpvfile   : Output DPV file.
%
% Before running, be sure that ${FREESURFER_HOME}/matlab is in your
% OCTAVE/MATLAB path.
%
% _
% Anderson M. Winkler
% Yale University / Institute of Living
% Aug/2011

% Read the annotation file
[vtx,lab,ctab] = read_annotation(annotfile);

% For each structure, replace its coded colour by its index
for s = 1:ctab.numEntries,
lab(lab==ctab.table(s,5)) = s;
end

% Save the result
dpxwrite(dpvfile,lab)
function crvwrite(varargin)
% Write a curvature file (DPV or DPF), in ASCII format.
% This function is much faster than 'dlmread' for large files,
% and works only in Linux and Mac.
%
% crvwrite(filename,crv)
% crvwrite(filename,crv,crd,idx)
%
% - fname is the file name to be created
% - crv contains the values for each vertex or face
% - crd contains the vertex coordinates or face indices
% - idx contains vertex or face sequential index
%
% _
% Anderson M. Winkler
% Yale University / Institute of Living
% Aug/2011

% File name
fname = varargin{1};

% Get the actual data
crv = varargin{2}(:);
nX  = numel(crv);

% Check if all are integers and use appropriate formating
if all(mod(crv,1)==0),
fstr = '%d';
else
fstr = '%f';
end

if nargin == 2,

% Organise the data, fill the coords with zeros amd prep to save
crv = [(0:nX-1) ; zeros(3,nX) ; crv'];

elseif nargin == 4,

% Organise the coords
crd = varargin{3};
if size(crd,1) > size(crd,2),
crd = crd';
end

% Take the indices
idx = varargin{4}(:);

% Prepare to save
crv = [idx' ; crd ; crv'];

else
error('Incorrect number of arguments');
end

% Save
fid = fopen(fname,'w');
fprintf(fid,['%d %g %g %g ' fstr ' \n'],crv);
fclose(fid);
___
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.


[Freesurfer] mris_convert exporting parcellation per vertex

2011-10-08 Thread Pedro Paulo de Magalhães Oliveira Junior
I need to create a file where I have the parcellation value (structure name)
per vertex.

I've tried mris_convert --annot
/Applications/freesurfer/subjects/bert/label/lh.aparc.annot
/Applications/freesurfer/subjects/bert/surf/lh.pial parc.asc

But I get the error: ERROR: unknown file annot file type specified for
output: saida.asc

Has someone done this before?

Thanks
-
Pedro Paulo de Magalhães Oliveira Junior
Netfilter & SpeedComm Telecom
-- www.netfilter.com.br
-- For mobile: http://itunes.apple.com/br/artist/netfilter/id365306441
___
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.