BTK  0.3dev.0
Open-source library to visualize/process biomechanical data
List of all members | Protected Member Functions
btk::MotionAnalysisBinaryFileIO Class Reference

Acquisition IO abstract class used for the Motion Analysis ANB/TRB file format. More...

#include <btkMotionAnalysisFileIOUtils.h>

Inheritance diagram for btk::MotionAnalysisBinaryFileIO:
Inheritance graph
[legend]

Protected Member Functions

void CheckSizeForSingleValue (IEEELittleEndianBinaryFileStream *bifs) const
 
 MotionAnalysisBinaryFileIO (StorageFormat s=StorageNotApplicable)
 
void ReadKey (IEEELittleEndianBinaryFileStream *bifs, int key) const
 
size_t ReadKeyValueFloat (float *val, IEEELittleEndianBinaryFileStream *bifs, int key)
 
size_t ReadKeyValueString (std::string &val, IEEELittleEndianBinaryFileStream *bifs, int key)
 
size_t ReadKeyValueU16 (uint16_t *val, IEEELittleEndianBinaryFileStream *bifs, int key)
 
size_t ReadKeyValueU16 (std::vector< uint16_t > &val, IEEELittleEndianBinaryFileStream *bifs, int key)
 
size_t ReadKeyValueU32 (uint32_t *val, IEEELittleEndianBinaryFileStream *bifs, int key)
 
size_t ReadKeyValueU8 (uint8_t *val, IEEELittleEndianBinaryFileStream *bifs, int key)
 
size_t ReadKeyValueU8 (std::vector< uint8_t > &val, IEEELittleEndianBinaryFileStream *bifs, int key)
 
size_t WriteKeyValue (IEEELittleEndianBinaryFileStream *bofs, uint16_t key, const std::vector< uint8_t > &val)
 
size_t WriteKeyValue (IEEELittleEndianBinaryFileStream *bofs, uint16_t key, const std::vector< uint16_t > &val)
 
size_t WriteKeyValue (IEEELittleEndianBinaryFileStream *bofs, uint16_t key, uint32_t val)
 
size_t WriteKeyValue (IEEELittleEndianBinaryFileStream *bofs, uint16_t key, float val)
 
size_t WriteKeyValue (IEEELittleEndianBinaryFileStream *bofs, uint16_t key, const std::string &val, bool spacing=false)
 
- Protected Member Functions inherited from btk::AcquisitionFileIO
 AcquisitionFileIO (FileType f=TypeNotApplicable, ByteOrder b=OrderNotApplicable, StorageFormat s=StorageNotApplicable, int internalsUpdate=UpdateNotApplicable)
 
void SetFileType (FileType f)
 
virtual ~AcquisitionFileIO ()
 

Additional Inherited Members

- 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 inherited from btk::AcquisitionFileIO
virtual bool CanReadFile (const std::string &filename)=0
 
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 ExtensionsGetSupportedExtensions () const =0
 
bool HasInternalsUpdateOption (int option) const
 
virtual void Read (const std::string &filename, Acquisition::Pointer output)=0
 
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 inherited from btk::AcquisitionFileIO
static bool HasReadOperation ()
 
static bool HasWriteOperation ()
 
- Protected Attributes inherited from btk::AcquisitionFileIO
ByteOrder m_ByteOrder
 
FileType m_FileType
 
int m_InternalsUpdate
 
StorageFormat m_StorageFormat
 

Detailed Description

Acquisition IO abstract class used for the Motion Analysis ANB/TRB file format.

Constructor & Destructor Documentation

btk::MotionAnalysisBinaryFileIO::MotionAnalysisBinaryFileIO ( StorageFormat  s = StorageNotApplicable)
protected

Constructor.

Set the type to a binary format, with the IEEE little endian byte order.

Member Function Documentation

void btk::MotionAnalysisBinaryFileIO::CheckSizeForSingleValue ( IEEELittleEndianBinaryFileStream bifs) const
protected

Check if the size for the current extracted value is equal to one.

void btk::MotionAnalysisBinaryFileIO::ReadKey ( IEEELittleEndianBinaryFileStream bifs,
int  key 
) const
protected

Read a value (16-bit integer) and check if it corresponds to the given key

size_t btk::MotionAnalysisBinaryFileIO::ReadKeyValueFloat ( float *  val,
IEEELittleEndianBinaryFileStream bifs,
int  key 
)
protected

Read the given key and store the result in a float.

size_t btk::MotionAnalysisBinaryFileIO::ReadKeyValueString ( std::string &  val,
IEEELittleEndianBinaryFileStream bifs,
int  key 
)
protected

Read the given key and store the result in string.

size_t btk::MotionAnalysisBinaryFileIO::ReadKeyValueU16 ( uint16_t *  val,
IEEELittleEndianBinaryFileStream bifs,
int  key 
)
protected

Read the given key and store the result in an unsigned 16-bit integer.

size_t btk::MotionAnalysisBinaryFileIO::ReadKeyValueU16 ( std::vector< uint16_t > &  val,
IEEELittleEndianBinaryFileStream bifs,
int  key 
)
protected

Read the given key and store the result in a vector of unsigned 16-bit integers.

size_t btk::MotionAnalysisBinaryFileIO::ReadKeyValueU32 ( uint32_t *  val,
IEEELittleEndianBinaryFileStream bifs,
int  key 
)
protected

Read the given key and store the result in an unsigned 32-bit integer.

size_t btk::MotionAnalysisBinaryFileIO::ReadKeyValueU8 ( uint8_t *  val,
IEEELittleEndianBinaryFileStream bifs,
int  key 
)
protected

Read the given key and store the result in an unsigned 8-bit integer.

size_t btk::MotionAnalysisBinaryFileIO::ReadKeyValueU8 ( std::vector< uint8_t > &  val,
IEEELittleEndianBinaryFileStream bifs,
int  key 
)
protected

Read the given key and store the result in a vector of unsigned 8-bit integers.

size_t btk::MotionAnalysisBinaryFileIO::WriteKeyValue ( IEEELittleEndianBinaryFileStream bofs,
uint16_t  key,
const std::vector< uint8_t > &  val 
)
protected

Write the given key followed by the given vector of values

size_t btk::MotionAnalysisBinaryFileIO::WriteKeyValue ( IEEELittleEndianBinaryFileStream bofs,
uint16_t  key,
const std::vector< uint16_t > &  val 
)
protected

Write the given key followed by the given vector of values

size_t btk::MotionAnalysisBinaryFileIO::WriteKeyValue ( IEEELittleEndianBinaryFileStream bofs,
uint16_t  key,
uint32_t  val 
)
protected

Write the given key followed by the given vector of values

size_t btk::MotionAnalysisBinaryFileIO::WriteKeyValue ( IEEELittleEndianBinaryFileStream bofs,
uint16_t  key,
float  val 
)
protected

Write the given key followed by the given vector of values

size_t btk::MotionAnalysisBinaryFileIO::WriteKeyValue ( IEEELittleEndianBinaryFileStream bofs,
uint16_t  key,
const std::string &  val,
bool  spacing = false 
)
protected

Write the given key followed by the given vector of values