BTK Matlab Wrapper  0.3dev.0
Matlab bindings for the Biomechanical ToolKit library (BTK)
btkNewAcquisition Class Reference

Description

Create a new and initialized acquisition.

Syntax:
h = btkNewAcquisition()
h = btkNewAcquisition(pn)
h = btkNewAcquisition(pn, fn)
h = btkNewAcquisition(pn, fn, an)
h = btkNewAcquisition(pn, fn, an, r)
Parameters
npNumber of points.
fnNumber of frames.
anNumber of analog channels.
rNumber of analog samples per video frame.
Return values
hHandle pointing to the newly created C++ btk::Acquisition object.
Detailed description:
btkNewAcquisition() returns an uninitialized and empty acquisition. The use of the function btkSetFrameNumber, btkSetPointNumber, btkSetAnalogNumber is then required to set properly the information of the acquistion. It is impossible to set directly data if the acquisition is uninitialized. The members of the acquisition are initialized to:
  • First frame equals to 1: use btkSetFirstFrame to modify it.
  • Points' frequency equals to 0: btkSetFrequency to modify it.
  • Points' units set to "mm", "deg", "N", "Nmm", "W", "" for markers, angles, forces, moments, powers and scalars respectively: use btkSetPointsUnit to modify them.
  • Analogs' frequency equals to 0. Updated when the points' frequency is.
  • Analog channel resolution sets to 12 bits: use btkSetAnalogResolution to modify it.
  • Number of analog samples per video frame set to 1.
btkNewAcquisition(pn) returns an uninitialized acquisition with pn points and 0 frame. The use of the function btkSetFrameNumber is then required to set properly the number of frames. It is impossible to set directly data if the acquisition is uninitialized. There is no analog channels. The points created are labeled with the string "uname*" and their index (e.g. uname_1, uname_2, ...). They are also tagged with the type "Marker". To change the type of theses points, use btkSetPointType or btkSetPoint.

btkNewAcquisition(pn, fn) returns an initialized acquisition with pn points and fn frames.

btkNewAcquisition(pn, fn, an) initializes the acquisition with an analog channels. Their gain is unknown, their offset is set to 0 and the scale factor to 1. As with the points, their label is composed of the string "uname*" and their index.

btkNewAcquisition(pn, fn, an, r) initializes the acquisition with r analog samples per video frame.

The release of the memory associated with the handle h can be done automatically by Matlab when you use the command clear all, or you can use the function btkDeleteAcquisition. The use of the function btkDeleteAcquisition is greatly advised when you are doing batch processing as Matlab does not manage the C++ memory and an "Out of memory" error could be thrown.