|
Size: 1484
Comment:
|
Size: 1672
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| An annotation file contains labels of a surface, for example the sulci and gyri labels of a cortical surface. | An annotation file contains labels of a surface, for example the sulci and gyri labels of a cortical surface. It is usally found in the subject_identifier/label/ folder. There is a separate annotation for left and right hemisphere, e.g. ?h.aparc.annot == Overlay Annotation on Surface in Tksurfer == |
| Line 9: | Line 12: |
| Line 10: | Line 14: |
| Line 17: | Line 22: |
| ct.orig_tab = where original colortable was found (string). It's mainly for book-keeping | ct.orig_tab = location of riginal colortable (string). It's mainly for book-keeping |
| Line 21: | Line 26: |
| ct.table = ct.numEntries x 5 matrix. So row i describes the color and label of the ith structure. ct.table(1,j) specifies red color value of structure j (0 to 255). ct.table(2,j) specifies green color value of structure j (0 to 255). ct.table(3, j) specifies the blue color value of structure j (0 to 255). ct.table(4,j) is basically all zeros. Finally ct.table(5,j) = ct.table(1,j) + ct.table(2,j)*2^8 + ct.table(3,j)*2^16 + 0*2^24 = label given to structure j. | ct.table = ct.numEntries x 5 matrix. Row i describes the color and label of the ith structure. ct.table(1,j) specifies the red color value of structure j (0 to 255). ct.table(2,j) specifies the green color value of structure j (0 to 255). ct.table(3, j) specifies the blue color value of structure j (0 to 255). ct.table(4,j) is all zeros. Finally ct.table(5,j) = ct.table(1,j) + ct.table(2,j)*2^8^ + ct.table(3,j)*2^16^ + 0*2^24^ = label given to structure j. |
| Line 23: | Line 28: |
| Therefore if vertex i is labeled structure j. Then label(i) = ct.table(5, j). | Therefore if vertex i is labeled structure j. Then L(i) = ct.table(5, j). |
An annotation file contains labels of a surface, for example the sulci and gyri labels of a cortical surface. It is usally found in the subject_identifier/label/ folder. There is a separate annotation for left and right hemisphere, e.g. ?h.aparc.annot
Overlay Annotation on Surface in Tksurfer
Reading Into Matlab
[v, L, ct] = read_annotation(annotation_filename);
Suppose N is the number of vertices. Then,
v = N x 1 vector, v(i) = i-1 (you can usually ignore v)
L = N x 1 vector, L(i) = label of ith vertex of mesh
ct = colortable structure
What is a colortable?
The colortable matches the label with the structure name. It also gives color to each structure type for visualization in tksurfer. In matlab, the colortable structure can be dissected as follows.
ct.numEntries = # structures that are specified (scalar)
ct.orig_tab = location of riginal colortable (string). It's mainly for book-keeping
ct.struct_names = list of structure names (cell). The number of strings should be equal to the number of entries. For example, ct.struct_names{1} could be 'central sulcus'
ct.table = ct.numEntries x 5 matrix. Row i describes the color and label of the ith structure. ct.table(1,j) specifies the red color value of structure j (0 to 255). ct.table(2,j) specifies the green color value of structure j (0 to 255). ct.table(3, j) specifies the blue color value of structure j (0 to 255). ct.table(4,j) is all zeros. Finally ct.table(5,j) = ct.table(1,j) + ct.table(2,j)*28 + ct.table(3,j)*216 + 0*224 = label given to structure j.
Therefore if vertex i is labeled structure j. Then L(i) = ct.table(5, j).
