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 | Protected Attributes
btk::AcquisitionFileWriter Class Reference

Writer of acquisition data into acquisition file (C3D, TRC, ...). More...

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

Public Types

typedef btkSharedPtr< const
AcquisitionFileWriter
ConstPointer
 
typedef btkSharedPtr
< AcquisitionFileWriter
Pointer
 
- Public Types inherited from btk::ProcessObject
typedef btkSharedPtr< const
ProcessObject
ConstPointer
 
typedef btkSharedPtr
< ProcessObject
Pointer
 
- Public Types inherited from btk::Object
typedef btkSharedPtr< const
Object
ConstPointer
 
typedef btkSharedPtr< ObjectPointer
 

Public Member Functions

AcquisitionFileIO::Pointer GetAcquisitionIO ()
 
AcquisitionFileIO::ConstPointer GetAcquisitionIO () const
 
const std::string & GetFilename () const
 
Acquisition::Pointer GetInput ()
 
void SetAcquisitionIO (AcquisitionFileIO::Pointer io=AcquisitionFileIO::Pointer())
 
void SetFilename (const std::string &filename)
 
void SetInput (Acquisition::Pointer input)
 
virtual ~AcquisitionFileWriter ()
 
- Public Member Functions inherited from btk::ProcessObject
int GetInputNumber () const
 
int GetOutputNumber () const
 
int GetValidInputNumber () const
 
void ResetState ()
 
void Update ()
 
- Public Member Functions inherited from btk::Object
unsigned long int GetTimestamp () const
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 AcquisitionFileWriter ()
 
virtual void GenerateData ()
 
Acquisition::Pointer GetInput (int idx)
 
virtual DataObject::Pointer MakeOutput (int idx)
 
- Protected Member Functions inherited from btk::ProcessObject
int GetInputIndex (DataObject::Pointer input)
 
DataObject::Pointer GetNthInput (int idx)
 
DataObject::ConstPointer GetNthInput (int idx) const
 
DataObject::Pointer GetNthOutput (int idx)
 
DataObject::ConstPointer GetNthOutput (int idx) const
 
int GetOutputIndex (DataObject::Pointer output)
 
bool IsModified () const
 
void Modified ()
 
 ProcessObject ()
 
void SetInputNumber (int num)
 
virtual void SetNthInput (int idx, DataObject::Pointer input)
 
virtual void SetNthOutput (int idx, DataObject::Pointer output)
 
void SetOutputNumber (int num)
 
virtual ~ProcessObject ()
 
- Protected Member Functions inherited from btk::Object
 Object ()
 
 Object (const Object &toCopy)
 
virtual ~Object ()
 

Protected Attributes

AcquisitionFileIO::Pointer m_AcquisitionIO
 
std::string m_Filename
 
- Protected Attributes inherited from btk::Object
unsigned long int m_Timestamp
 

Detailed Description

Writer of acquisition data into acquisition file (C3D, TRC, ...).

Note
The detection of the helper class to use creates a new object (inheriting of btk::AcquisitionFileIO). Then, if a previous or empty btk::AcquisitionFileIO pointer was given to another filter, it doesn't correspond to the newly detected btk::AcquisitionFileIO. For example:
* reader->SetFilename("...");
* writer->SetAcquisitionIO(reader->GetAcquisitionIO());
* writer->SetInput(reader->GetOutput());
* writer->SetFilename("...");
* writer->Update();
*
This code give to the writer an empty btk::FileAcquisitionIO. When the writer is updated, it updates also the reader which detects the btk::FileAcquisitionIO corresponding to the given file. However, the writer has the old (empty) value and will detect the btk::FileAcquisitionIO to used instead of using the same as the reader.
To use the same btk::FileAcquisitionIO, the reader must be updated before the use of the method btk::AcquisitionFileWriter::SetAcquisitionIO.
* reader->SetFilename("...");
* reader->Update(); // <-- Line to add
* writer->SetAcquisitionIO(reader->GetAcquisitionIO());
* writer->SetInput(reader->GetOutput());
* writer->SetFilename("...");
* writer->Update();
*

Member Typedef Documentation

Smart pointer associated with a const AcquisitionFileWriter object.

Smart pointer associated with an AcquisitionFileWriter object.

Constructor & Destructor Documentation

btk::AcquisitionFileWriter::~AcquisitionFileWriter ( )
inlinevirtual

Empty destructor.

btk::AcquisitionFileWriter::AcquisitionFileWriter ( )
protected

Constructor. Sets the number of input equal to one. No output.

Member Function Documentation

void btk::AcquisitionFileWriter::GenerateData ( )
protectedvirtual

Check the file integrety, find a AcquisitionIO helper class if no one has been specified and finally read the file.

Implements btk::ProcessObject.

AcquisitionFileIO::Pointer btk::AcquisitionFileWriter::GetAcquisitionIO ( )
inline

Returns a Pointer associated with the AcquisitionIO helper class

AcquisitionFileIO::ConstPointer btk::AcquisitionFileWriter::GetAcquisitionIO ( ) const
inline

Returns a ConstPointer associated with the AcquisitionIO helper class

const std::string & btk::AcquisitionFileWriter::GetFilename ( ) const
inline

Gets the filename of the file to write.

Acquisition::Pointer btk::AcquisitionFileWriter::GetInput ( )
inline

Returns the Acquisition to write by a AcquisitionIO helper class.

Acquisition::Pointer btk::AcquisitionFileWriter::GetInput ( int  idx)
inlineprotected

Returns the input at the index idx.

DataObject::Pointer btk::AcquisitionFileWriter::MakeOutput ( int  idx)
protectedvirtual

Whatever the specified index, this method generates a runtime exception.

Implements btk::ProcessObject.

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

Creates a AcquisitionFileWriter process.

void btk::AcquisitionFileWriter::SetAcquisitionIO ( AcquisitionFileIO::Pointer  io = AcquisitionFileIO::Pointer())

Set the AcquisitionIO helper class. This method forces the AcquisitionIO to be used to write a particular file. The AcquisitionIO is oftenly created via the object factory mechanism that determines whether a particular AcquisitionIO can write a certain file (see AcquisitionFileIOFactory).

void btk::AcquisitionFileWriter::SetFilename ( const std::string &  filename)

Specifies the file to write. This is forwarded to the IO instance.

void btk::AcquisitionFileWriter::SetInput ( Acquisition::Pointer  input)
inline

Sets the Acquisition to write by a AcquisitionIO helper class.

Member Data Documentation

btk::AcquisitionFileWriter::m_AcquisitionIO
protected

AcquisitionFileIO helper class to read the acquisition data and fill an Acquisition object.

btk::AcquisitionFileWriter::m_Filename
protected

Path of the file to read.