BTK Matlab Wrapper  0.3dev.0
Matlab bindings for the Biomechanical ToolKit library (BTK)
btkWriteAcquisition Class Reference

Description

Write acquisition's data into file (C3D, TRC, ...).

Syntax:
btkWriteAcquisition(h, filename, option, value, ...)
Parameters
hHandle pointing to a C++ btk::Acquisition object.
filenameString with the path of the acquisition to export.
optionString (see the detailed description for the list of the available options).
valueAssociated value with the given option.
...Other couple of option/value.
Detailed description:
btkWriteAcquisition(h, filename) exports acquisition's data represented as the handle g into the file filename. The choice of the file format is based on the file extension in filename (for example, '.trc' or '.c3d')

btkWriteAcquisition(h, filename, option, value, ...) gives somes extra-options for some file format.

The ByteOrder option can receive 3 values:
  • IEEE_LittleEndian: write integer and float in x86 format (PC).
  • IEEE_BigEndian: write integer and float in PPC/MIPS format (SGI).
  • VAX_LittleEndian: write integer and float in VAX format (DEC). The StorageFormat option can receive 2 values:
  • Integer: Acquisition data are scaled and stored as 16 bits integer.
  • Float: Acquisition data are stored as floating values. The REGENERATEINTERNALS is an advanced option which can receive 2 values.
  • DataBased: Internal file format configuration (if any) is regenerated based on the acquisition data (i.e. points and analog channels plus events). This option is the default one.
  • MetadataBased: Internal file format configuration (if any) is regenerated based on the metadata. WARNING: Use this value carefully as it could be easy to corrupt file format internals with it.

Without any option, a C3D File is written using the machine byte order and the float as storage format. Using these options on ASCII formats (for example TRC) have no effect on the file data. The writing of an empty acquisition (no point and no analog channel) in a C3D file will create a template C3D file. Only the metadata will be saved.
Examples
btkWriteAcquisition(acq, 'filename.c3d', 'StorageFormat', 'Float');
btkWriteAcquisition(acq, 'filename.c3d', 'ByteOrder', 'VAX_LittleEndian');
btkWriteAcquisition(acq, 'filename.c3d', 'StorageFormat', 'Integer', 'ByteOrder', 'IEEE_LittleEndian');
See Also
btkCloseAcquisition, btkReadAcquisition