Annotation Coordinates: Difference between revisions
No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
After the header row and the number of vertices in the file, the left-most column is the vertex number, and the three following columns are the x,y,z coordinates for that vertex. A reasonable value for the representative spatial location of that node can be obtained by calculating the mean x,y,z coordinate. | After the header row and the number of vertices in the file, the left-most column is the vertex number, and the three following columns are the x,y,z coordinates for that vertex. A reasonable value for the representative spatial location of that node can be obtained by calculating the mean x,y,z coordinate. | ||
== getSegCoords.m == | |||
A MATLAB script has been written to facilitate the calculation of mean segment coordinates. This script, <code>getSegCoords.m</code> can be found in the ubfs Scripts/Matlab folder. It takes a number of optional parameters, but if called without providing any parameters, you will be prompted to select specific files and folders that the script needs to complete its task. | |||
[xyz, hemi, segnames]=getSegCoords | |||
Called this way, without any parameters, the script will assume that the paired ''lh'' and ''rh'' files and directories have names that differ only with respect to the '?h' characters (by default, the ''automatch'' option is set to true). You will be prompted to first identify the label directory (i.e., the directory that contains the ''?h.segment_id.label'' files) for the left hemisphere. The right hemisphere directory will be figured out automatically. The function then calls parseFSSegments.m for each hemisphere, which requires you to identify the '*.sum.txt' files that contain the individual segment names. |
Revision as of 22:54, 21 June 2016
When visualizing spatial relationships among network nodes representing regions in surface space, it is necessary to assign each node a position in 3D space. The XYZ coordinates of each vertex associated with a label can be found in the corresponding .label files in the label/regenerated_?h_* directories that were generated when carrying out the Lausanne parcellation. For example, to calculate representative spatial locations for the labels in the 60 label parcellation, the associated label files are in label/regenerated_?h_60.
The .label files are plaintext, and are formatted as follows:
#!ascii label , from subject FS_T1_501 vox2ras=TkReg 1858 50139 -32.785 -24.134 19.744 0.0000000000 50148 -32.758 -24.176 19.440 0.0000000000 50149 -33.035 -24.591 18.914 0.0000000000 50157 -33.293 -24.616 18.023 0.0000000000 51159 -32.615 -23.587 20.632 0.0000000000 ... etc.
After the header row and the number of vertices in the file, the left-most column is the vertex number, and the three following columns are the x,y,z coordinates for that vertex. A reasonable value for the representative spatial location of that node can be obtained by calculating the mean x,y,z coordinate.
getSegCoords.m
A MATLAB script has been written to facilitate the calculation of mean segment coordinates. This script, getSegCoords.m
can be found in the ubfs Scripts/Matlab folder. It takes a number of optional parameters, but if called without providing any parameters, you will be prompted to select specific files and folders that the script needs to complete its task.
[xyz, hemi, segnames]=getSegCoords
Called this way, without any parameters, the script will assume that the paired lh and rh files and directories have names that differ only with respect to the '?h' characters (by default, the automatch option is set to true). You will be prompted to first identify the label directory (i.e., the directory that contains the ?h.segment_id.label files) for the left hemisphere. The right hemisphere directory will be figured out automatically. The function then calls parseFSSegments.m for each hemisphere, which requires you to identify the '*.sum.txt' files that contain the individual segment names.