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

Contains the data related to a biomechanical acquisition. More...

#include <btkAcquisition.h>

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

Public Types

typedef
AnalogCollection::ConstIterator 
AnalogConstIterator
 
typedef AnalogCollection::Iterator AnalogIterator
 
enum  AnalogResolution {
  Bit8 = 8, Bit10 = 10, Bit12 = 12, Bit14 = 14,
  Bit16 = 16
}
 
typedef btkSharedPtr< const
Acquisition
ConstPointer
 
typedef
EventCollection::ConstIterator 
EventConstIterator
 
typedef EventCollection::Iterator EventIterator
 
typedef std::list
< MetaData::Pointer >
::const_iterator 
MetaDataConstIterator
 
typedef std::list
< MetaData::Pointer >
::iterator 
MetaDataIterator
 
typedef btkNullPtr< AcquisitionNullPointer
 
typedef
PointCollection::ConstIterator 
PointConstIterator
 
typedef btkSharedPtr< AcquisitionPointer
 
typedef PointCollection::Iterator PointIterator
 
- Public Types inherited from btk::DataObject
typedef btkSharedPtr< const
DataObject
ConstPointer
 
typedef btkNullPtr< DataObjectNullPointer
 
typedef btkSharedPtr< DataObjectPointer
 
- Public Types inherited from btk::Object
typedef btkSharedPtr< const
Object
ConstPointer
 
typedef btkSharedPtr< ObjectPointer
 

Public Member Functions

void AppendAnalog (Analog::Pointer ac)
 
void AppendEvent (Event::Pointer e)
 
void AppendPoint (Point::Pointer p)
 
AnalogIterator BeginAnalog ()
 
AnalogConstIterator BeginAnalog () const
 
EventIterator BeginEvent ()
 
EventConstIterator BeginEvent () const
 
MetaDataIterator BeginMetaData ()
 
MetaDataConstIterator BeginMetaData () const
 
PointIterator BeginPoint ()
 
PointConstIterator BeginPoint () const
 
void ClearAnalogs ()
 
void ClearEvents ()
 
void ClearPoints ()
 
Pointer Clone () const
 
AnalogIterator EndAnalog ()
 
AnalogConstIterator EndAnalog () const
 
EventIterator EndEvent ()
 
EventConstIterator EndEvent () const
 
MetaDataIterator EndMetaData ()
 
MetaDataConstIterator EndMetaData () const
 
PointIterator EndPoint ()
 
PointConstIterator EndPoint () const
 
AnalogIterator FindAnalog (const std::string &label)
 
AnalogConstIterator FindAnalog (const std::string &label) const
 
EventIterator FindEvent (const std::string &label)
 
EventConstIterator FindEvent (const std::string &label) const
 
PointIterator FindPoint (const std::string &label)
 
PointConstIterator FindPoint (const std::string &label) const
 
Analog::Pointer GetAnalog (int idx)
 
Analog::ConstPointer GetAnalog (int idx) const
 
Analog::Pointer GetAnalog (const std::string &label)
 
Analog::ConstPointer GetAnalog (const std::string &label) const
 
int GetAnalogFrameNumber () const
 
double GetAnalogFrequency () const
 
int GetAnalogNumber () const
 
AnalogResolution GetAnalogResolution () const
 
AnalogCollection::Pointer GetAnalogs ()
 
AnalogCollection::ConstPointer GetAnalogs () const
 
double GetDuration () const
 
Event::Pointer GetEvent (int idx)
 
Event::ConstPointer GetEvent (int idx) const
 
int GetEventNumber () const
 
EventCollection::Pointer GetEvents ()
 
EventCollection::ConstPointer GetEvents () const
 
int GetFirstFrame () const
 
int GetLastFrame () const
 
int GetMaxInterpolationGap () const
 
MetaData::Pointer GetMetaData ()
 
MetaData::ConstPointer GetMetaData () const
 
int GetNumberAnalogSamplePerFrame () const
 
Point::Pointer GetPoint (int idx)
 
Point::ConstPointer GetPoint (int idx) const
 
Point::Pointer GetPoint (const std::string &label)
 
