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::AMTIForcePlatformFileIO Class Reference

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

#include <btkAMTIForcePlatformFileIO.h>

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

Public Types

typedef btkSharedPtr< const
AMTIForcePlatformFileIO
ConstPointer
 
typedef btkSharedPtr
< AMTIForcePlatformFileIO
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)
 
const std::vector< float > & GetCorners () const
 
const std::vector< float > & GetDimensions () const
 
const std::vector< float > & GetOrigin () const
 
virtual void Read (const std::string &filename, Acquisition::Pointer output)
 
void SetDimensions (float width, float length, float height)
 
void SetGeometry (const std::vector< float > &corners, const std::vector< float > &origin)
 
- 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

 AMTIForcePlatformFileIO ()
 
- 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 AMTIForcePlatform files.

An AMTI Force Platform file contains 6 analog channels data stored in ASCII format corresponding to the forces and the moments measured by one AMTI force plateform. This kind of force platform is known as a force platform of type II (2). The forces are measured in newtons (N), while the moments are measured in newton meters (N.m). It is important to not that the returned forces and moments are the reaction measured by the force platform and not the measure itself. This choice was done to fit with the format stored in a btk::Acquisition object.

Warning
The forces and the moments in the file are measured in the platfrom (local) frame while a btk::Acquisition object store data in the global frame.
To be able to express the force, moments as well as the COP (computed by the filter btk::GroundReactionWrenchFilter), this reader assumes that the data comes from an AMTI force plate OR6-7, and uses then its dimensions (463.6 x 508 x 82.6 mm). All the dimensions must be given in millimeters.If your platform is not this one, then you have to modify the dimensions or the geometry.
From the dimensions, the coordinates of the 4 corners of the force plate are generated. Compared to the frame embed with the force plate, the corners 1,2,3,4 must be defined as the corner in the quadrant +x+y, -x+y, -x-y, and +x-y. The global frame is defined as the axis X going to the left, the Y axis is forward, and the Z axis goes up. You can modify the dimensions of the force platform, or directly its origin and the corners using the methods SetDimensions() or SetGeometry(). Finally, the information on the sample frequency is automatically determined by using the two first time samples. The inverse of the difference of these timestamps will give the sample frequency.

Member Typedef Documentation

Smart pointer associated with a const AMTIForcePlatformFileIO object.

Smart pointer associated with a AMTIForcePlatformFileIO object.

Constructor & Destructor Documentation

btk::AMTIForcePlatformFileIO::AMTIForcePlatformFileIO ( )
protected

Constructor.

Member Function Documentation

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

Checks if the first line contains 7 numbers.

Implements btk::AcquisitionFileIO.

void const std::vector< float > & btk::AMTIForcePlatformFileIO::GetCorners ( ) const
inline

Returns the position of the corners as a vector of 12x1 elements. The first three elements represent the coordinate of the first corner, etc.

const std::vector< float > & btk::AMTIForcePlatformFileIO::GetDimensions ( ) const
inline

Returns the dimensions of the force platform.

const std::vector< float > & btk::AMTIForcePlatformFileIO::GetOrigin ( ) const
inline

Returns the coordinates of the origin of the force platform.

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

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

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

Read the file designated by filename and fill output.

Implements btk::AcquisitionFileIO.

void btk::AMTIForcePlatformFileIO::SetDimensions ( float  width,
float  length,
float  height 
)

Set the dimensions of the force platform which will be used for the next readings.

Warning
The dimensions must be given in millimeters!
void btk::AMTIForcePlatformFileIO::SetGeometry ( const std::vector< float > &  corners,
const std::vector< float > &  origin 
)

Set the geometry (corners and origin) of the force platform which will be used for the next readings.

Warning
The geometry must be given in millimeters!
This method is an advanced method. All the data must be expressed in the global frame. The order of the corners is very important.