The C3D header section is always the first block in the C3D file and is counted as block number one (1). It is a single record of 256 16-bit words (512 8-bit bytes) with the following structure:
|
WORD |
Typical Value |
Description |
|
1 |
0x5002 hex |
Byte 1: Points to the first block of the parameter section. Byte 2: Key value 0x50h indicating a C3D file. |
|
2 |
nn |
Number of 3D points in the C3D file (i.e. the number of stored trajectories). |
|
3 |
nn |
Total number of analog measurements per 3D frame, i.e. number of channels multiplied by the samples per channel. |
|
4 |
1 |
Number of the first frame of 3D data (1 based, not 0). |
|
5 |
nn |
Number of the last frame of 3D data. |
|
6 |
10 |
Maximum interpolation gap in 3D frames. |
|
7 8 |
nnnn |
The 3D scale factor (floating-point) that converts signed integer 3D data to reference system measurement units. If this is negative then the file is scaled in floating-point. |
|
9 |
nn |
DATA_START the number of the first block of the 3D and analog data section. |
|
10 |
nn |
The number of analog samples per 3D frame. |
|
11 12 |
60.000 |
The 3D frame rate in Hz (floating-point). |
|
13 147 |
0x00 hex |
Reserved for future use. |
|
148 |
0x3039 hex |
A key value (12345 decimal) is written here if Label and Range data is present, otherwise write 0x00. |
|
149 |
nn |
The first block of the Label and Range section (if present). |
|
150 |
0x3039 hex |
A key value (12345 decimal) present if this file supports 4 char event labels. An older format supported only 2 character labels. |
|
151 |
0 |
Number of defined time events (0 to 18) |
|
152 |
0x00 hex |
Reserved for future use. |
|
153 188 |
- |
Event times (floating-point) in seconds (up to 18 events). |
|
189 197 |
- |
18 bytes - event display flags 0x00 = ON, 0x01 = OFF. |
|
198 |
0x00 hex |
Reserved for future use. |
|
199 234 |
- |
Event labels. Each label is 4 characters long |
|
235 256 |
0x00 hex |
Reserved for future use. |
Figure 3 The C3D file header record.
The first word in the C3D header record contains two bytes. The first byte is a pointer to the first 512-byte block that starts the parameter section in the example shown below this is 0x02h indicating that the block immediately following the header record is the start of the parameter section (the header record is block 1). The second byte is always 0x50h (80 decimal) and flags this file as a C3D file.
The second word in the C3D file header contains the number of trajectories stored in the file as 3D points this is a copy of the POINT:USED parameter. Note that the C3D file structure can easily accommodate data records that contain 3D information, 2D information or no coordinate information at all.
The third word in the C3D file header contains the number of analog samples stored for each frame of data in the file each sample consists of at least one 16-bit data value per 3D frame. Note that there is no requirement that the stored data has 16-bit resolution, in fact many C3D files contain only 12-bit resolution data although all analog values are stored as 16-bit values regardless of their physical sample resolution. See page 50 for a discussion of the format of the stored analog data.