Point::ConstPointer GetPoint (const std::string &label) const
 
int GetPointFrameNumber () const
 
double GetPointFrequency () const
 
int GetPointNumber () const
 
PointCollection::Pointer GetPoints ()
 
PointCollection::ConstPointer GetPoints () const
 
const std::string GetPointUnit () const
 
const std::string GetPointUnit (Point::Type t) const
 
const std::vector< std::string > & GetPointUnits () const
 
void Init (int pointNumber, int frameNumber, int analogNumber=0, int analogSampleNumberPerPointFrame=1)
 
bool IsEmptyAnalog () const
 
bool IsEmptyEvent () const
 
bool IsEmptyPoint () const
 
void RemoveAnalog (const std::string &label)
 
void RemoveAnalog (int idx)
 
AnalogIterator RemoveAnalog (AnalogIterator loc)
 
void RemoveEvent (int idx)
 
EventIterator RemoveEvent (EventIterator loc)
 
void RemovePoint (const std::string &label)
 
void RemovePoint (int idx)
 
PointIterator RemovePoint (PointIterator loc)
 
void Reset ()
 
void Resize (int pointNumber, int frameNumber, int analogNumber=0, int analogSampleNumberPerPointFrame=1)
 
void ResizeAnalogNumber (int analogNumber)
 
void ResizeFrameNumber (int frameNumber)
 
void ResizeFrameNumberFromEnd (int frameNumber)
 
void ResizePointNumber (int pointNumber)
 
void SetAnalog (int idx, Analog::Pointer analog)
 
void SetAnalogNumber (int num)
 
void SetAnalogResolution (AnalogResolution r)
 
void SetAnalogs (AnalogCollection::Pointer analogs)
 
void SetEvent (int idx, Event::Pointer point)
 
void SetEventNumber (int num)
 
void SetEvents (EventCollection::Pointer evts)
 
void SetFirstFrame (int num, bool adaptEvents=false)
 
void SetMaxInterpolationGap (int gap)
 
void SetMetaData (MetaData::Pointer metaData)
 
void SetPoint (int idx, Point::Pointer point)
 
void SetPointFrequency (double frequency)
 
void SetPointNumber (int num)
 
void SetPoints (PointCollection::Pointer points)
 
void SetPointUnit (const std::string &unit="mm")
 
void SetPointUnit (Point::Type t, const std::string &units)
 
void SetPointUnits (const std::vector< std::string > &units)
 
- Public Member Functions inherited from btk::DataObject
DataObjectGetParent () const
 
bool HasParent () const
 
void Modified ()
 
void SetParent (DataObject *parent)
 
void Update ()
 
- Public Member Functions inherited from btk::Object
unsigned long int GetTimestamp () const
 

Static Public Member Functions

static Pointer New ()
 
static NullPointer Null ()
 
- Static Public Member Functions inherited from btk::DataObject
static NullPointer Null ()
 

Protected Member Functions

 Acquisition ()
 
void SetAnalogFrameNumber (int frameNumber)
 
void SetPointFrameNumber (int frameNumber)
 
- Protected Member Functions inherited from btk::DataObject
 DataObject ()
 
 DataObject (const DataObject &toCopy)
 
virtual ~DataObject ()
 
- Protected Member Functions inherited from btk::Object
 Object ()
 
 Object (const Object &toCopy)
 
virtual ~Object ()
 

Additional Inherited Members

- Protected Attributes inherited from btk::Object
unsigned long int m_Timestamp
 

Detailed Description

Contains the data related to a biomechanical acquisition.

A biomechanical acquisition can contains:

By default, the first frame is set to 1, the analog resolution is set to 12-bit, the maximum interpolation gap to 10 frames and the units are:

After the creation of the acquisition, you should use the Init() method to populate the acquisition.

The member used for the maximum interpolation gap is only for information and is not used in the acquisition. It could be used later in a filter to fill gap.

Member Typedef Documentation

Const iterator for analog channels contained in the acquisition object.

Iterator for analog channels contained in the acquisition object.

Smart pointer associated with a const Acquisition object.

Const iterator for events contained in the acquisition object.

Iterator for events contained in the acquisition object.

Const iterator for metadata contained in the acquisition object.

Iterator for metadata contained in the acquisition object.

Special null pointer associated with a Acquisition object. This type should be used only internally to test the nullity of a smart pointer. See the static method Null() instead.

Const iterator for points contained in the acquisition object.

Smart pointer associated with an Acquisition object.

Iterator for points contained in the acquisition object.

Member Enumeration Documentation

Enums used to specify the ADC resolution used to store analog channel signal.

Enumerator
Bit8 

8 bits ADC.

Bit10 

10 bits ADC.

Bit12 

12 bits ADC.

Bit14 

14 bits ADC.

Bit16 

16 bits ADC.

Constructor & Destructor Documentation

btk::Acquisition::Acquisition ( )
protected

Constructor.

Member Function Documentation

void btk::Acquisition::AppendAnalog ( Analog::Pointer  ac)

Append the analog channel ac in the acquisition This method also resizes the frame number of the inserted analog channel if necessary.

void btk::Acquisition::AppendEvent ( Event::Pointer  e)

Append the event e in the acquisition.

void btk::Acquisition::AppendPoint ( Point::Pointer  p)

Convenient method to append a point in the acquisition. This method also resizes the frame number of the inserted point if necessary.

Acquisition::AnalogIterator btk::Acquisition::BeginAnalog ( )
inline

Returns an iterator to the beginning of the list of analog channels.

Acquisition::AnalogConstIterator btk::Acquisition::BeginAnalog ( ) const
inline

Returns a const iterator to the beginning of the list of analog channels.

Acquisition::EventIterator btk::Acquisition::BeginEvent ( )
inline

Returns an iterator to the beginning of the list of events.

Acquisition::EventConstIterator btk::Acquisition::BeginEvent ( ) const
inline

Returns a const iterator to the beginning of the list of events.

Acquisition::MetaDataIterator btk::Acquisition::BeginMetaData ( )
inline

Returns an iterator to the beginning of the list of metadata.

Acquisition::MetaDataConstIterator btk::Acquisition::BeginMetaData ( ) const
inline

Returns a const iterator to the beginning of the list of metadata

Acquisition::PointIterator btk::Acquisition::BeginPoint ( )
inline

Returns an iterator to the beginning of the list of points.

Acquisition::PointConstIterator btk::Acquisition::BeginPoint ( ) const
inline

Returns a const iterator to the beginning of the list of points.

void btk::Acquisition::ClearAnalogs ( )
inline

Clear analogs channels.

void btk::Acquisition::ClearEvents ( )
inline

Clear events.

void btk::Acquisition::ClearPoints ( )
inline

Clear points.

Pointer btk::Acquisition::Clone ( ) const
inline

Returns a deep copy of this object.

Acquisition::AnalogIterator btk::Acquisition::EndAnalog ( )
inline

Returns an iterator just past the last analog channel.

Acquisition::AnalogConstIterator btk::Acquisition::EndAnalog ( ) const
inline

Returns a const iterator just past the last analog channel.

Acquisition::EventIterator btk::Acquisition::EndEvent ( )
inline

Returns an iterator just past the last event.

Acquisition::EventConstIterator btk::Acquisition::EndEvent ( ) const
inline

Returns a const iterator just past the last event.

Acquisition::MetaDataIterator btk::Acquisition::EndMetaData ( )
inline

Returns an iterator just past the last metadata.

Acquisition::MetaDataConstIterator btk::Acquisition::EndMetaData ( ) const
inline

Returns a const iterator just past the last metadata.

Acquisition::PointIterator btk::Acquisition::EndPoint ( )
inline

Returns an iterator just past the last point.

Acquisition::PointConstIterator btk::Acquisition::EndPoint ( ) const
inline

Returns a const iterator just past the last point.

Acquisition::AnalogIterator btk::Acquisition::FindAnalog ( const std::string &  label)

Finds the analog channel with the proposed label and returns the iterator associated with it. If no analog channel has label as label, an iterator pointing to the end of the collection is returned.

Acquisition::AnalogConstIterator btk::Acquisition::FindAnalog ( const std::string &  label) const

