MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::NavigationDataCSVSequentialPlayer Class Reference

This class is a NavigationDataPlayer which can play CSV formatted files in sequential order, which means it doesn't care about timestamps and just outputs the navigationdatas in their sequential order. More...

#include <mitkNavigationDataCSVSequentialPlayer.h>

Inheritance diagram for mitk::NavigationDataCSVSequentialPlayer:
mitk::NavigationDataPlayerBase mitk::NavigationDataSource

Public Types

enum  Filetype { NavigationDataCSV , ManualLoggingCSV }
 

Public Member Functions

 mitkClassMacro (NavigationDataCSVSequentialPlayer, NavigationDataPlayerBase)
 
 itkNewMacro (Self)
 
void SetFileName (const std::string &_FileName)
 sets the file name and path (if XMLString is set, this is neglected)
 
void SetOptions (bool rightHanded, char seperatorSign, int sampleCount, bool headerRow, int xPos, int yPos, int zPos, bool useQuats, int qx, int qy, int qz, int qr, int azimuth, int elevatino, int roll, bool eulerInRadiants, int minNumberOfColums)
 SetOptions sets the options for reading out the data out of the correct positions of the file. They need to be set before using the player.
 
 itkGetStringMacro (FileName)
 returns the file name and path
 
 itkSetMacro (Filetype, Filetype)
 Sets the file type. ManualLoggingCSV is default and is thought for your custom csv files. You can also set it to NavigationDataCSV, then this player interprets MITK style csv files.
 
bool IsAtEnd ()
 
void UpdateOutputInformation () override
 Used for pipeline update just to tell the pipeline that we always have to update.
 
int GetNumberOfSnapshots ()
 
- Public Member Functions inherited from mitk::NavigationDataPlayerBase
 mitkClassMacro (NavigationDataPlayerBase, NavigationDataSource)
 
 itkSetMacro (Repeat, bool)
 Set to true if the data player should repeat the outputs.
 
 itkGetMacro (Repeat, bool)
 
void UpdateOutputInformation () override
 Used for pipeline update just to tell the pipeline that we always have to update.
 
 itkGetMacro (NavigationDataSet, NavigationDataSet::Pointer)
 
void SetNavigationDataSet (NavigationDataSet::Pointer navigationDataSet)
 Set mitk::NavigationDataSet for playing. Player is initialized by call to mitk::NavigationDataPlayerBase::InitPlayer() inside this method. Method must be called before this object can be used as a filter source.
 
unsigned int GetNumberOfSnapshots ()
 Getter for the size of the mitk::NavigationDataSet used in this object.
 
unsigned int GetCurrentSnapshotNumber ()
 
bool IsAtEnd ()
 This method checks if player arrived at end of file.
 
- Public Member Functions inherited from mitk::NavigationDataSource
 mitkClassMacroItkParent (NavigationDataSource, itk::ProcessObject)
 
 itkGetMacro (Name, std::string)
 
 itkSetMacro (Name, std::string)
 Sets the human readable name of this source. There is also a default name, but you can use this method if you need to define it on your own.
 
NavigationDataGetOutput (void)
 return the output (output with id 0) of the filter
 
NavigationDataGetOutput (DataObjectPointerArraySizeType idx)
 return the output with id idx of the filter
 
NavigationDataGetOutput (const std::string &navDataName)
 return the output with name navDataName of the filter
 
NavigationTool::Pointer GetToolMetaData (DataObjectPointerArraySizeType idx)
 
NavigationTool::Pointer GetToolMetaData (const std::string &navDataName)
 
 itkGetMacro (ToolMetaDataCollection, mitk::NavigationToolStorage::Pointer)
 
 itkSetMacro (ToolMetaDataCollection, mitk::NavigationToolStorage::Pointer)
 
DataObjectPointerArraySizeType GetOutputIndex (std::string navDataName)
 return the index of the output with name navDataName, -1 if no output with that name was found
 
virtual void RegisterAsMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin. To unregister, call UnregisterMicroservice().
 
virtual void UnRegisterMicroservice ()
 Registers this object as a Microservice, making it available to every module and/or plugin.
 