Figure 4 A hex dump of a typical C3D header record.
The 3D point frame range is stored in the next two header words in the form of first_frame_number, last_frame_number. The frame numbers are a 1-based count there is no frame zero. Although many C3D files store data in the range of 1 to n, there is no requirement that the first frame is frame 1, e.g. C3D files containing exactly 100 frame could have ranges such as 1 100, 23 122, 2005 2104 etc. The 3D point frame range is one of the few data values stored in the C3D file header section that is not derived directly from the parameter section.
Header word six contains a value that records the maximum interpolation gap length for 3D point data. The use of this item is not specified in the C3D file description although the maximum interpolation gap length value is usually set to indicate the maximum length of invalid 3D point data samples (in frames) over which interpolation was performed in the creation of the C3D file. This may be used by various applications to specify the length of gaps that can be interpolated or gap filled when reading or creating a C3D file. Since the value of the maximum interpolation gap is recorded in 3D frames, it represents time. Note that since this value is not well defined in the C3D file specification, its use does not indicate that any 3D data points are actually interpolated the precise interpretation of this value is left up to the application that created the data. Any application reading the C3D file may, if necessary or requested, override this value and interpolate gaps of any length.
Words 7 and 8 in the C3D file header contain a copy of the 3D scale factor stored as a floating-point value. This parameter is used when 3D data values are stored using signed integer format. It scales the stored 3D point values from signed integer values to real world values.
The sign of the 3D scale factor can be used to determine the 3D point and analog data storage method (floating-point or signed integer). If a signed integer C3D file is converted to floating point format then the original 3D scale factor should be simply negated and stored this allows transparent conversion between signed integer and floating-point data types unless the floating-point data is modified in some way.
To retain the maximum resolution for signed integer data, the 3D scale factor should be about (max absolute coordinate value used)/32000. This will allow all of the 3D point coordinates to be expressed within the range of a signed 16-bit integer value.
Header word 9 is a copy of the DATA_START parameter this is a pointer to the first 512-byte block that starts the 3D point and analog data section. The 512-byte blocks are counted from the start of the C3D file with the 512-byte C3D header section counted as block 1. It should not be assumed that the 3D point and analog data section starts immediately following the C3D parameter section.
The use of a signed integer here (Signed C3D files) will limit the maximum value of DATA_START to 32,767. The use of an unsigned value extends this value to a maximum of 65,536 thus enabling the 3D data to be stored further from the start of the C3D file.
Header word 10 records the number of analog samples associated with each 3D frame. If the C3D file does not contain any analog data then this will be zero. If the C3D file does contains analog data then it will be interleaved with the 3D data to ensure that synchronization is maintained between the 3D and analog samples. The C3D structure for 3D point and analog data samples assumes that each 3D frame can have one or more analog samples from each channel sampled (as determined by the count stored in the third word of the C3D file header). Thus the actual analog sample rate is measured and recorded in terms of analog samples per 3D frame this means that C3D files can only contain data sampled at integer multiples of the 3D frame rate.
Header words 11 and 12 record the 3D frame rate in samples per second commonly thought of as Hertz (Hz.). Note that the 3D frame rate parameter is a floating-point value, making it possible to accurately record the 3D frame rate for video based sampling systems. For instance most 60 Hz video based systems actually sample the video data at 59.94 Hz which, while close to the commonly assumed exact 60.00 Hz sample rate, can introduce measurable synchronization errors over periods of tens of seconds. Not withstanding this, some motion capture systems incorrectly record the value of 60 in these circumstances.
C3D file header words 13 149 are reserved for future use. At this point, a proposal has been made to use words 148 and 149 to define the proposed Label and Range section. Other header words may provide additional expansion features in the future. Applications that create new C3D files should fill these reserved words with 0x00h while applications that copy or edit C3D files should preserve the contents of these words.
Header words 150 and 151 in the C3D file header are used by the header event storage feature. The header event storage allows the timing of a maximum of 18 events to be recorded in the C3D file header section. Header word 151 records the number of events stored in the C3D header this can be any signed integer value between 0 and 18. Words 153 through 234 are used to store up to 18 event times together with a four-character label and a status (either ON or OFF) for each defined event. Events defined in the header may be used for any purpose although in gait analysis they are typically used to indicate gait cycle timing. Words 152 and 198 are unused.
The remaining C3D header section words 235 through 256 are reserved for future use. Applications that create new C3D files should fill these reserved words with 0x00h while applications that copy or edit C3D files should preserve the contents of these words.
It is very important to ensure that all C3D software applications use the correct pointers to locate the various headers and data sections, as there is no guarantee that data and parameter sections will always be organized in exactly the same way. An application that, for example, assumes that 3D data always follows the parameter section, or that the parameter section will never be larger than 10 blocks, may fail unexpectedly when presented with a valid C3D file that has been created by another software application.