Finds the analog channel with the proposed label and returns the const iterator associated with it. If no point has label as label, a const iterator pointing to the end of the collection is returned.

Acquisition::EventIterator btk::Acquisition::FindEvent ( const std::string &  label)

Finds the event with the proposed label and returns the iterator associated with it. If no event has label as label, an iterator pointing to the end of the collection is returned.

Acquisition::EventConstIterator btk::Acquisition::FindEvent ( const std::string &  label) const

Finds the event with the proposed label and returns the const iterator associated with it. If no event has label as label, a const iterator pointing to the end of the collection is returned.

Acquisition::PointIterator btk::Acquisition::FindPoint ( const std::string &  label)

Finds the point with the proposed label and returns the iterator associated with it. If no point has label as label, an iterator pointing to the end of the collection is returned.

Acquisition::PointConstIterator btk::Acquisition::FindPoint ( const std::string &  label) const

Finds the point with the proposed label and returns the const iterator associated with it. If no point has label as label, a const iterator pointing to the end of the collection is returned.

Analog::Pointer btk::Acquisition::GetAnalog ( int  idx)

Gets the analog channel at the index idx as a smart pointer.

If no Analog exists, then an exception is thrown.

Analog::ConstPointer btk::Acquisition::GetAnalog ( int  idx) const

Gets the analog channel at the index idx as a const smart pointer.

Analog::Pointer btk::Acquisition::GetAnalog ( const std::string &  label)

Gets the analog channel with the label label as a smart pointer.

Analog::ConstPointer btk::Acquisition::GetAnalog ( const std::string &  label) const

Gets the analog channel with the label label as a const smart pointer.

int btk::Acquisition::GetAnalogFrameNumber ( ) const
inline

Returns the number of frames for the analog channels.

double btk::Acquisition::GetAnalogFrequency ( ) const
inline

Returns the analogs sample rate.

int btk::Acquisition::GetAnalogNumber ( ) const
inline

Returns the number of analog channels.

AnalogResolution btk::Acquisition::GetAnalogResolution ( ) const
inline

Returns the analog resolution.

AnalogCollection::Pointer btk::Acquisition::GetAnalogs ( )
inline

Returns the collection of analog channels.

AnalogCollection::ConstPointer btk::Acquisition::GetAnalogs ( ) const
inline

Returns the collection of analog channels.

double btk::Acquisition::GetDuration ( ) const
inline

Returns the duration of the acquisition.

The duration is computed as the multiplication of the points' frequency with the points frame number.

Event::Pointer btk::Acquisition::GetEvent ( int  idx)

Gets the event at the index idx as a smart pointer.

Event::ConstPointer btk::Acquisition::GetEvent ( int  idx) const

Gets the event at the index idx as a const smart pointer.

int btk::Acquisition::GetEventNumber ( ) const
inline

Returns the number of events.

EventCollection::Pointer btk::Acquisition::GetEvents ( )
inline

Returns the collection of events.

EventCollection::ConstPointer btk::Acquisition::GetEvents ( ) const
inline

Returns the collection of events.

int btk::Acquisition::GetFirstFrame ( ) const
inline

Return the first frame index of the acquisition.

int btk::Acquisition::GetLastFrame ( ) const
inline

Returns the last frame index of the acquisition base on the first frame index and the frame number.

int btk::Acquisition::GetMaxInterpolationGap ( ) const
inline

Gets the maximum gap length that any interpolation method would fill for the 3D point data.

Warning
Only for information. Could be use later by a filter to fill gap 3D trajectories.
MetaData::Pointer btk::Acquisition::GetMetaData ( )
inline

Returns the metadata.

MetaData::ConstPointer btk::Acquisition::GetMetaData ( ) const
inline

Returns the metadata.

int btk::Acquisition::GetNumberAnalogSamplePerFrame ( ) const
inline

Returns the number of analog sample (acquired by each channel) per point frame.

Point::Pointer btk::Acquisition::GetPoint ( int  idx)

Gets the point at the index idx as a smart pointer.

If no Point exists, then a btk::OutOfRangeException exception is thrown.

Point::ConstPointer btk::Acquisition::GetPoint ( int  idx) const

