2012-02-18

PySurfer returns annotation labels from 0 to 35

I lately started using PySurfer to read FreeSurfer Annotation files. The function I use is read_annot() in io.py

If you are using the same function, please note that, by default (orig_ids=False), labels returned by this function range from 0 to 35, instead of 1 to 36. It does NOT really return labels, which are big numbers in the central column below, but their indexes in C or Python way (not MATLAB way!).

read_annot returns Labels in a .annot filemeaning
0
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
0
1639705
2647065
10511485
6500
3294840
6558940
660700
9231540
14433500
7874740
9180300
9182740
3296035
9211105
4924360
3302560
3988500
3988540
9221340
3302420
1326300
3957880
1316060
14464220
14423100
11832480
9180240
8204875
10542100
9221140
14474380
1351760
6553700
11146310
13145750
2146559
'unknown'    
'unknown'    
'bankssts'   
'caudalanteriorcingulate'
'caudalmiddlefrontal'
'corpuscallosum'
'cuneus'     
'entorhinal' 
'fusiform'   
'inferiorparietal'
'inferiortemporal'
'isthmuscingulate'
'lateraloccipital'
'lateralorbitofrontal'
'lingual'    
'medialorbitofrontal'
'middletemporal'
'parahippocampal'
'paracentral'
'parsopercularis'
'parsorbitalis'
'parstriangularis'
'pericalcarine'
'postcentral'
'posteriorcingulate'
'precentral' 
'precuneus'  
'rostralanteriorcingulate'
'rostralmiddlefrontal'
'superiorfrontal'
'superiorparietal'
'superiortemporal'
'supramarginal'
'frontalpole'
'temporalpole'
'transversetemporal'
'insula'

I looked at the source code of the function read_annot. There may be a potential problem. Sometimes, people use 0 instead of 1639705 to mark unknown vertexes in .annot files. But read_annot won't distinguish the two as it will return the same value 0.

No comments: