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

Analog channel data along the time. More...

#include <btkAnalog.h>

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

Public Types

typedef btkSharedPtr< const
Analog
ConstPointer
 
enum  Gain {
  Unknown = 0, PlusMinus10 = 10000, PlusMinus5 = 5000, PlusMinus2Dot5 = 2500,
  PlusMinus1Dot25 = 1250, PlusMinus1 = 1000, PlusMinus0Dot5 = 500, PlusMinus0Dot25 = 250,
  PlusMinus0Dot1 = 100, PlusMinus0Dot05 = 50
}
 
typedef btkNullPtr< AnalogNullPointer
 
typedef btkSharedPtr< AnalogPointer
 
typedef MeasureTraits< Analog >
::Values 
Values
 
- Public Types inherited from btk::Measure< Analog >
typedef MeasureTraits< Analog >
::Data 
Data
 Associated data with the measure.
 
typedef MeasureTraits< Analog >
::Values 
Values
 Values of the measure.
 
- Public Types inherited from btk::DataObjectLabeled
typedef btkSharedPtr< const
DataObjectLabeled
ConstPointer
 
typedef btkSharedPtr
< DataObjectLabeled
Pointer
 
- 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

Pointer Clone () const
 
Gain GetGain () const
 
int GetOffset () const
 
double GetScale () const
 
const std::string & GetUnit () const
 
void SetDataSlice (int frame, double val)
 
void SetGain (Gain g)
 
void SetOffset (int o)
 
void SetScale (double s)
 
void SetUnit (const std::string &u)
 
virtual ~Analog ()
 
- Public Member Functions inherited from btk::Measure< Analog >
Measure< Analog >::Data::Pointer GetData () const
 
int GetFrameNumber () const
 
Measure< Analog >::ValuesGetValues ()
 
const Measure< Analog >::ValuesGetValues () const
 
void SetData (typename Measure< Analog >::Data::Pointer data, bool parenting=true)
 
void SetFrameNumber (int frameNumber)
 
void SetValues (const Values &v)
 
- Public Member Functions inherited from btk::DataObjectLabeled
const std::string & GetDescription () const
 
const std::string & GetLabel () const
 
virtual void SetDescription (const std::string &description)
 
virtual void SetLabel (const std::string &label)
 
- 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 (const std::string &label="", const std::string &desc="")
 Creates a smart pointer associated with a Analog object. More...
 
static Pointer New (int frameNumber)
 Creates a smart pointer associated with a Analog object. More...
 
static Pointer New (const std::string &label, int frameNumber)
 Creates a smart pointer associated with a Analog object. More...
 
static NullPointer Null ()
 
- Static Public Member Functions inherited from btk::DataObject
static NullPointer Null ()
 

Protected Member Functions

 Analog (const std::string &label, const std::string &desc)
 
 Analog (const std::string &label, int frameNumber, Gain g=Unknown)
 
- Protected Member Functions inherited from btk::Measure< Analog >
 Measure (const std::string &label, const std::string &desc="")
 
 Measure (const std::string &label, int frameNumber, const std::string &desc="")
 
 Measure (const Measure &toCopy)
 
- Protected Member Functions inherited from btk::DataObjectLabeled
 DataObjectLabeled (const std::string &label="", const std::string &description="")
 
 DataObjectLabeled (const DataObjectLabeled &toCopy)
 
- 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::Measure< Analog >
Measure< Analog >::Data::Pointer mp_Data
 Smart pointer associated with the data of this measurement.
 
- Protected Attributes inherited from btk::DataObjectLabeled
std::string m_Description
 
std::string m_Label
 
- Protected Attributes inherited from btk::Object
unsigned long int m_Timestamp
 

Detailed Description

Analog channel data along the time.

An analog channel is defined as:

The data samples are is stored in a Analog::Data object.

The use of the unit, scale, offset and gain are useful for other classes/methods. For example, when you save an acquisition in a file, analog's data are generally unscaled and written as integer, then the scale and offset are important.

Member Typedef Documentation

Smart pointer associated with a const Analog object.

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

Smart pointer associated with a Analog object.

Analog' values along the time with 1 component (1 column).

Member Enumeration Documentation

Enums used to specify the analog gain.

Enumerator
Unknown 

Unknown gain.

PlusMinus10 

+/- 10 volts.

PlusMinus5 

+/- 5 volts.

PlusMinus2Dot5 

+/- 2.5 volts.

PlusMinus1Dot25 

+/- 1.25 volts.

PlusMinus1 

+/- 1 volts.

PlusMinus0Dot5 

+/- 0.5 volts.

PlusMinus0Dot25 

+/- 0.25 volts.

PlusMinus0Dot1 

+/- 0.1 volts.

PlusMinus0Dot05 

+/- 0.05 volts.

Constructor & Destructor Documentation

btk::Analog::~Analog ( )
inlinevirtual

Empty destructor.

btk::Analog::Analog ( const std::string &  label,
const std::string &  desc 
)
protected

Constructor.

btk::Analog::Analog ( const std::string &  label,
int  frameNumber,
Gain  g = Unknown 
)
protected

Constructor.

Member Function Documentation

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

Deep copy of the current object.

Gain btk::Analog::GetGain ( ) const
inline

Returns the analog gain.

int btk::Analog::GetOffset ( ) const
inline

Returns the analog offset value in bit which represents the 0 value.

double btk::Analog::GetScale ( ) const
inline

Returns the scaling factor which can bu used to transform a ADC value into real value.

const std::string & btk::Analog::GetUnit ( ) const
inline

Returns the unit of the channel number.

static Pointer btk::Analog::New ( const std::string &  label = "",
const std::string &  desc = "" 
)
inlinestatic

Creates a smart pointer associated with a Analog object.

The measure created has no values.

The call of this function must be followed by the use of the method Measure::SetFrameNumber as no btk::Analog::Data object is allocated.

static Pointer btk::Analog::New ( int  frameNumber)
inlinestatic

Creates a smart pointer associated with a Analog object.

The analog channel created has an empty label and a number of frames equals to framenumber.

The number of frames must be equal or greater than 0. In case the number of frame is set to 0, no btk::Analog::Data object is allocated. You will need to use the method Measure::SetFrameNumber if you want to assign analog data later.

static Pointer btk::Analog::New ( const std::string &  label,
int  frameNumber 
)
inlinestatic

Creates a smart pointer associated with a Analog object.

The analog channel created has a label and a number of frames equals to label and framenumber respectively.

The number of frames must be equal or greater than 0. In case the number of frame is set to 0, no btk::Analog::Data object is allocated. You will need to use the method Measure::SetFrameNumber if you want to assign analog data later.

static NullPointer btk::Analog::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::Analog::SetDataSlice ( int  idx,
double  val 
)
inline

Convenient method to set easily the value val for the given frame index idx.

Warning
This function is not safe. There is no checking to determine if there is data or if the frame is out of range or not. It has the advantage to be faster.
void btk::Analog::SetGain ( Gain  g)

Sets the analog gain.

void btk::Analog::SetOffset ( int  o)

Sets the analog offset.

void btk::Analog::SetScale ( double  s)

Set the scaling factor.

void btk::Analog::SetUnit ( const std::string &  u)

Sets the analog channel's unit.