BTK
0.3dev.0
Open-source library to visualize/process biomechanical data
|
Interface to read/write TRB files. More...
#include <btkTRBFileIO.h>
Public Types | |
typedef btkSharedPtr< const TRBFileIO > | ConstPointer |
typedef btkSharedPtr< TRBFileIO > | Pointer |
Public Types inherited from btk::AcquisitionFileIO | |
enum | ByteOrder { OrderNotApplicable = 0, IEEE_LittleEndian, VAX_LittleEndian, IEEE_BigEndian } |
typedef btkSharedPtr< const AcquisitionFileIO > | ConstPointer |
enum | FileType { TypeNotApplicable, ASCII, Binary } |
enum | InternalsUpdateOption { UpdateNotApplicable = 0, NoUpdate = UpdateNotApplicable, DataBasedUpdate = 1, MetaDataBasedUpdate = 2, FileFormatOption = 512 } |
typedef btkSharedPtr < AcquisitionFileIO > | Pointer |
enum | StorageFormat { StorageNotApplicable = 0, Float = -1, Integer = 1 } |
Public Member Functions | |
virtual bool | CanReadFile (const std::string &filename) |
virtual void | Read (const std::string &filename, Acquisition::Pointer output) |
Public Member Functions inherited from btk::AcquisitionFileIO | |
virtual bool | CanWriteFile (const std::string &filename)=0 |
ByteOrder | GetByteOrder () const |
std::string | GetByteOrderAsString () const |
FileType | GetFileType () const |
int | GetInternalsUpdateOptions () const |
StorageFormat | GetStorageFormat () const |
std::string | GetStorageFormatAsString () const |
virtual const Extensions & | GetSupportedExtensions () const =0 |
bool | HasInternalsUpdateOption (int option) const |
void | SetByteOrder (ByteOrder b) |
void | SetInternalsUpdateOptions (int options) |
void | SetStorageFormat (StorageFormat s) |
virtual void | Write (const std::string &filename, Acquisition::Pointer input)=0 |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from btk::AcquisitionFileIO | |
static bool | HasReadOperation () |
static bool | HasWriteOperation () |
Additional Inherited Members | |
Protected Attributes inherited from btk::AcquisitionFileIO | |
ByteOrder | m_ByteOrder |
FileType | m_FileType |
int | m_InternalsUpdate |
StorageFormat | m_StorageFormat |
Interface to read/write TRB files.
A TRB file contains markers trajectories stored in the IEEE Little endian binary format.
Based on reverse engineering, the file format is composed of a header part and a data part. The header is composed of keys and values as the data part.
The known keys are:
0x0101
: ID?0x0102
: ?0x0103
: Data Rate0x0104
: Camera Rate0x0105
: First time (or first frame)?0x0115
: ?0x010C
: Markers' informations (#, color, label)0x010D
: Link (segment) informations (#, extremity1, extremity2, color, label)A key is always followed by the size of its value and is write on 2 bytes. The size correspond to number of word associated with the key. A word corresponds to four bytes. For example, the following string:
0800 0001 0000 024C
corresponds to the key 0x0800
with a size of 1 word (0x0001
) and a value equal to 588 (0x024C
).
The structure of the file can be summarized as the following:
The TRB file format is created by Motion Analysis Corp.
Smart pointer associated with a const TRBFileIO object.
Smart pointer associated with a TRBFileIO object.
|
protected |
Constructor.
|
virtual |
Checks if the four first words are 0x0000 0000 FFFF FFFF
Implements btk::AcquisitionFileIO.
|
inlinestatic |
Create a TRBFileIO object an return it as a smart pointer.
|
virtual |
Read the file designated by filename and fill output.
Implements btk::AcquisitionFileIO.