std::string GetMicroserviceID ()
 Returns the id that this device is registered with. The id will only be valid, if the NavigationDataSource has been registered using RegisterAsMicroservice().
 
virtual void GraftNthOutput (unsigned int idx, itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
 
virtual void GraftOutput (itk::DataObject *graft)
 Graft the specified DataObject onto this ProcessObject's output.
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual void SetParameters (const mitk::PropertyList *)
 Set all filter parameters as the PropertyList p.
 
virtual mitk::PropertyList::ConstPointer GetParameters () const
 Get all filter parameters as a PropertyList.
 
virtual void Freeze ()
 
virtual void UnFreeze ()
 
 itkGetMacro (IsFrozen, bool)
 

Protected Member Functions

 NavigationDataCSVSequentialPlayer ()
 
 ~NavigationDataCSVSequentialPlayer () override
 
void GenerateData () override
 
std::vector< mitk::NavigationData::Pointer > GetNavigationDatasFromFile (std::string filename)
 
std::vector< std::string > GetFileContentLineByLine (std::string filename)
 
mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine (std::string line)
 
void FillOutputEmpty (int number)
 
mitk::NavigationData::Pointer GetEmptyNavigationData ()
 
- Protected Member Functions inherited from mitk::NavigationDataPlayerBase
 NavigationDataPlayerBase ()
 
 ~NavigationDataPlayerBase () override
 
void InitPlayer ()
 Initializes the outputs of this NavigationDataSource. Aftwer calling this method, the first Navigationdata from the loaded Navigationdataset is loaded into the outputs.
 
void GraftEmptyOutput ()
 Convenience method for subclasses. When there are no further mitk::NavigationData objects available, this method can be called in the implementation of mitk::NavigationDataPlayerBase::GenerateData().
 
- Protected Member Functions inherited from mitk::NavigationDataSource
 NavigationDataSource ()
 
 ~NavigationDataSource () override
 

Protected Attributes

std::string m_FileName
 
int m_CurrentPos
 
Filetype m_Filetype
 
std::vector< mitk::NavigationData::Pointer > m_NavigationDatas
 
bool m_RightHanded
 
char m_SeparatorSign
 
int m_SampleCount
 
bool m_HeaderRow
 
int m_XPos
 
int m_YPos
 
int m_ZPos
 
bool m_UseQuats
 
int m_Qx
 
int m_Qy
 
int m_Qz
 
int m_Qr
 
int m_Azimuth
 
int m_Elevation
 
int m_Roll
 
bool m_EulersInRadiants
 
int m_MinNumberOfColumns
 
- Protected Attributes inherited from mitk::NavigationDataPlayerBase
bool m_Repeat
 If the player should repeat outputs. Default is false.
 
NavigationDataSet::Pointer m_NavigationDataSet
 
mitk::NavigationDataSet::NavigationDataSetConstIterator m_NavigationDataSetIterator
 Iterator always points to the NavigationData object which is in the outputs at the moment.
 
- Protected Attributes inherited from mitk::NavigationDataSource
std::string m_Name
 
bool m_IsFrozen
 
NavigationToolStorage::Pointer m_ToolMetaDataCollection
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::NavigationDataSource
static const std::string US_INTERFACE_NAME = "org.mitk.services.NavigationDataSource"
 These Constants are used in conjunction with Microservices.
 
static const std::string US_PROPKEY_DEVICENAME = US_INTERFACE_NAME + ".devicename"
 
static const std::string US_PROPKEY_ID = US_INTERFACE_NAME + ".id"
 
static const std::string US_PROPKEY_ISACTIVE = US_INTERFACE_NAME + ".isActive"
 

Detailed Description

This class is a NavigationDataPlayer which can play CSV formatted files in sequential order, which means it doesn't care about timestamps and just outputs the navigationdatas in their sequential order.

Documentation

It is thought to interpret custom csv files. To do so please adapt the column numbers of position and orientation in the internal method GetNavigationDataOutOfOneLine().

So far only one (the first) tool is read in as required for the hummel protocol measurements.

This class can also interpret MITK style csv files (set filetype to NavigationDataCSV), but you can also use the MITK navigation data player class inside the MITK-IGT module which is newer and better maintained.

Definition at line 38 of file mitkNavigationDataCSVSequentialPlayer.h.

Member Enumeration Documentation

◆ Filetype

Enumerator
NavigationDataCSV 
ManualLoggingCSV 

Definition at line 79 of file mitkNavigationDataCSVSequentialPlayer.h.

Constructor & Destructor Documentation

◆ NavigationDataCSVSequentialPlayer()

mitk::NavigationDataCSVSequentialPlayer::NavigationDataCSVSequentialPlayer ( )
protected

Definition at line 19 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ ~NavigationDataCSVSequentialPlayer()

mitk::NavigationDataCSVSequentialPlayer::~NavigationDataCSVSequentialPlayer ( )
overrideprotected

Definition at line 28 of file mitkNavigationDataCSVSequentialPlayer.cpp.

Member Function Documentation

◆ FillOutputEmpty()

void mitk::NavigationDataCSVSequentialPlayer::FillOutputEmpty ( int number)
protected

Definition at line 49 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ GenerateData()

void mitk::NavigationDataCSVSequentialPlayer::GenerateData ( )
overrideprotectedvirtual

do the work here

Implements mitk::NavigationDataPlayerBase.

Definition at line 70 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ GetEmptyNavigationData()

mitk::NavigationData::Pointer mitk::NavigationDataCSVSequentialPlayer::GetEmptyNavigationData ( )
protected

Definition at line 54 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ GetFileContentLineByLine()

std::vector< std::string > mitk::NavigationDataCSVSequentialPlayer::GetFileContentLineByLine ( std::string filename)
protected

Definition at line 109 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ GetNavigationDataOutOfOneLine()

mitk::NavigationData::Pointer mitk::NavigationDataCSVSequentialPlayer::GetNavigationDataOutOfOneLine ( std::string line)
protected

Definition at line 149 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ GetNavigationDatasFromFile()

std::vector< mitk::NavigationData::Pointer > mitk::NavigationDataCSVSequentialPlayer::GetNavigationDatasFromFile ( std::string filename)
protected

Definition at line 93 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ GetNumberOfSnapshots()

int mitk::NavigationDataCSVSequentialPlayer::GetNumberOfSnapshots ( )

Definition at line 66 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ IsAtEnd()

bool mitk::NavigationDataCSVSequentialPlayer::IsAtEnd ( )
Returns
Returns true if the player reached the end of the file.

Definition at line 32 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ itkGetStringMacro()

mitk::NavigationDataCSVSequentialPlayer::itkGetStringMacro ( FileName )

returns the file name and path

◆ itkNewMacro()

mitk::NavigationDataCSVSequentialPlayer::itkNewMacro ( Self )

◆ itkSetMacro()

mitk::NavigationDataCSVSequentialPlayer::itkSetMacro ( Filetype ,
Filetype  )

Sets the file type. ManualLoggingCSV is default and is thought for your custom csv files. You can also set it to NavigationDataCSV, then this player interprets MITK style csv files.

◆ mitkClassMacro()

mitk::NavigationDataCSVSequentialPlayer::mitkClassMacro ( NavigationDataCSVSequentialPlayer ,
NavigationDataPlayerBase  )

◆ SetFileName()

void mitk::NavigationDataCSVSequentialPlayer::SetFileName ( const std::string & _FileName)

sets the file name and path (if XMLString is set, this is neglected)

Definition at line 37 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ SetOptions()

void mitk::NavigationDataCSVSequentialPlayer::SetOptions ( bool rightHanded,
char seperatorSign,
int sampleCount,
bool headerRow,
int xPos,
int yPos,
int zPos,
bool useQuats,
int qx,
int qy,
int qz,
int qr,
int azimuth,
int elevatino,
int roll,
bool eulerInRadiants,
int minNumberOfColums )

SetOptions sets the options for reading out the data out of the correct positions of the file. They need to be set before using the player.

Parameters
rightHandedtrue if the used coordinate System is right handed, false if it is left handed
seperatorSignsymbol that is used to separate the values in the .csv file
sampleCountevery n-th sample in the file that should be used
headerRowtrue if the .csv file has a header row otherwise false
xPosnumber of the column in the .csv file for the x-coordinates of the position
yPosnumber of the column in the .csv file for the y-coordinates of the position
zPosnumber of the column in the .csv file for the z-coordinates of the position
useQuatstrue if Quaternions are used to construct the orientation, false if Euler Angles are used
qxnumber of the column in the .csv file for the x component of the quaternion
qynumber of the column in the .csv file for the y component of the quaternion
qznumber of the column in the .csv file for the z component of the quaternion
qrnumber of the column in the .csv file for the r component of the quaternion
azimuthnumber of the column in the .csv file for Azimuth (Euler Angles). Set < 0 if angle is not defined
elevatinonumber of the column in the .csv file for Elevation (Euler Angles) Set < 0 if angle is not defined
rollnumber of the column in the .csv file for Roll (Euler Angles) Set < 0 if angle is not defined
eulerInRadiantstrue if the Euler Angles in the .csv file are in radiants, false if they are in degrees
minNumberOfColumns

Definition at line 289 of file mitkNavigationDataCSVSequentialPlayer.cpp.

◆ UpdateOutputInformation()

void mitk::NavigationDataCSVSequentialPlayer::UpdateOutputInformation ( )
override

Used for pipeline update just to tell the pipeline that we always have to update.

Definition at line 87 of file mitkNavigationDataCSVSequentialPlayer.cpp.

Member Data Documentation

◆ m_Azimuth

int mitk::NavigationDataCSVSequentialPlayer::m_Azimuth
protected

Definition at line 140 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_CurrentPos

int mitk::NavigationDataCSVSequentialPlayer::m_CurrentPos
protected

Definition at line 115 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_Elevation

int mitk::NavigationDataCSVSequentialPlayer::m_Elevation
protected

Definition at line 141 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_EulersInRadiants

bool mitk::NavigationDataCSVSequentialPlayer::m_EulersInRadiants
protected

Definition at line 143 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_FileName

std::string mitk::NavigationDataCSVSequentialPlayer::m_FileName
protected

Definition at line 113 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_Filetype

Filetype mitk::NavigationDataCSVSequentialPlayer::m_Filetype
protected

Definition at line 116 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_HeaderRow

bool mitk::NavigationDataCSVSequentialPlayer::m_HeaderRow
protected

Definition at line 131 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_MinNumberOfColumns

int mitk::NavigationDataCSVSequentialPlayer::m_MinNumberOfColumns
protected

Definition at line 144 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_NavigationDatas

std::vector<mitk::NavigationData::Pointer> mitk::NavigationDataCSVSequentialPlayer::m_NavigationDatas
protected

Definition at line 119 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_Qr

int mitk::NavigationDataCSVSequentialPlayer::m_Qr
protected

Definition at line 139 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_Qx

int mitk::NavigationDataCSVSequentialPlayer::m_Qx
protected

Definition at line 136 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_Qy

int mitk::NavigationDataCSVSequentialPlayer::m_Qy
protected

Definition at line 137 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_Qz

int mitk::NavigationDataCSVSequentialPlayer::m_Qz
protected

Definition at line 138 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_RightHanded

bool mitk::NavigationDataCSVSequentialPlayer::m_RightHanded
protected

Definition at line 128 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_Roll

int mitk::NavigationDataCSVSequentialPlayer::m_Roll
protected

Definition at line 142 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_SampleCount

int mitk::NavigationDataCSVSequentialPlayer::m_SampleCount
protected

Definition at line 130 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_SeparatorSign

char mitk::NavigationDataCSVSequentialPlayer::m_SeparatorSign
protected

Definition at line 129 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_UseQuats

bool mitk::NavigationDataCSVSequentialPlayer::m_UseQuats
protected

Definition at line 135 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_XPos

int mitk::NavigationDataCSVSequentialPlayer::m_XPos
protected

Definition at line 132 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_YPos

int mitk::NavigationDataCSVSequentialPlayer::m_YPos
protected

Definition at line 133 of file mitkNavigationDataCSVSequentialPlayer.h.

◆ m_ZPos

int mitk::NavigationDataCSVSequentialPlayer::m_ZPos
protected

Definition at line 134 of file mitkNavigationDataCSVSequentialPlayer.h.


The documentation for this class was generated from the following files: