Caret File Formats

File Header


The optional File Header is at the beginning of a data file.  The header data is begins with the line"BeginHeader" and ends with the line "EndHeader".

Valid Header Tags are:

File Types


Topo File

The three vertices of a tile are oriented in a counter-clockwise direction (if you look at a tile and its vertices are oriented in a counter-clockwise order, you are looking at the outside of the surface).

Text (Ascii) format topology file

tag-version 1
M, Number of Tiles
For each tile
   Tile-Node-1 Tile-Node-2 Tile-Node-3
EXAMPLE:
---------
tag-version 1
103845       <----- Number of tiles
23 1 0         <----- Firsttile
23 2 1
2 23 24


Binary format topology file (ALWAYS BIG-ENDIAN BYTE ORDER)

tag-version 1
<4-byte-integer-number-of-tiles><3 4-byte-integers-per-tile>

OLD TOPOLOGY FORMAT

NOTE: OLD topology format orients tiles in clockwise order.

N, Number of Nodes
For each node:
   Node-Num  Num-Neighbors  Section-Num  Contour-Num  Node  Category
   For each neighbor
      Neighbor-Number  Neighbor-Node-Number
M, Number of Tiles
For each tile
   Tile-Node-1 Tile-Node-2 Tile-Node-3
EXAMPLE:
---------
53833
0 8 0 0 0 0
0 2
1 18
2 19
3 20
4 21
5 22
6 23
7 1
1 3 0 0 1 0
0 0
1 23
2 2
...
53832 7 79 2 634 0
0 53831
1 39827
2 39828
3 39230
4 38572
5 38571
6 38570      <----- End of Node Neighbors
103845       <----- Number of tiles
23 1 0         <----- First tile
23 2 1
2 23 24



 

Coord File

Text (Ascii) format coord file


N, number of nodes
for each node  in the surface
   Node-Number  X  Y  Z  (1 integer and 3 floating point values per line)
EXAMPLE:
---------
53833
0 45.645950 55.080276 0.000000
1 45.173611 54.943596 0.000000
2 45.766182 54.084949 0.000000
...


Binary format coord file (always BIG-ENDIAN byte order)

<4-byte-integer-number-of-coordinates><3 32-bit-floating-point-numbers-per-coordinate>
 



 

Latitude Longitude File

N, number of nodes
for each node in the surface
   Node-Number Lat Lon DefLat DefLon (1 integer and 2 or 4 floating point values per line)
If the deformed latitude/longitude values (DefLat, DefLon) are not present, they are assumed to be zero.

EXAMPLE
--------
53833
0 39.523875 -74.893285
1 -47.983402 25.892302
...



 

Area Color File

The red, green, and blue components are specified in the integer range 0 - 255.  The area color file consists of:
color-name-1  red  green  blue
color-name-2  red  green  blue
...
EXAMPLE:
---------
SULCUS 150 150 150
GYRAL 220 220 220
LOBE.OCCIPITAL 255 200 200



 

Paint File

Paint File version 0
Paint-Index-0  Paint-Name-0
Paint-Index-1  Paint-Name-1
...
N, number of Nodes
for each node:
   Node-Number  L  G  F  B  M
where:
   L =  Lobe Assignment Paint Index
   G = Geography Assignment Paint Index
   F =  Functional Assignment Paint Index
   B = Brodmann Assignment Paint Index
   M = Modality Assignment Paint Index

EXAMPLE:
---------
0 ???
1 LOBE.FRONTAL
2 GYRAL
3 BROD.8
0 1 2 0 3 0
1 1 2 0 3 0
2 1 2 0 3 0
...
 

Paint File Version 1

This version of the paint file does not place a restriction on the number of columns and the columns also may have names assigned to them.  As os 04/05/2002, Caret will load a maximum of 15 columns.

tag-version 1
tag-number-of-nodes 71723
tag-number-of-columns 5
tag-title 
tag-number-of-paint-names 148
tag-column-name 0 Lobes
tag-column-name 1 Geography
tag-column-name 2 Functional Stuff
tag-column-name 3 Brodmann
tag-column-name 4 Modality
tag-BEGIN-DATA
0 ???
1 SUL
2 DEEP_SUL
...
147 AREA.MTplus
0 58 0 0 100 42
1 58 0 0 100 42
2 58 0 0 82 134
...
71722 21 0 0 0 128


 

Areal Estimation File

tag-file-version 1
tag-comment a-comment
tag-long-name   long-name
tag-short-name   short-name
tag-BEGIN-DATA
Number of Paint Names
Paint-Index-0  Paint-Name-0
Paint-Index-1  Paint-Name-1
...
Number of Nodes
for each node
   Node-Number  N1  P1  N2  P2  N3  P3  N4  P4

where:
  N1 = Index into Paint Names
  P1  = Probability Node is in area "N1"
  etc.

EXAMPLE:
---------

tag-file-version 1
tag-comment This is the comment. 
tag-long-name The John Harwell partitioning system
tag-short-name JWH
tag-BEGIN-DATA
78
0 ???
1 FVE.ER
2 FVE.35
3 FVE.36
...
77 FVE.LIP
35946
0 1 0.568776 2 0.431079 3 0.000072 4 0.000072
1 1 0.672723 2 0.327121 3 0.000078 4 0.000078
2 1 0.715376 2 0.284492 3 0.000066 4 0.000066
...
35945 23 0.926345 21 0.024552 22 0.024552 76 0.024552
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


RGB Paint File Version 0


Each line contains an RGB triplet where each component is an integer in the range of 0 - 255.

Red  Green  Blue
Red  Green  Blue
...
EXAMPLE:
---------
152 229 0
149 229 0
149 229 0



 

RGB Paint File Version 1


Because of the possibility of more tags in the future, any programs reading a RGB Paint file should ignore tags that it does not recognize.  Three tags are required: "tag-number-of-nodes", "tag-number-of-columns", and "tag-BEGIN-DATA".  "tag-BEGIN-DATA" must always be the last tag and followed by the RGB paint data.  Caret always writes RGB Paint files using the version 1 format.

The RGB data values for each node may be positive or negative numbers.  The "scale" specifies the negative color that maps to -255 and the postive color that maps to 255.

EXAMPLE:
---------
tag-version 1
tag-number-of-nodes 71723
tag-title The title string
tag-comment-red  red comment
tag-comment-green  green comment
tag-comment-blue blue comment
tag-title-red red title
tag-title-green green title
tag-title-blue blue title
tag-scale-red -1.100000 2.200000
tag-scale-green -3.300000 84.400000
tag-scale-blue -105.500000 196.600000
tag-BEGIN-DATA
0 0.000000 0.000000 0.000000
1 0.000000 0.000000 0.000000
2 0.566571 4.984852 0.000000
3 0.000000 4.997793 -76.333336
4 0.661000 5.079529 -184.000000
...



 

Metric File - Version 2


Because of the need for additional tags, and the possibility of even more tags in the future, the metric file format was again revised.  Any programs reading a metric file should ignore tags that it does not recognize.  Three tags are required: "tag-number-of-nodes", "tag-number-of-columns", and "tag-BEGIN-DATA".  "tag-BEGIN-DATA" must always be the last tag and followed by the metric data.  Caret always writes metric files using the version 2 format.

EXAMPLE:
---------
metric-version 2
tag-number-of-nodes 71723
tag-number-of-columns 2
tag-title untitled
tag-column-name 0 Depth
tag-column-name 1 Smoothed Depth
tag-column-color-mapping 0 -1.000000 1.000000
tag-BEGIN-DATA
0 1.803019 -0.045549
1 1.704132 -0.007309
2 1.523951 0.026103
...
71722 .822899  0.112485
 
 

Metric File - Version 1


Note: The version 1 Metric file has several improvements over the original metric file.  The first line in the metric file indicates that it is a version 1 metric file.  The second line tells how many nodes (N) and the number of metrics per node (M).   This is followed by titles for each metric of the M metrics.  Following the titles are the metrics for each node.  There is no limit to the number of metrics per node.

metric-version  1
number-of-nodes  number-of-metrics-per-node
user_defined-minimum  user-defined-maximum
metric-1-title
...
metric-M-title
Node-Number-0      float-node-0-metric-value-1    float-node-0-metric-value-2    ...
Node-Number-1      float-node-1-metric-value-1    float-node-1-metric-value-2    ...
Node-Number-(N-1)  float-node-N-1-metric-value-1  float-node-N-1-metric-value-2  ...
EXAMPLE: 9 nodes, 3 metrics per node
---------
metric-version 1
9   3
fmri
case-2
case-3
0 0.3 0.7 0.4
1 0.8 0.6 0.3
...
8 0.7 1.1 1.2


Metric File - original version

Note: There must be at least one metric value and there is no limit on the number of metric values for each node.  All nodes must have the same number of metric values.
Node-Number-0  float-Metric-Value-1 float-Metric-Value-2 ...
Node-Number-1  float-Metric-Value-1 float-Metric-Value-2 ...
...
EXAMPLE:
---------
0 100.1 201.3
1 79.23 79.4
2 237.4 37.1



 

Atlas File

Paint-Index-0  Paint-Name-0
Paint-Index-1  Paint-Name-1
...
N, number of Nodes
for each node 
   Node-Number  A  B  C  D  E
