C3D Parameter Files

This chapter describes a feature of the ADTech file format in that any such file can contain parameters and/or data and, as long as the file has a parameter section, it can be used as a source of parameters by any another application.  As a result, the title “Parameter Files” is somewhat misleading - in fact, all C3D files are potentially “Parameter Files.”  This manual will use the term Parameter Files to refer to any file that contains only a parameter section without any 3D data section, although it could contain other data sections.

Anyone reading this manual simply to learn how to store 3D and/or analog data in a C3D file can comfortably skip this chapter and move directly to the discussion of the C3D Group and Parameter format in the following chapter.

The parameter section from a C3D file may be stored as a separate file within the general ADTech format.  This feature allows collections of parameter values to be maintained and manipulated, and is useful if you have to describe a wide range of data collection configurations or analysis conditions.  These parameter files do not contain a C3D file header section or any 3D or analog data section but  are simply the parameter section from a C3D file, written to a separate file with a different modified parameter header record.  This feature is convenient for maintaining collections of parameters.

The convenience of parameter files is best illustrated with some practical examples:

·      A photogrammetry application generally needs to create a number of C3D files for each experiment or data collection session.  In most cases the data collection parameters do not change within data trials in a single data acquisition session – therefore the majority of the C3D parameters will be identical in each trial and therefore each C3D file.  While it is possible to write an application that creates a set of identical parameters each time it writes a C3D file it is usually faster, using a small parameter file as a template, to simply copy the parameter details from the template file and update the few parameters that have actually changed in the new C3D file.

·      A data analysis application that reads and writes C3D files will usually be required to process data collected in a number of different environments or experimental conditions.  Software users do not generally appreciate having to set up a standard set of conditions repeatedly so it is common for software applications to offer the ability to save various configurations.  It is easy to create C3D parameter files that contain various sets of configuration information (i.e. specific analog channel names and descriptions) and then use this information to update C3D data files during analysis.

·      Programmers writing their first application to create C3D files from scratch will usually find it easier to simply copy the parameter section from an existing C3D file than write code to build the C3D parameter structure.

·      Parameter files are a convenient alternative to the conventional ASCII text .INI or .DAT files for storing C3D related values since they can be accessed via the same sub-routines and functions used by C3D files.  A numeric or text data value can be read from a parameter file and written directly into a C3D file without any conversion – making transcription and interpretation errors unlikely.

·      Any C3D file can serve as a “parameter file” in that its parameter section can be read and used as a “template” for creating or modifying other C3D files.

In each of these examples, the parameter file offers a convenient way of storing C3D parameters for eventual use in other C3D files.  In practice of course, any application that knows how to read C3D parameters can extract this information from any C3D file.  The advantage of creating parameter files to store common information is simply one of convenience.

Parameter files always start with single 16-bit word that contains two byte values:

Byte

Typical Value

Description

1

0x01 hex

The block number of the first block in the parameter section.

2

0x50 hex

Key identifier of 80 decimal.

Figure 10 – The Parameter File.

The first byte of the parameter file is a pointer to the parameter block while the second byte is a key byte that flags the file as using the ADTech format.  Thus, parameter files do not have a C3D-like header – instead the first byte indicates the number of the first block of data within the parameter file that contains parameter information.  This will usually 0x01h, indicating that the parameter information starts at the first block in the file.  A value of 0x08h would indicate that the parameter information started in block 8 in the file.

The second byte is a key byte – the value of 80 decimal (0x50h) indicating that this is an ADTech format file.  The function of this is to allow an application to quickly test if the file is indeed a file written in the ADTech parameter format.  It is worth pointing out that the format of the first word in a parameter file is identical to that of the first word in a C3D file.

More:

Notes for programmers - Parameter Files