Some of the parameters in C3D files store data values using 16-bit integers, while all of the arrays use an 8-bit byte as an index. In the original C3D specification it was assumed that all integers used in the parameter section were signed integers with a range of –32768 to +32767 and all bytes were signed bytes with a range of –128 to +127. Thus, every 16-bit integer parameter could store both positive and negative values and all arrays could have both positive and negative indexes.
However, some common 16-bit integer parameters never take a negative value, for example, both the 3D frame count, and the number of 3D points recorded are always positive values. In addition, arrays within the C3D file (which use an 8-bit index) never use a negative index – the array index values are always positive. This has lead some software application writers to assume that some parameters are actually stored as unsigned 16-bit values and that all arrays use unsigned 8-bit byte indexes. While this is convenient, in that it doubles the amount of array storage available, and doubles the number of frames that can be stored in a C3D file, it may cause problems for some older software applications that will read negative values for frame ranges and array indexes.
Although the use of unsigned integers and array indexes is a potential source of problems for older software applications, it is unlikely to become a significant issue. The majority of older, FORTRAN written, applications will fail to read the newer “unsigned” C3D files for other reasons, most notably the fact that the larger arrays created by the use of unsigned bytes as array indexes significantly increases size of the parameter section. Many of the older software applications, written using signed integers throughout, allocate fixed amounts of parameter storage (generally about 10kb) and any C3D file that uses unsigned array indexes is very likely to overflow this allocation – usually with fatal results for the application.
Since the discussion above does not change the C3D file format at a binary level there is no flag to indicate that a C3D file uses unsigned integers in the parameter section. The use of unsigned integers can only be determined by finding negative values in certain parameter or index values as shown in the table below:
|
Parameters |
Signed C3D file |
Unsigned C3D file |
|
POINT:USED |
Data value < 32768 |
Data value > 32767 |
|
POINT:DATA_START |
Data value < 32768 |
Data value > 32767 |
|
POINT:FRAMES |
Data value < 32768 |
Data value > 32767 |
|
POINT:LABELS |
Array index < 128 Parameter length < 128 |
Array index > 127 Parameter length > 127 |
|
POINT:DESCRIPTIONS |
Array index < 128 Parameter length < 128 |
Array index > 127 Parameter length > 127 |
|
ANALOG:USED |
Data value < 32768 |
Data value > 32767 |
|
ANALOG:LABELS |
Array index < 128 Parameter length < 128 |
Array index > 127 Parameter length > 127 |
|
ANALOG:DESCRIPTIONS |
Array index < 128 Parameter length < 128 |
Array index > 127 Parameter length > 127 |
|
ANALOG:SCALE |
Array index < 128 |
Array index > 127 |
|
ANALOG:OFFSET |
Array index < 128 |
Array index > 127 |
|
ANALOG:UNITS |
Array index < 128 |
Array index > 127 |
|
FORCE_PLATFORM:CHANNEL |
Array index < 128 |
Array index > 127 |
|
FORCE_PLATFORM:ZERO |
Data value < 32768 |
Data value > 32767 |
Figure 27 – Signed vs. Unsigned C3D file parameters.
It is worth pointing out at this stage that it is highly unlikely that many of these parameters will ever be required to exceed the ranges supported by a signed C3D file. In general, the POINT:LABELS and DESCRIPTIONS are the most likely to exceed the signed range of 127 array entries.
While it is theoretically possible that almost all of the force plate parameters could take unsigned values, the only ones that are likely to be unsigned are the parameters FORCE_PLATFORM:CHANNEL which could use an unsigned array if the C3D file contained more than 127 analog channels and FORCE_PLATFORM:ZERO in very large C3D files where data at the end of the file is used to zero the force plate signals.