where A, B, C, D, E are the probabilistic identifications for a node

EXAMPLE:
---------
0 ???
1 ARCH.LIPv
2 ARCH.MIP
...
27857
0 0 2 2 2 3
1 2 2 3 2 0
2 3 3 3 0 0
 



 

Palette File


Palette files are in AFNI format.

A color can be defined in one of three ways

  1. As a 6 digit hexadecimal number where each two digits are Red, Green, and Blue(#ffcc87).
  2. As intensities for Red, Green, and Blue in the range 0.0 to 1.0 (rgbi:/0.0/0.7/1.0).
  3. As X color names typically found in /usr/lib/X11/rgb.txt
EXAMPLE:
-------
***COLORS
  rbgyr20_01 = #cc1033
  rbgyr20_02 = #992066
  rbgyr20_03 = #663199
  rbgyr20_04 = #3441cc
  rbgyr20_05 = #0051ff
  rbgyr20_06 = #0074cc
  rbgyr20_07 = #009799
  rbgyr20_08 = #00b966
  rbgyr20_09 = #00dc33
  rbgyr20_10 = #00ff00
  rbgyr20_11 = #33ff00
  rbgyr20_12 = #66ff00
  rbgyr20_13 = #99ff00
  rbgyr20_14 = #ccff00
  rbgyr20_15 = #ffff00
  rbgyr20_16 = #ffcc00
  rbgyr20_17 = #ff9900
  rbgyr20_18 = #ff6600
  rbgyr20_19 = #ff3300
  rbgyr20_20 = #ff0000
  gray_0 = #ffffff
  gray_1 = #e6e6e6
  gray_2 = #cdcdcd
  gray_3 = #b4b4b4
  gray_4 = #9b9b9b
  gray_5 = #828282
  gray_6 = #696969
  gray_7 = #505050
  gray_8 = #373737
  gray_9 = #1e1e1e
  white = #ffffff
  black = #000000

***PALETTES RBGYR20 [20]
  1.000000 -> rbgyr20_01
  0.900000 -> rbgyr20_02
  0.800000 -> rbgyr20_03
  0.700000 -> rbgyr20_04
  0.600000 -> rbgyr20_05
  0.500000 -> rbgyr20_06
  0.400000 -> rbgyr20_07
  0.300000 -> rbgyr20_08
  0.200000 -> rbgyr20_09
  0.100000 -> rbgyr20_10
  0.000000 -> rbgyr20_11
  -0.100000 -> rbgyr20_12
  -0.200000 -> rbgyr20_13
  -0.300000 -> rbgyr20_14
  -0.400000 -> rbgyr20_15
  -0.500000 -> rbgyr20_16
  -0.600000 -> rbgyr20_17
  -0.700000 -> rbgyr20_18
  -0.800000 -> rbgyr20_19
  -0.900000 -> rbgyr20_20

***PALETTES RBGYR20 [20+]
  1.000000 -> rbgyr20_01
  0.950000 -> rbgyr20_02
  0.900000 -> rbgyr20_03
  0.850000 -> rbgyr20_04
  0.800000 -> rbgyr20_05
  0.750000 -> rbgyr20_06
  0.700000 -> rbgyr20_07
  0.650000 -> rbgyr20_08
  0.600000 -> rbgyr20_09
  0.550000 -> rbgyr20_10
  0.500000 -> rbgyr20_11
  0.450000 -> rbgyr20_12
  0.400000 -> rbgyr20_13
  0.350000 -> rbgyr20_14
  0.300000 -> rbgyr20_15
  0.250000 -> rbgyr20_16
  0.200000 -> rbgyr20_17
  0.150000 -> rbgyr20_18
  0.100000 -> rbgyr20_19
  0.050000 -> rbgyr20_20

***PALETTES Gray [10]
  1.000000 -> gray_0
  0.800000 -> gray_1
  0.600000 -> gray_2
  0.400000 -> gray_3
  0.200000 -> gray_4
  0.000000 -> gray_5
  -0.200000 -> gray_6
  -0.400000 -> gray_7
  -0.600000 -> gray_8
  -0.800000 -> gray_9

***PALETTES Gray Interp [2]
  1.000000 -> white
  -1.000000 -> black
 
 



 

Activation File

Number of Activation Sets
Set-Index Number-of-Activations-In-Set Activation-Set-Name
Node-Number-1-Index X Y Z Activation-Scalar
Node-Number-2-Index X Y Z Activation-Scalar
Node-Number-3-Index X Y Z Activation-Scalar
EXAMPLE:
---------
1
0 100 positive
0 110.913010 64.886406 0.000000 0.196717
1 110.870270 65.581619 0.000000 0.221988
2 112.250961 65.365349 0.000000 0.212895
3 92.779503 73.672401 0.000000 0.612888



 

Border Color File

Border-Color-Name-0  Red  Green  Blue  float-Point-Size  float-Line-Width
Border-Color-Name-1  Red  Green  Blue  float-Point-Size  float-Line-Width
...
EXAMPLE:
---------
SUL 180 180 180 1.00 1.00
FUN 80 80 80 1.00 1.00
OLOBE 0 0 0 0.00 1.00



 

Border File

N, Number of borders
For each border:
   Unused  Num-Links  Border-Name  float-Sampling-Density  float-Variance float-Topography float-Areal-Uncertainty
   float-Center-X  float-Center-Y  float-Center-Z
   For each link in the border
      Unused  Nearest-Section  float-Link-X  float-Link-Y  float-Link-Z
Note: Some or all of the Density, Variance, Topography, and Areal-Uncertainty  may not be present and any program reading border files should be able to handle this.

EXAMPLE:
---------
3
0 19 MORPH.LAT6 20.000000 1.000000
7.500000 2.880000 0.000000
-1 0 12.775953 0.020346 -22.060965
-1 0 11.999287 4.386629 -22.060965



 

Border Projection File

N, Number of Borders
For each border:
    Unused  Num-Links  Border-Name float-Sampling-Density  float-Variance float-Topography float-Areal-Uncertainty
    float-Center-X  float-Center-Y  float-Center-Z
    For each link in the border
       Tile-Node-1  Tile-Node-2  Tile-Node-3 Nearest-Section  float-Tile-Area-2  float-Tile-Area-3  float-Tile-Area-1
EXAMPLE:
---------
3
0 538 SUL.STS
-106.796646 -4.130603 0.000000
23552 23551 22965 -58 0.000000 1.639748 0.000000
23551 23552 24167 -58 4.711697 4.063610 3.067192
23552 23551 22965 -58 4.154122 5.529310 2.475053
...



 

MOMC Template File

For each template:
   Template-Name  Value-1  Value-2  Value-3 Value-4  Value-5  Value-6  Value-7
   Template-Name  Value-1  Value-2  Value-3 Value-4  Value-5  Value-6  Value-7
   Template-Name  Value-1  Value-2  Value-3 Value-4  Value-5  Value-6  Value-7
EXAMPLE:
---------
MT 75 15 20 23 50 50 0
V4 80 10 15 30 40 60 0
V1 75 20 25 30 30 40 30



 

MOMC Template Match File

For each template match:
   MOMC-Border-Name  float-Max-Template-Match Num-Template-Matches
   for each Tempate-Match
       Template-Name   float-Template-Match  float-Area-Match
EXAMPLE:
---------
95DR.229.37.A.70.15.20.20.40.40.20 250.000000 3
MT 233.000000 0.068000
V4 235.000000 0.060000
V1 250.000000 0.000000
95DR.229.37.B.65.13.13.30.40.50.10 250.000000 3
MT 233.000000 0.068000
V4 235.000000 0.060000
V1 250.000000 0.000000



 

Cell Color File

Cell-Color-0  Red  Green  Blue  float-Point-Size cell-class
Cell-Color-1  Red  Green  Blue  float-Point-Size cell-class
...
Note: Point size and cell class are optional.  If not present points size defaults to 1 and cell class to UNKNOWN.  In Caret versions 4.37 and earlier, the cell-class must be a number.  In later version of Caret the cell-class may be any text without whitespace.

EXAMPLE:
---------
Motion.Coherent         255 0 0 1.0 9
Motion.Opticflow        255 150 0 1.0 chair
Motion.Illusory         255 0 200 1.0 face



 

Cell File


NEW FORMAT

Note: comment-number, section-number, and class-name are optional.

tag-version 1
tag-number-of-cells 5
tag-number-of-comments 2
tag-BEGIN-DATA
cell-number X Y Z name comment-number section-number class-name         (for each cell)
0 comment line
EXAMPLE
tag-version 1
tag-number-of-cells 3
tag-number-of-comments 1
tag-BEGIN-DATA
0 38.000000 -62.000000 8.000000 Motion.Coherent.R.Zeki'91.2d -1 40 Motion
1 -38.000000 -74.000000 8.000000 Motion.Coherent.L.Zeki'91.2e -1 40 Motion
2 20.000000 -66.000000 -4.000000 Color.Passive.R.Zeki'91.2a 0 30 Color
0 This is the first comment
OLD FORMAT
N, Number of Cells,
For each cell:
   Unused Closest-Section Closest-Node Unused Cell-Name float-X float-Y floatZ
EXAMPLE:
---------
3
0 80 39833 ? Motion.Coherent.R.Zeki'91.2d 38.000000 -62.000000 8.000000
1 87 43470 ? Motion.Coherent.L.Zeki'91.2e 38.000000 -74.000000 8.000000
2 92 46561 ? Color.Passive.R.Zeki'91.2a 20.000000 -66.000000 -4.000000
...


 

Cell Projection File

  VERSION 2 FORMAT

The file begins with tags.  The first tag must be the version tag and the last tag must indicate the end of the tags.
 

tag-version 2
tag-number-of-cell-projections 50
tag-number-of-comments 2
tag-BEGIN-DATA


Following the tags are the cell projections of which there are two types, INSIDE and OUTSIDE.

INSIDE PROJECTION
 

cell-number section name class-name INSIDE comment# hemisphere dist-to-surface
closest-tile-vertices(3)  closest-tile-areas(3 order 2-3-1) cdistance(3)     (9 items total)


OUTSIDE PROJECTION
 

cell-number section name class-name OUTSIDE comment# hemisphere dist-to-surface
fracRI  fracRJ  dR  thetaR  phiR
triangles-fiducial-coordinates (2 triangles, 3 vertices, xyz)    (18 items total)
triangles-vertices  (2 triangles, 3 vertices)  (6 items total)
vertices-fiducial-coordinates (2 vertices, xyz)  (6 items total)
vertex-1  vertex-2  cell-fiducial-X  cell-fiducial-Y  cell-fiducial-Z


Following the cell projection data are the comments which are of the form
 

comment-number comment-with-no-line-feeds


EXAMPLE:
---------
tag-version 1
tag-number-of-cell-projections 2
tag-BEGIN-DATA
0 41 Motion.Coherent.R.Zeki'91.2d MOTION OUTSIDE 0 RIGHT 3.0
2.075017 1.075017 3.837723 0.000000 0.372130
39.267738 -65.081650 5.568131 39.234337 -65.092087 6.375312 39.680641 -65.026016 6.166610 39.680641 -65.026016 6.166610 40.560913 -65.311310 5.504364 39.267738 -65.081650 5.568131
27882 29644 29645 29645 27885 27882
39.267738 -65.081650 5.568131 39.680641 -65.026016 6.166610
27882 29645 38.000000 -62.000000 8.000000
1 34 Color.Passive.R.Zeki'91.2a COLOR INSIDE 1 LEFT 4.1
19808 19809 21399 0.455355 0.345562 0.185786 0.229795 -0.846817 -0.096161
0 This is comment line 1
1 This is comment line 2
 



  VERSION 1 FORMAT

The file begins with tags.  The first tag must be the version tag and the last tag must indicate the end of the tags.
 

tag-version 1
tag-number-of-cell-projections 50
tag-number-of-comments 2
tag-BEGIN-DATA


Following the tags are the cell projections of which there are two types, INSIDE and OUTSIDE.

INSIDE PROJECTION
 

cell-number section name INSIDE comment# hemisphere
closest-tile-vertices(3)  closest-tile-areas(3) cdistance(3)     (9 items total)


OUTSIDE PROJECTION
 

cell-number section name OUTSIDE comment# hemisphere
fracRI  fracRJ  dR  thetaR  phiR
triangles-fiducial-coordinates (2 triangles, 3 vertices, xyz)    (18 items total)
triangles-vertices  (2 triangles, 3 vertices)  (6 items total)
vertices-fiducial-coordinates (2 vertices, xyz)  (6 items total)
vertex-1  vertex-2  cell-fiducial-X  cell-fiducial-Y  cell-fiducial-Z


Following the cell projection data are the comments which are of the form
 

comment-number comment-with-no-line-feeds


EXAMPLE:
---------
tag-version 1
tag-number-of-cell-projections 2
tag-BEGIN-DATA
0 41 Motion.Coherent.R.Zeki'91.2d OUTSIDE 0 RIGHT
2.075017 1.075017 3.837723 0.000000 0.372130
39.267738 -65.081650 5.568131 39.234337 -65.092087 6.375312 39.680641 -65.026016 6.166610 39.680641 -65.026016 6.166610 40.560913 -65.311310 5.504364 39.267738 -65.081650 5.568131
27882 29644 29645 29645 27885 27882
39.267738 -65.081650 5.568131 39.680641 -65.026016 6.166610
27882 29645 38.000000 -62.000000 8.000000
1 34 Color.Passive.R.Zeki'91.2a INSIDE 1 LEFT
19808 19809 21399 0.455355 0.345562 0.185786 0.229795 -0.846817 -0.096161
0 This is comment line 1
1 This is comment line 2
 

OLD FORMAT

There are two types of entries for each cell in a cell projection file.  The "INSIDE_TRIANGLE" format consists of three lines each with six items.  The "OUTSIDE_TRIANGLE" format consists of two lines with nine items on the first line and five items on the second line.

N, Number of Cells
For each OUTSIDE_TRIANGLE cell:
    unused section vertex1 vertex2 triangle1 triangle2 unused area1-name area2-name
    fracRI fracRJ dR thetaR phiR
For each INSIDE_TRIANGLE cell:
    unused closest-node closest-tile section area1-name area2-name
    cdistance[vector of 3] tile-areas[vector of 3]
    pos[vector of 3]  projection[vector of 3]
EXAMPLE INSIDE_TRIANGLE Cell:
----------------------------

301 7877 22592 44 ? C.Au
-2.051589 1.019308 -0.540129  0.000451 0.048637 0.049230
-37.361118 -15.285437 -0.540129  -35.309528 -16.304745 0.000000

EXAMPLE OUTSIDE_TRIANGLE Cell:
------------------------------

5 43 7596 7595 25976 22594 1 ? C.Au
0.249307 0.750693 2.518255 0.006394 0.284253
 
 



 

Foci Color File


Same as Cell Color File



 

Foci File


Same as Cell File



 

Foci Projection File


Same as Cell Projection File



 

Cuts File

N, Number of Cuts
For each cut:
   Unused   Num-Links   Cut-Name
   float-Center-X   float-Center-Y  float-Center-Z
   Tile-Num  Section-Num  float-Link-X  float-Link-Y float-Link-Z
EXAMPLE:
---------
3
0 538 SUL.STS
-106.796646 -4.130603 0.000000
0 -58 -104.433884 39.155949 0.000000
0 -58 -104.867653 39.193245 0.000000



Contour File

This file contains all contours and reads in the contours that are accessible from the Layers:Contours menu.  The file beings with some "tags" that list the file's version number, the number of contours in the file, and the spacing between consecutive sections.  Each contour begins with a line listing the contour number, the number of points in the contour and the contour's section number.  Following this line are the X & Y coordinates for each point in the contour, one per line.

Example (3 contours on sections 0, 2, and 4):
-------
tag-version 1
tag-number-of-contours 3
tag-section-spacing 4
tag-BEGIN-DATA
0 3 0
-7.000000 118.000000
-6.970391 117.500877
-7.097758 117.017372
1 3 2
-17.000000 110.000000
-16.599592 110.299454
-16.674047 109.805031
2 4 4
-28.000000 124.000000
-27.680189 123.615654
-27.794584 123.128914
-27.908978 122.642174





 

Contour List File


This is a text file containing a list of Single Contour Files.  This file is specified when importing contours into Caret.  Read this file using File:Import:Import Contour List File menu item.  This reads contours in as a surface (REF & AUX).


 

Single Contour File


A contour file contains a single contour.  The file is a six character alphanumeric name where the first three characters specify the slice that the contour is in.  The fourth character is a period.  The fifth character is the a lowercase "c".  The last character is a number specifying the contour.  Example names for three contours in slice 31: 031.c1, 031.c1 031.c2.  Each line in a contour file is a pair of X-Y coordinate values.



 

Topography File

Each line in the topography file contains "node-number  name  eMean  eLow  eHigh  pMean  pLow  pHigh"

Spec File

The specification file contains the files in a surface family.  Each line in a spec file is typically one of the "tags" listed below followed by the associated file.  See the spec file tags web page.


Deformation Map File


This file is produced by the Surface:Deform Surface Maps:Deform Spherical Map menu item and contains two sections.  The first section lists the files and parameters used in the deformation process.  The second section describes the mapping to the target from the source surface.  This file can be used to deform additional source data files to the target surface by using the Surface:Deform Surface Maps:Apply Transform menu item.  Time is saved because it eliminates the need to run the entire deformation process.

In the deformation process, the source's spherical surface is deformed to the target's spherical surface by aligning common landmarks (borders representing major sulci) in the source surface to the target surface.  The nodes in the target surface are then projected onto the tiles (triangles) of the source surface which allows the creation of the deformation map file.  For each node in the target surface, the deformation map file lists the three nodes of the tile in the source surface the target node projects onto and the barycentric position of the target node in the tile.  Of the three source nodes listed, the source node closest to the target node is listed first.

When deforming a paint file to the target surface, each node in the target surface is assigned the paint data from the closest (first) source surface node listed in the data line for the target node.  When deforming a metric file, each node in the target surface is assigned the sum of each of the three surface nodes' metric values multiplied by the surface nodes' barycentric coordinate.

File Format:
 

deform-map-file-version 1
tag-name  tag-value(s)
tag-name  tag-value(s)
...
DATA-START
Number-of-nodes-in-target-surface
tgt-node-0  src-node-A  src-node-B  src-node-C  src-node-A-barycentric  src-node-B-bary src-node-C-bary
tgt-node-1  src-node-A  src-node-B  src-node-C  src-node-A-barycentric  src-node-B-bary src-node-C-bary
...
tgt-node-N  src-node-A  src-node-B  src-node-C  src-node-A-barycentric  src-node-B-bary src-node-C-bary


Example:

deform-map-file-version 1
source-spec /surface02/john/caret_data/sphere_warp/Demo.L.ForNewSphereRegister.spec
source-landmark-border /surface02/john/caret_data/sphere_warp/Demo.L.65950.4.CorrectOri_sphere.border
source-closed-topo /surface02/john/caret_data/sphere_warp/Demo.L.65950.8.topo
source-cut-topo /surface02/john/caret_data/sphere_warp/Demo.L.65950.8.topo
source-fiducial-coord /surface02/john/caret_data/sphere_warp/Demo.L.65950.2.coord
source-sphere-coord /surface02/john/caret_data/sphere_warp/Demo.L.65950.15.coord
source-deform-sphere-coord /surface02/john/caret_data/sphere_warp/deformed_19Sep_Demo.L.65950.15.coord
source-flat-coord /surface02/john/caret_data/sphere_warp/Demo.L.65950.17.coord
sphere-resolution 290
border-resampling 2 25.000000
spherical-number-of-cycles 2
smoothing-parameters 0 0.500000 20 2 2 2
morphing-parameters 0 0.500000 0.300000 0.500000 10
smoothing-parameters 1 0.500000 20 2 2 2
morphing-parameters 1 0.500000 0.300000 0.500000 10
target-spec /surface02/john/caret_data/sphere_warp/VHnew.L.ForNewSphereRegister.spec
target-landmark-border /surface02/john/caret_data/sphere_warp/VHnew.L.53833.9.ForDemo.L.Landmarks_sphere.border
target-closed-topo /surface02/john/caret_data/sphere_warp/VHnew.L.53833.6.topo
target-cut-topo /surface02/john/caret_data/sphere_warp/VHnew.L.53833.6.topo
target-sphere-coord /surface02/john/caret_data/sphere_warp/VHnew.L.53833.9.coord
target-fiducial-coord /surface02/john/caret_data/sphere_warp/VHnew.L.53833.8.coord
target-flat-coord /surface02/john/caret_data/sphere_warp/VHnew.L.53833.4.coord
DATA-START
53833
0 50526 50520 51265 0.620943 0.259769 0.739561
1 50526 50520 49901 0.491101 0.870924 0.017628
2 49901 49897 50520 0.406561 0.212269 0.888622
3 57159 56548 56542 0.168448 0.307017 0.936678
...
53831 35645 35642 36404 0.527242 0.278496 0.802780
53832 36404 36403 34834 0.587723 0.790374 0.172888


Deformation Field File

Spherical deformation creates the deformation field file.  For each node, the deformation field vector starts at the node.  The vector ends in the tile (triangle) made up of nodes tile-node-1, tile-node-2, and tile-node-3. 
The position within the triangle is denoted by the barycentric areas bary-area-1, bary-area-2, and bary-area-3.  The end of the vector shows the location of the node as a result of the deformation.

For each node in the deformation field file:
node-num  tile-node-1  tile-node-2 tile-node-3  bary-area-1  bary-area-2  bary-area-3

Calculation of the vector endpoint is as follows where v1 is the XYZ coordinate of tile-node-1, etc.  tileAreas is the bary-area-1, etc.:

   const float totalArea = tileAreas[0] + tileAreas[1] + tileAreas[2];
   if (totalArea != 0.0) {
      xyzOut[0] = (v1[0] * tileAreas[1] + v2[0] * tileAreas[2] + v3[0] * tileAreas[0])
                / totalArea;
      xyzOut[1] = (v1[1] * tileAreas[1] + v2[1] * tileAreas[2] + v3[1] * tileAreas[0])
                / totalArea;
      xyzOut[2] = (v1[2] * tileAreas[1] + v2[2] * tileAreas[2] + v3[2] * tileAreas[0])
                / totalArea;

Using barycentric coordinates allows the display of the vectors on any surface (flat, fiducial, etc).



 

Transformation Matrix File


This file is used for a REF Coord Transform File and can be read/saved through the Surface:Transform:Apply/Edit Transformation Matrix dialog.  The matrix is a 4x4 transformation matrix like that used by OpenGL.  "tag-matrix" tags are not required to have value.  Additional tags may be added in the future.  If you write a program to read this type of file, ignore any tags that you do not recognize.

File format:

tag-transformation-matrix-file-version 2
tag-number-of-matrices   number
tag-end-of-tags
tag-matrix-name  name-of-matrix
tag-matrix-comment   comment-for-matrix
tag-matrix-target-volume-name   name-of-volume-file
tag-matrix-target-volume-dimensions   x-y-z-dimensions
tag-matrix-fiducial-coord-name  name-of-coord file
tag-matrix-target-AC-coords x-y-z-position-of-AC
tag-matrix-begin
elem-0-0   elem-0-1   elem-0-2   elem-0-3
elem-1-0   elem-1-1   elem-1-2   elem-1-3
elem-2-0   elem-2-1   elem-2-2   elem-2-3
elem-3-0   elem-3-1   elem-3-2   elem-3-3

Example

tag-transformation-matrix-file-version 2
tag-number-of-matrices 2
tag-end-of-tags
tag-matrix-name matrix 1
tag-matrix-comment this is matrix 1
tag-matrix-target-volume-name VH.both+orig.HEAD
tag-matrix-target-volume-dimensions 1 2 3
tag-matrix-fiducial-coord-name test.coord
tag-matrix-target-AC-coords 4 5 6
tag-matrix-begin
1.000000 0.000000 0.000000 10.000000
0.000000 1.000000 0.000000 8.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000
tag-matrix-name translate 100x
tag-matrix-comment trans 100 in x
tag-matrix-begin
tag-matrix-target-volume-name VH.both+orig.HEAD
tag-matrix-target-volume-dimensions 1 2 3
tag-matrix-fiducial-coord-name test.coord
tag-matrix-target-AC-coords 4 5 6
1.000000 0.000000 0.000000 100.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000



 

CoCoMac Connectivity File


This file is an XML format file produced by the CoCoMac Database.



Comma Separated Value (CSV) File


One document that describes the CSV file format is located at
http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm.  You can also search the web for "csv".  A CSV file is primarily for the use of importing and exporting data with a spreadsheet application such as Microsoft Excel.  If you are reading a CSV file into a spreadsheet and asked to specify a delimeter, select a comma (",").

A Caret CSV file always begins with first first line "CSVF-FILE,<version-number>" where version number is the version of the Caret CSV file. 

A Caret CSV file is made up of multiple sections where each section begins with a line "csvf-section-start,<name-of-section>,<number-of-columns-in-section>" where "name-of-section" is the name of the section and "number-of-columns-in-section" indicates the number of data columns used for the data section.  Each section ends with "csvf-section-end,<name-of-section>".  The first line of each section lists the names of the data columns for the data section.

Every line in a CSV file have the same number of data columns separated by a comma.  Consecutive commas in a line simply indicate that the data column is either unused or the data element is empty.

Example of a Cell File stored as a CSV File:

CSVF-FILE,0,,,,,,,,,,,,
csvf-section-start,header,2,,,,,,,,,,,
tag,value,,,,,,,,,,,,
caret-version,5.402,,,,,,,,,,,,
comment,,,,,,,,,,,,,
date,Tue Jul 18 09:18:07 2006,,,,,,,,,,,,
encoding,COMMA_SEPARATED_VALUE_FILE,,,,,,,,,,,,
csvf-section-end,header,,,,,,,,,,,,
csvf-section-start,Cells,14,,,,,,,,,,,
Cell Number,X,Y,Z,Section,Name,Study Number,Geography,Area,Size,Statistic,Comment,Structure,Class Name
0,41.931171,-61.139236,8.226164,115,Motion.Coherent.R.Zeki'91.2d,0,,,0.000000,,,invalid,???
1,40.302086,-74.464973,9.714123,115,Motion.Coherent.L.Zeki'91.2e,0,,,0.000000,,,invalid,???
csvf-section-end,Cells,,,,,,,,,,,,
csvf-section-start,Cell Study Info,8,,,,,,,,,,,
Study Number,Stereotaxic Space,Keywords,URL,Title,Authors,Citation,Comment,,,,,,
0,,,," Zeki S, Watson JDG, Lueck, CJ Friston KJ, Kennard C, and Frackowiak RSJ (1991)
 A direct demonstration of functional specialization in human visual cortex.
 J Neurosci 11:641-649",,,,,,,,,
1,,,," DuPont P, Orban GA, De Bruyn B, Verbruggen A Mortelmans L (1994) Many areas in the human brain respond to visual motion.  J Neurophysiol 72:1420-1424",,,,,,,,,
csvf-section-end,Cell Study Info,,,,,,,,,,,,