Gets the point at the index idx as a const smart pointer.

If no Point exists, then a btk::OutOfRangeException exception is thrown.

Point::Pointer btk::Acquisition::GetPoint ( const std::string &  label)

Gets the point with the label label as a smart pointer.

If no Point exists, then a btk::OutOfRangeException exception is thrown.

Point::ConstPointer btk::Acquisition::GetPoint ( const std::string &  label) const

Gets the point with the label label as a const smart pointer.

If no Point exists, then a btk::OutOfRangeException exception is thrown.

int btk::Acquisition::GetPointFrameNumber ( ) const
inline

Returns the number of frames for the points.

double btk::Acquisition::GetPointFrequency ( ) const
inline

Returns the point's frequency.

Returns the points sample rate.

int btk::Acquisition::GetPointNumber ( ) const
inline

Returns the number of points.

PointCollection::Pointer btk::Acquisition::GetPoints ( )
inline

Returns the collection of points.

PointCollection::ConstPointer btk::Acquisition::GetPoints ( ) const
inline

Returns the collection of points.

const std::string btk::Acquisition::GetPointUnit ( ) const
inline

Returns the unit for points of type Point::Marker

const std::string btk::Acquisition::GetPointUnit ( Point::Type  t) const
inline

Returns the unit for points of type t.

const std::vector< std::string > & btk::Acquisition::GetPointUnits ( ) const
inline

Returns all the units used for the points (Marker, Angle, Force, Moment, Power, Scalar).

void btk::Acquisition::Init ( int  pointNumber,
int  frameNumber,
int  analogNumber = 0,
int  analogSampleNumberPerPointFrame = 1 
)

Initialize the acquisition with pointNumber which have frameNumber frame. The analog part has analogNumber analog channels and their number of frames corresponds to the integer factor analogSampleNumberPerPointFrame multiplied by frameNumber.

This method label added points and analog channels using the string "uname*" concatenated with the index of the channel.

bool btk::Acquisition::IsEmptyAnalog ( ) const
inline

Checks if the analogs' list is empty.

bool btk::Acquisition::IsEmptyEvent ( ) const
inline

Checks if the events' list is empty.

bool btk::Acquisition::IsEmptyPoint ( ) const
inline

Checks if the points' list is empty.

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

Creates an Acquisition object and return it as smart pointer.

static NullPointer btk::Acquisition::Null ( )
inlinestatic

Static function to return a null pointer.

Note
This static method should be used only to test if a shared ponter is null or not. It is advised to call the method without parenthesis as special (in)equality operator are implemented to use a function pointer. See the description of the class NullPtr for an example.
void btk::Acquisition::RemoveAnalog ( const std::string &  label)

Convenient method to delete an analog channel from the acquisition.

void btk::Acquisition::RemoveAnalog ( int  idx)

Convenient method to delete an analog channel from the acquisition.

Acquisition::AnalogIterator btk::Acquisition::RemoveAnalog ( AnalogIterator  loc)

Convenient method to delete an analog channel from the acquisition.

void btk::Acquisition::RemoveEvent ( int  idx)

Remove the event associated with the index idx.

Acquisition::EventIterator btk::Acquisition::RemoveEvent ( Acquisition::EventIterator  loc)

Remove the event associated with the iterator loc.

void btk::Acquisition::RemovePoint ( const std::string &  label)

Convenient method to delete a point from the acquisition.

void btk::Acquisition::RemovePoint ( int  idx)

Convenient method to delete a point from the acquisition.

Acquisition::PointIterator btk::Acquisition::RemovePoint ( Acquisition::PointIterator  loc)

Convenient method to delete a point from the acquisition.

void btk::Acquisition::Reset ( )

Resets the acquisition as an empty acquisition:

  • Zero points ;
  • Zero analog channels ;
  • First frame sets to 1 ;
  • Point frequency sets to 0 ;
  • Point frame number sets to 0 ;
  • Empty metadata ;
  • Analog resolution: 12 bits ;
  • Default units.

To re-populate this acquisition, you need to re-use the Init() method to set the point and analog number and their frame number.

