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

Interface to read/write CLB files. More...

#include <btkCLBFileIO.h>

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

Public Types

typedef btkSharedPtr< const
CLBFileIO
ConstPointer
 
typedef btkSharedPtr< CLBFileIOPointer
 
- 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 ExtensionsGetSupportedExtensions () 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 ()
 

Protected Member Functions

 CLBFileIO ()
 
- 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

- Protected Attributes inherited from btk::AcquisitionFileIO
ByteOrder m_ByteOrder
 
FileType m_FileType
 
int m_InternalsUpdate
 
StorageFormat m_StorageFormat
 

Detailed Description

Interface to read/write CLB files.

The CLB file format is used in the software C-Logger (Contec Inc., Spartanburg, USA) and contains only analogs data.

Based on reverse engineering, its content is separated in a header and the data with the following informations:

* // Header
* - key: string (18 characters): 0x434F 4E54 4543 2044 4154 4120 4C4F 4747 4552 (CONTEC DATA LOGGER)
* - Version: integer 16-bit
* - Channel number: integer 16-bit
* - Device name length: integer 16-bit (n)
* - Device name: string (n characters, where n is the value extracted previously)
* - Resolution: integer 16-bit
* - Serial number length: integer 16-bit (m)
* - Serial number: string (m characters, where m is the value extracted previously)
* - Sampling clock: integer 32-bit (unit in µs)
* - Time integer: 8 bytes (integer 64-bit) // WHAT IS THE FORMAT?
* - Number of frames: integer 32-bit
* // Data
* - Channel name length: integer 16-bit (o)
* - Channel name: string (o characters, where o is the value extracted previously)
* - Device channel: integer 16-bit
* - Sequence: integer 16-bit
* - Input range: integer 16-bit (code to convert to a corresponding range)
* - Scaling Enabled: integer 16-bit
* - Maximum scale value: float 32-bit
* - Minimum scale value: float 32-bit
* - ??? (Option): 32-bit
* - Data block (number of frames x integer 16-bit)
* // ... Same format for the other analog channels
*
Note
Some informations were also found in the documentation of the manufacturer on the web (especially for the channel information. See file C-LOGGER_UsersGuide_124e.pdf). However, it seems that there is no license for this documentation but only on the software. So, I don't think there is any copyright infringement.

Member Typedef Documentation

Smart pointer associated with a const CLBFileIO object.

Smart pointer associated with a CLBFileIO object.

Constructor & Destructor Documentation

btk::CLBFileIO::CLBFileIO ( )
protected

Constructor.

Member Function Documentation

bool btk::CLBFileIO::CanReadFile ( const std::string &  filename)
virtual

Check if the beginning of the file starts with the string "CONTEC DATA LOGGER".

Implements btk::AcquisitionFileIO.

static CLBFileIO::Pointer btk::CLBFileIO::New ( )
inlinestatic

Create a CLBFileIO object an return it as a smart pointer.

void btk::CLBFileIO::Read ( const std::string &  filename,
Acquisition::Pointer  output 
)
virtual

Read the file designated by filename and fill output.

Implements btk::AcquisitionFileIO.