Hi Feng,
there's an update matlab reader that also extracts the color table, contributed by Thomas Yeo. I've attached it if you're interested.
cheers, Bruce
On Mon, 21 Aug 2006, fshi wrote:
Hi Dr. Bruce Fischl,
I subscribe this mailing list form july. I'm glad to answer some questions if I know.
I think I find the way how color table correspond to the big numbers in annot files. Just translate the three color values from decimal to binary like 00001111, and put them together, and then translate the number back to decimal, now you can get the numbers read form annot files.
The correspondance between color table and numbers in annot files: (for example: 1 G_cingularis 25 60 60 3947545) comments: ~~~index ~~~~~~~~~~RGB color ~~~~~~~numbers computed by color used in annot files instead of color
0 Unknown 0 0 0 0 1 G_cingularis 25 60 60 3947545 2 G_cuneus 180 20 20 1316020 3 G_frontalis_inf-pars_opercularis 220 20 100 6558940 4 G_frontalis_inf-pars_orbitalis 140 60 60 3947660 5 G_frontalis_inf-pars_triangularis 180 220 140 9231540 6 G_frontalis_medius 140 100 180 11822220 7 G_frontalis_sup-pars_lateralis 180 20 140 9180340 8 G_frontalis_sup-pars_medialis 180 140 100 6589620 9 G_frontomarginalis 140 20 140 9180300 10 G_hippocampi 25 180 20 1356825 11 G_insularis_breves 225 140 140 9211105 12 G_occipitalis_inf 140 220 100 6610060 13 G_occipitalis_medius-pars_inf 180 60 180 11812020 14 G_occipitalis_medius-pars_sup 180 60 180 11812020 15 G_occipitalis_sup 20 220 60 3988500 16 G_lateralis 60 20 140 9180220 17 G_lingualis 220 180 140 9221340 18 G_parahippocampi 65 100 20 1336385 19 G_orbitalis 220 60 20 1326300 20 G_paracentralis 60 100 60 3957820 21 G_parietalis_inf-pars_angularis 20 60 220 14433300 22 G_parietalis_inf-pars_supramarginalis 100 100 60 3957860 23 G_parietalis_sup 220 180 220 14464220 24 G_postcentralis 20 180 140 9221140 25 G_precentralis 60 140 180 11832380 26 G_precuneus 25 20 140 9180185 27 G_rectus_and_S_orbitalis_medialis 20 60 100 6568980 28 G_rectus_and_S_orbitalis_medialis2 20 60 100 6568980 29 G_subcentralis 60 20 220 14423100 30 G_supracingularis 145 220 220 14474385 31 G_temporalis_transversalis 225 60 60 3947745 32 G_temporalis_inf 220 220 100 6610140 33 G_temporalis_medius 180 60 60 3947700 34 G_temporalis_sup-pars_lateralis 220 60 220 14433500 35 G_temporalis_sup-planum_polare 60 220 60 3988540 36 G_temporalis_sup-planum_temporale 20 140 20 1346580 37 Plica_falciformis 141 220 100 6610061 38 Polus_occipitalis 140 20 60 3937420 39 Polus_temporalis 220 180 20 1357020 40 S_temporalis_transversalis 221 60 60 3947741 42 S_angularis 181 20 20 1316021 43 S_calcarinus 61 180 180 11842621 44 S_centralis_insulae_&_G_insularis_longus 21 220 20 1367061 46 S_centralis 221 20 20 1316061 47 S_cingularis 181 100 20 1336501 48 S_cingularis-pars_marginalis 221 20 100 6558941 49 S_circularis_insulae_ant 221 60 140 9190621 50 S_circularis_insulae_inf 221 20 220 14423261 51 S_circularis_insulae_sup 61 220 220 14474301 52 S_corpori_callosi 181 220 20 1367221 53 S_diagonalis 21 60 20 1326101 54 S_frontalis_inf 221 220 20 1367261 55 S_frontalis_medialis 141 60 60 3947661 56 S_frontalis_medius 141 20 100 6558861 57 S_frontalis_sup 61 220 100 6609981 58 S_frontomarginalis 21 220 60 3988501 59 S_intermedius_primus 141 60 20 1326221 60 S_intermedius_secundus 141 100 100 6579341 61 S_intracingularis 181 60 20 1326261 62 S_intraoccipitalis_medius 141 140 20 1346701 63 S_intraoccipitotemporalis_lateralis 221 180 180 11842781 64 S_intraparietalis 141 20 220 14423181 65 S_lateralis-pars_ant-ramus_horizontalis 61 20 220 14423101 66 S_lateralis-pars_ant-ramus_verticalis 61 20 60 3937341 67 S_lateralis-pars_horizontalis 101 100 220 14443621 68 S_lateralis-pars_post 61 60 100 6569021 69 S_lunatus 141 180 100 6599821 70 S_occipitalis_ant 61 20 180 11801661 71 S_occipitalis_inf 21 60 180 11811861 72 S_occipitalis_medius 101 60 220 14433381 73 S_occipitalis_sup 21 20 140 9180181 74 S_occipitalis_transversalis 61 20 20 1315901 75 S_occipitopolaris 201 240 60 3993801 76 S_occipitotemporalis_lateralis 221 140 20 1346781 77 S_occipitotemporalis_medialis 141 100 220 14443661 78 S_orbitales 101 20 20 1315941 79 S_orbitalis_lateralis 221 100 20 1336541 80 S_paracalcarinus 221 140 100 6589661 81 S_paracentralis 21 180 140 9221141 82 S_parietalis_transversalis 181 100 60 3957941 83 S_parieto_occipitalis 101 100 180 11822181 84 S_postcentralis 21 140 220 14453781 85 S_precentralis 21 20 220 14423061 86 S_retrocalcarinus 21 100 20 1336341 87 S_rhinalis 221 100 100 6579421 88 S_subcentralis_ant_&_post_ 61 180 60 3978301 89 S_suborbitalis 21 20 60 3937301 90 S_subparietalis 101 60 60 3947621 91 S_supracingularis 21 220 220 14474261 92 S_temporalis_inf 21 180 180 11842581 93 S_temporalis_sup 221 220 60 3988701 94 S_triangularis 181 140 140 9211061
The way read annot files with matlab (taken from archives of this maillist)
function [annots] = read_annotation(fname) % % [annots] = read_annotation(fname) % reads a binary annotation file into a vector % % open it as a big-endian file fid = fopen(fname, 'rb', 'b') ; if (fid < 0) str = sprintf('could not open annotation file %s.', fname) ; error(str) ; end vnum = fread(fid, 1, 'int32') ; tmp = fread(fid, vnum*2, 'int') ; annots = tmp(2:2:vnum*2) ;
fclose(fid) ;
Hope it useful.
Feng Shi, Automation Institute,Chinese Academy of Sciences,Beijing,China ======= 2006-07-25 09:13:28 =======
Hi Neel,
the .annot files should have the color table embedded in them precisely to avoid this type of confusion. I think Doug has a tool for extracting the color table from the .annot file, don't you Doug?
cheers, Bruce
On Mon, 24 Jul 2006, Neel Kishan wrote:
surface_labels.txt has 94 ROIs in contrast to the 81 in Simple_surface_labels2005.txt, and it does not seem to match the numbering system I find in SUMA. Does this file indicate that there is another parcellating method to identify 94 ROIs?
Nick Schmansky wrote:
Simple_surface_labels2005.txt was the older name. It is now called:
surface_labels.txt
and is found in $FREESURFER_HOME. Sorry!
On Mon, 2006-07-24 at 15:47 -0500, Neel Kishan wrote:
Thanks for the information. Please note that Simple_surface_labels2005.txt was not distributed in v3.0.3 for Mac OS X Tiger.
To convert an annot file to roi file for SUMA the following lines can be used for each hemisphere:
FSread_annot -input $SUBJECTS_DIR/subject/label/rh.aparc.a2005s.annot -roi_1D rh.aparc.a2005s.1D.roi FSread_annot -input $SUBJECTS_DIR/subject/label/rh.aparc.annot -roi_1D rh.aparc.1D.roi
The following list corresponds with SUMA's labeling of the first roi file: 3 G_cingulate-Isthmus 4 G_cingulate-Main_part 5 G_cuneus 6 G_frontal_inf-Opercular_part 7 G_frontal_inf-Orbital_part 8 G_frontal_inf-Triangular_part 9 G_frontal_middle 10 G_frontal_superior 11 G_frontomarginal 12 G_insular_long 13 G_insular_short 14 G_and_S_occipital_inferior 15 G_occipital_middle 16 G_occipital_superior 17 G_occipit-temp_lat-Or_fusiform 18 G_occipit-temp_med-Lingual_part 19 G_occipit-temp_med-Parahippocampal_part 20 G_orbital 21 G_paracentral 22 G_parietal_inferior-Angular_part 23 G_parietal_inferior-Supramarginal_part 24 G_parietal_superior 25 G_postcentral 26 G_precentral 27 G_precuneus 28 G_rectus 29 G_subcallosal 30 G_subcentral 31 G_temporal_inferior 32 G_temporal_middle 33 G_temp_sup-G_temp_transv_and_interm_S 34 G_temp_sup-Lateral_aspect 35 G_temp_sup-Planum_polare 36 G_temp_sup-Planum_tempolare 37 G_and_S_transverse_frontopolar 38 Lat_Fissure-ant_sgt-ramus_horizontal 39 Lat_Fissure-ant_sgt-ramus_vertical 40 Lat_Fissure-post_sgt 41 Medial_wall 42 Pole_occipital 43 Pole_temporal 44 S_calcarine 45 S_central 46 S_central_insula 47 S_cingulate-Main_part_and_Intracingulate 48 S_cingulate-Marginalis_part 49 S_circular_insula_anterior 50 S_circular_insula_inferior 51 S_circular_insula_superior 52 S_collateral_transverse_ant 53 S_collateral_transverse_post 54 S_frontal_inferior 55 S_frontal_middle 56 S_frontal_superior 57 S_frontomarginal 58 S_intermedius_primus-Jensen 59 S_intraparietal-and_Parietal_transverse 60 S_occipital_anterior 61 S_occipital_middle_and_Lunatus 62 S_occipital_superior_and_transversalis 63 S_occipito-temporal_lateral 64 S_occipito-temporal_medial_and_S_Lingual 65 S_orbital-H_shapped 66 S_orbital_lateral 67 S_orbital_medial-Or_olfactory 68 S_paracentral 69 S_parieto_occipital 70 S_pericallosal 71 S_postcentral 72 S_precentral-Inferior-part 73 S_precentral-Superior-part 74 S_subcentral_ant 75 S_subcentral_post 76 S_suborbital 77 S_subparietal 78 S_supracingulate 79 S_temporal_inferior 80 S_temporal_superior 81 S_temporal_transverse
The second file corresponds with the following list: 0 unknown/unlabeled 1 bankssts 2 caudalanteriorcingulate 3 caudalmiddlefrontal 4 corpuscallosum 5 cuneus 6 entorhinal 7 fusiform 8 inferiorparietal 9 inferiortemporal 10 isthmuscingulate 11 lateraloccipital 12 lateralorbitofrontal 13 lingual 14 medialorbitofrontal 15 middletemporal 16 parahippocampal 17 paracentral 18 parsopercularis 19 parsorbitalis 20 parstriangularis 21 pericalcarine 22 postcentral 23 posteriorcingulate 24 precentral 25 precuneus 26 rostralanteriorcingulate 27 rostralmiddlefrontal 28 superiorfrontal 29 superiorparietal 30 superiortemporal 31 supramarginal 32 frontalpole 33 temporalpole 34 transversetemporal
Jenni Pacheco wrote:
Hi Neel,
You could refer to the surface label files that should be in your $FREESURFER_HOME directory. I believe that the $FREESURFER_HOME/Simple_surface_labels2005.txt corresponds with aparc.a2005s.annot parcellations and the $FREESURFER_HOME/average/colortable_desikan_killiany.txt corresponds with the aparc.annot parcellations.
Jenni
On Mon, 24 Jul 2006, Neel Kishan wrote:
> Hi List, > > Thanks for providing the mris_ca_label program and the two papers from > 2004 and 2006. I'm using AFNI's FSread_annot to read the aparc.annot and > aparc.a2005s.annot files into SUMA. The ROIs are imported numbered 0 to > 34 for the aparc.annot files and 0 to 81 for the aparc.a2005s.annot > files. I can see that the aparc.annot files correspond to the 2006 > Desikan et al. paper, but I'm not sure how they were ordered in the > annot file. I'm also wondering how the aparc.a2005s.annot files > identified and ordered the ROIs. > > Thanks for your help, > Neel Kishan > _______________________________________________ > 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
= = = = = = = = = = = = = = = = = = = = Feng Shi, Ph.D. Candidate Medical Imaging and Computing Group National Laboratory of Pattern Rcognition Automation Institute,Chinese Academy of Sciences Beijing, 100080 +86-10-62659278(Office) fshi@nlpr.ia.ac.cn
freesurfer@nmr.mgh.harvard.edu