void btk::Acquisition::Resize ( int  pointNumber,
int  frameNumber,
int  analogNumber = 0,
int  analogSampleNumberPerPointFrame = 1 
)

Resize the acquisition with pointNumber which have frameNumber frame. The analog part has analogNumber analog channels and their number of frames corresponds to the integer factor analogSampleNumberPerPointFrame multiplied by frameNumber.

This method has the same behavior than the method Init(), but does not label added points and analog channels

void btk::Acquisition::ResizeAnalogNumber ( int  analogNumber)

Resize the number of analog channels. Using this method will set the object as modified even if the given number of analog channels is the same than in the acquisition. This method forces the analog channels to have this object (the acquisition) as their parent.

void btk::Acquisition::ResizeFrameNumber ( int  frameNumber)

Resize the number of frames.

void btk::Acquisition::ResizeFrameNumberFromEnd ( int  frameNumber)

Resize the number of frames by adding the new frames at the beginning of the acquisition and set automatically the new first frame index.

void btk::Acquisition::ResizePointNumber ( int  pointNumber)

Resize the number of points. Using this method will set the object as modified even if the given number of points is the same than in the acquisition. This method forces the analog channels to have this object (the acquisition) as their parent.

void btk::Acquisition::SetAnalog ( int  idx,
Analog::Pointer  analog 
)

Sets the analog channel at the index idx by the content of analog.

void btk::Acquisition::SetAnalogFrameNumber ( int  analogSampleNumberPerPointFrame)
protected

Set the number of frames for each analog channels as the multiplication of the number of frames of the points with analogSampleNumberPerPointFrame. The input value analogSampleNumberPerPointFrame corresponds to the oversampling of the analog channels related to the sampling rate of the points.

Warning
This method doesn't activate the Modified() method.
void btk::Acquisition::SetAnalogNumber ( int  num)

Sets the number of analog channels.

void btk::Acquisition::SetAnalogResolution ( AnalogResolution  r)

Sets the analog resolution.

void btk::Acquisition::SetAnalogs ( AnalogCollection::Pointer  analogs)

Sets analog channels for this acquisition.

void btk::Acquisition::SetEvent ( int  idx,
Event::Pointer  event 
)

Sets the content of event at the index idx.

void btk::Acquisition::SetEventNumber ( int  num)

Sets the number of points.

void btk::Acquisition::SetEvents ( EventCollection::Pointer  evts)

Sets events for this acquisition.

void btk::Acquisition::SetFirstFrame ( int  num,
bool  adaptEvents = false 
)

Sets the first frame index (and optionally adapt events' frame/time, false by default).

To adapt the events' frame/time, you have to set the option adaptEvents to true. The event's frame is shifted by the difference between the new first frame and the old one. The event's time is recomputed using the new frame and the current point's frequency.

void btk::Acquisition::SetMaxInterpolationGap ( int  gap)

Sets the maximum gap length that any interpolation method would fill for the 3D point data.

Warning
Only for information. Could be use later by a filter to fill gap 3D trajectories.
void btk::Acquisition::SetMetaData ( MetaData::Pointer  metaData)

Sets the metadata of the acquisition.

void btk::Acquisition::SetPoint ( int  idx,
Point::Pointer  point 
)

Sets the content of point at the index idx.

void btk::Acquisition::SetPointFrameNumber ( int  frameNumber)
protected

Set the number of frames with frameNumber for each point.

Warning
This method doesn't activate the Modified() method.
void btk::Acquisition::SetPointFrequency ( double  frequency)

Sets the points sample rate.

void btk::Acquisition::SetPointNumber ( int  num)

Sets the number of points.

void btk::Acquisition::SetPoints ( PointCollection::Pointer  points)

Sets points for this acquisition.

void btk::Acquisition::SetPointUnit ( const std::string &  unit = "mm")
inline

Sets the unit for points of type Point::Marker.

void btk::Acquisition::SetPointUnit ( Point::Type  t,
const std::string &  units 
)

Sets the point's unit for the Point's type t with the value units.

The type Point::Reaction cannot have any unit. You cannot set it.

void btk::Acquisition::SetPointUnits ( const std::vector< std::string > &  units)

Sets the units for all the kinds of points.