BTK
0.3dev.0
Open-source library to visualize/process biomechanical data
|
Contains the data related to a biomechanical acquisition. More...
#include <btkAcquisition.h>
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 |
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.
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.
|
protected |
Constructor.
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.
|
inline |
Returns an iterator to the beginning of the list of analog channels.
|
inline |
Returns a const iterator to the beginning of the list of analog channels.
|
inline |
Returns an iterator to the beginning of the list of events.
|
inline |
Returns a const iterator to the beginning of the list of events.
|
inline |
Returns an iterator to the beginning of the list of metadata.
|
inline |
Returns a const iterator to the beginning of the list of metadata
|
inline |
Returns an iterator to the beginning of the list of points.
|
inline |
Returns a const iterator to the beginning of the list of points.
|
inline |
Clear analogs channels.
|
inline |
Clear events.
|
inline |
Clear points.
|
inline |
Returns a deep copy of this object.
|
inline |
Returns an iterator just past the last analog channel.
|
inline |
Returns a const iterator just past the last analog channel.
|
inline |
Returns an iterator just past the last event.
|
inline |
Returns a const iterator just past the last event.
|
inline |
Returns an iterator just past the last metadata.
|
inline |
Returns a const iterator just past the last metadata.
|
inline |
Returns an iterator just past the last point.
|
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.
|
inline |
Returns the number of frames for the analog channels.
|
inline |
Returns the analogs sample rate.
|
inline |
Returns the number of analog channels.
|
inline |
Returns the analog resolution.
|
inline |
Returns the collection of analog channels.
|
inline |
Returns the collection of analog channels.
|
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.
|
inline |
Returns the number of events.
|
inline |
Returns the collection of events.
|
inline |
Returns the collection of events.
|
inline |
Return the first frame index of the acquisition.
|
inline |
Returns the last frame index of the acquisition base on the first frame index and the frame number.
|
inline |
Gets the maximum gap length that any interpolation method would fill for the 3D point data.
|
inline |
Returns the metadata.
|
inline |
Returns the metadata.
|
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.
|
inline |
Returns the number of frames for the points.
|
inline |
Returns the point's frequency.
Returns the points sample rate.
|
inline |
Returns the number of points.
|
inline |
Returns the collection of points.
|
inline |
Returns the collection of points.
|
inline |
Returns the unit for points of type Point::Marker
|
inline |
Returns the unit for points of type t.
|
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.
|
inline |
Checks if the analogs' list is empty.
|
inline |
Checks if the events' list is empty.
|
inline |
Checks if the points' list is empty.
|
inlinestatic |
Creates an Acquisition object and return it as smart pointer.
|
inlinestatic |
Static function to return a null pointer.
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:
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.
|
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.
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.
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.
|
protected |
Set the number of frames with frameNumber for each point.
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.
|
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.