hi Doug, I am sorry but I still don't get it.
If: label vector lookup of annotation values for corresponding vertex index. and label contains some 0 and 0 is not a valid id in colortable.table(:, 5) what should I do with my vertices whose label is 0? thanks Alex On Mon, Aug 26, 2013 at 11:52 PM, Douglas N Greve <gr...@nmr.mgh.harvard.edu> wrote: > ah, the newer version has a lot more info. See if this answers your question > doug > > help read_annotation > NAME > > function [vertices, label, colortable] = ... > read_annotation(filename [, > verbosity]) > > ARGUMENTS > INPUT > filename string name of annotation file to read > > OPTIONAL > verbosity int if true (>0), disp running output > + if false (==0), be quiet and do > not > + display any running output > > OUTPUT > vertices vector vector with values running from 0 to > + size(vertices)-1 > label vector lookup of annotation values for > + corresponding vertex index. > colortable struct structure of annotation data > + see below > > DESCRIPTION > > This function essentially reads in a FreeSurfer annotation file > <filename> and returns structures and vectors that together > assign each index in the surface vector to one of several > structure names. > > COLORTABLE STRUCTURE > > Consists of the following fields: > o numEntries: number of entries > o orig_tab: filename of original colortable file > o struct_names: cell array of structure names > o table: n x 5 matrix > Columns 1,2,3 are RGB values for struct color > Column 4 is a flag (usually 0) > Column 5 is the structure ID, calculated from > R + G*2^8 + B*2^16 + flag*2^24 > > LABEL VECTOR > > Each component of the <label> vector has a structureID value. To > match the structureID value with a structure name, lookup the row > index of the structureID in the 5th column of the colortable.table > matrix. Use this index as an offset into the struct_names field > to match the structureID with a string name. > > PRECONDITIONS > > o <filename> must be a valid FreeSurfer annotation file. > > POSTCONDITIONS > > o <colortable> will be an empty struct if not embedded in a > FreeSurfer annotation file. > > > On 08/26/2013 05:35 PM, Alexandre Gramfort wrote: >> >> hi doug, >> >> I thought so. Did I miss something obvious? My version is: >> >> % read_annotation.m >> % Original Author: Bruce Fischl >> % CVS Revision Info: >> % $Author: nicks $ >> % $Date: 2011/03/02 00:04:12 $ >> % $Revision: 1.7 $ >> >> doc says: >> >> colortable : Column 5 is the structure ID >> >> Each component of the <label> vector has a structureID value. >> >> Why do I get 0 in label if 0 is not in colortable.table(:, end)? >> >> thanks >> Alex >> >> On Mon, Aug 26, 2013 at 10:06 PM, Douglas N Greve >> <gr...@nmr.mgh.harvard.edu> wrote: >>> >>> Hi Alex, have you looked at the read_annotation help? >>> doug >>> >>> >>> >>> >>> On 08/26/2013 03:37 PM, Alexandre Gramfort wrote: >>>> >>>> hi, >>>> >>>> when trying to read the following .annot file: >>>> >>>> >>>> https://dl.dropboxusercontent.com/u/2140486/annot_pb/left_mc-z.negative.sig.ocn.annot >>>> >>>> using the following matlab code: >>>> >>>> -- >>>> [vertices, label, colortable] = >>>> read_annotation('left_mc-z.negative.sig.ocn.annot'); >>>> unique(label) >>>> unique(colortable.table(:, end)) >>>> setdiff(colortable.table(:, end), unique(label)) >>>> -- >>>> >>>> there seem to be a discrepancy between the "label" and the last column >>>> of colortable "colortable.table(:, end)" >>>> >>>> the script outputs: >>>> >>>> -- >>>> Reading from version 2 >>>> colortable with 7 entries read (originally none) >>>> ans = >>>> 0 2244856 3987639 5840816 11298645 >>>> 13698134 16665710 >>>> ans = >>>> 2244856 3834223 3987639 5840816 11298645 >>>> 13698134 16665710 >>>> ans = >>>> 3834223 >>>> -- >>>> >>>> in other words 0 is in label but not in the colortable. Should I >>>> conclude that 0 is 3834223? >>>> If so what's the proper way of figuring this out? >>>> >>>> thanks >>>> Alex >>>> _______________________________________________ >>>> Freesurfer mailing list >>>> Freesurfer@nmr.mgh.harvard.edu >>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer >>>> >>>> >>> -- >>> Douglas N. Greve, Ph.D. >>> MGH-NMR Center >>> gr...@nmr.mgh.harvard.edu >>> Phone Number: 617-724-2358 >>> Fax: 617-726-7422 >>> >>> Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting >>> FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2 >>> www.nmr.mgh.harvard.edu/facility/filedrop/index.html >>> Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/ >>> >>> _______________________________________________ >>> 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. >>> >> > > -- > Douglas N. Greve, Ph.D. > MGH-NMR Center > gr...@nmr.mgh.harvard.edu > Phone Number: 617-724-2358 > Fax: 617-726-7422 > > Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting > FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2 > www.nmr.mgh.harvard.edu/facility/filedrop/index.html > Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/ > _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer