Hi, I'm not sure whether the --seg option ever got looked into, but for those searching the lists in the future, here is the quick hack I used in perl to accomplish what I wanted: mishkin
#! /usr/bin/perl if($ARGV <1){ print "\nUsage: $0 <subject_name>\n"; print "Assumes SUBJECTS_DIR is set, and mri_annotation2label is in your path\n"; print "WIll output ?h.annot.asc, which has the names of the parcellations, and\n" print "WIll output ?h.annot.txt, which has the number of the parcellations [1-35]\n" exit(1); } $name = $ARGV[0]; $DIR = $ENV{'SUBJECTS_DIR'}; @structures = qw(bankssts caudalanteriorcingulate caudalmiddlefrontal corpuscallosum cuneus entorhinal frontalpole fusiform inferiorparietal inferiortemporal isthmuscingulate lateraloccipital lateralorbitofrontal lingual medialorbitofrontal middletemporal paracentral parahippocampal parsopercularis parsorbitalis parstriangularis pericalcarine postcentral posteriorcingulate precentral precuneus rostralanteriorcingulate rostralmiddlefrontal superiorfrontal superiorparietal superiortemporal supramarginal temporalpole transversetemporal unknown); @sides = qw(lh rh); foreach $hemi(@sides){ my @master; system("mri_annotation2label --subject ${name} --hemi ${hemi} --outdir ${DIR}/${name}/label/"); $i=0; foreach $reg(@structures){ $i = $i+1; #index number of each label open(FIN,"${DIR}/${name}/label/${hemi}.${reg}.label"); $line = <FIN>; #header $line = <FIN>; #header while($line = <FIN>){ my @array = split(/ /,$line); my $vertex = $array[0]; #get the vertex number $master[${vertex}] = "${reg} $i"; } close(FIN); } open(FASC,"> ${DIR}/${name}/label/${hemi}.annot.asc"); open(FTXT,"> ${DIR}/${name}/label/${hemi}.annot.txt"); foreach $element(@master){ my @array = split(/ /,$element); print FASC "$array[0]\n"; #names print FTXT "$array[1]\n"; #number } close(FASC); close(FTXT); } On Thu, Nov 5, 2009 at 9:14 PM, Mishkin Derakhshan <mishk...@gmail.com> wrote: > Hi Nick, > I was recently trying to redo something you had helped me out with > back in April (see below), but I now get this error: > ERROR: Option --seg unknown > > The wiki page still says this option exists, but I'm guessing is outdated > https://surfer.nmr.mgh.harvard.edu/fswiki/mri_annotation2label#Detailsfor.27seg.27outputfilelabelnumbers > > Was this option deprecated at some point? Could you send me a version > where this works, or is there another way, I can get what I'm after: > >>> to somehow get the contents of >>> ?h.aparc.annot into ascii form. I know mris_annotation2label will kind >>> of do this, but it creates one file for every label. What I'm loooking >>> for is a single file with n rows corresponding to the n vertices in >>> ?h.pial, and then next to each one, a number representing what label >>> it belongs to (or what value to look up in the LUT). > > thanks, > mishkin > > On Wed, Apr 8, 2009 at 4:19 PM, Nick Schmansky > <ni...@nmr.mgh.harvard.edu> wrote: >> Mishkin, >> >> This will create what you want: >> >> cd subj/label >> mri_annotation2label --subject subj \ >> --hemi lh \ >> --annotation aparc \ >> --seg lh.aparc.mgh >> >> replacing subj and lh with appropriate. >> >> then type: >> >> mris_convert -c ./lh.aparc.mgh \ >> ../surf/lh.white \ >> lh.aparc.asc >> >> and the output file (lh.aparc.asc) will have lines like this: >> >> 71586 -39.60123 -13.37572 -34.24242 1007.00000 >> >> which are: >> >> vno X Y Z labelno >> >> where labelno is found in $FREESURFER_HOME/FreeSurferColorLUT.txt, for >> instance 1007 is ctx-lh-fusiform >> >> Nick >> >> >> >> On Tue, 2009-04-07 at 17:00 -0400, Mishkin Derakhshan wrote: >>> Thanks. After reading up on the wiki it seems that a more general >>> solution I'm loking for would be to somehow get the contents of >>> ?h.aparc.annot into ascii form. I know mris_annotation2label will kind >>> of do this, but it creates one file for every label. What I'm loooking >>> for is a single file with n rows corresponding to the n vertices in >>> ?h.pial, and then next to each one, a number representing what label >>> it belongs to (or what value to look up in the LUT). >>> can this be done somehow, or at the very least can I get the contents >>> of ?h.*.annot into ascii format so I can manipulate things. >>> >>> thanks, >>> mishkin >>> >>> >>> On Tue, Apr 7, 2009 at 1:05 PM, Bruce Fischl <fis...@nmr.mgh.harvard.edu> >>> wrote: >>> > Hi Mishkin, >>> > >>> > yes, the ?h.cortex.label should be created for every subject that labels >>> > the >>> > cortical regions of the surface. >>> > >>> > cheers, >>> > Bruce >>> > On Tue, 7 Apr 2009, Mishkin Derakhshan wrote: >>> > >>> >> Hello list, >>> >> I would like to create a mask on fsaverage/surf/?h.pial that masks out >>> >> the areas where the surface does not follow the cortex, but is just >>> >> cutting across the mid line or across the brain stem. I know >>> >> Freesurfer does this to maintain the surface toplogy, and I think it >>> >> only does this in these two areas. >>> >> Does a simple txt file with n vertices and a 0 or 1 value at each >>> >> vertex exist somewhere? Has anyone on the list bothered to label this >>> >> area manually and would be willing to share? >>> >> thanks, >>> >> mishkin >>> >> _______________________________________________ >>> >> 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 >>> >>> >> >> > _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer