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

This class records NavigationData objects. More...

#include <mitkNavigationDataRecorderDeprecated.h>

Inheritance diagram for mitk::NavigationDataRecorderDeprecated:

Public Types

enum  RecordingMode { Console , NormalFile , ZipFile }
 Determines where the output is directed to. More...
 
enum  OutputFormatEnum { xml , csv }
 Determines the output format. More...
 

Public Member Functions

 mitkClassMacroItkParent (NavigationDataRecorderDeprecated, itk::ProcessObject)
 
 itkNewMacro (Self)
 
 itkSetStringMacro (FileName)
 sets the file name for the OutputMode NormalFile and ZipFile
 
 itkGetStringMacro (FileName)
 Returns the file name of the recording file (in OutputMode NormalFile and ZipFile)
 
 itkSetMacro (DoNotOverwriteFiles, bool)
 If true the recorder will never overwrite a file.
 
 itkGetMacro (Recording, bool)
 Returns whether the NavigationDataRecorderDeprecated is recording or not.
 
 itkGetMacro (RecordingMode, RecordingMode)
 Returns the recording mode.
 
 itkGetMacro (RecordCounter, int)
 Returns the number of data sets / frames which were recorded by the NavigationDataRecorderDeprecated since start.
 
 itkSetMacro (RecordCountLimit, int)
 Sets a limit of recorded data sets / frames. Recording will be stopped if the number is reached. -1 disables the limit, -1 is default value as well.
 
virtual void AddNavigationData (const NavigationData *nd)
 Adds the input NavigationDatas.
 
void SetAdditionalAttribute (const NavigationData *nd, const std::string &attributeName, const std::string &attributeValue)
 
void RemoveAdditionalAttribute (const NavigationData *nd)
 
void StartRecording ()
 Starts the recording with the presetted OutputMode. This method calls StartRecording(std::ostream*). Does nothing if the recorder is already recording and the method StartRecording is called again.
 
void StartRecording (std::ostream *stream)
 Starts the recording with an own preinitialized stream Does nothing if it is already recording and method StartRecorded is called.
 
void StopRecording ()
 Stops the recording and closes the stream.
 
void Update () override
 Every call of update causes one line for each added NavigationData in the output if the recording was started.
 
void SetRecordingMode (RecordingMode mode)
 Sets the recording mode which causes different types of output streams see enum RecordingMode.
 
 itkSetMacro (OutputFormat, mitk::NavigationDataRecorderDeprecated::OutputFormatEnum)
 Sets the output format which causes different formats of output streams. The XML format is default. Also see enum OutputFormat for more information.
 

Protected Member Functions

void GenerateData () override
 filter execute method here it is not used
 
 NavigationDataRecorderDeprecated ()
 
 ~NavigationDataRecorderDeprecated () override
 

Protected Attributes

std::string m_FileName
 stores the file name and path
 
unsigned int m_NumberOfInputs
 counts the numbers of added input NavigationDatas
 
std::ostream * m_Stream
 the output stream
 
bool m_StreamMustBeDeleted
 
RecordingMode m_RecordingMode
 stores the mode see enum RecordingMode
 
OutputFormatEnum m_OutputFormat
 stores the output format; see enum OutputFormat
 
bool m_Recording
 indicates whether the recording is started or not
 
int m_RecordCounter
 counts the number of frames which are recorded since StartRecording
 
int m_RecordCountLimit
 limits the number of frames, recording will be stopped if the limit is reached. -1 disables the limit
 
bool m_firstLine
 
unsigned int m_NumberOfRecordedFiles
 necessary for the naming of the file if there is more than one start-stop cycle
 
mitk::RealTimeClock::Pointer m_SystemTimeClock
 system time clock for system time tag in output xml file
 
bool m_DoNotOverwriteFiles
 do not overwrite any files if true
 
std::map< const mitk::NavigationData *, std::pair< std::string, std::string > > m_AdditionalAttributes
 

Detailed Description

This class records NavigationData objects.

Documentation

The output of this class is formated as a XML document.

Internal this class uses streams for recording NavigationData objects. Therefore different types of output are possible and can be set with the SetOutputMode() method. The default output is directed to the console. If you want to save into a file you have to set a file name and the path. The recording is started with the call of the method StartRecording(). Now every Update() stores the current state of the added NavigationDatas. With StopRecording() the stream is stopped. With another call of StartRecording() the output is written to a new file with incremented filename counter.

Warning
At the moment there is no check if the file is already existing and this class will override existing files.

Definition at line 40 of file mitkNavigationDataRecorderDeprecated.h.

Member Enumeration Documentation

◆ OutputFormatEnum

Determines the output format.

Documentation

xml: XML format, also default, can be read by NavigationDataPlayer csv: use to export in excel, matlab, etc.

Enumerator
xml 
csv 

Definition at line 67 of file mitkNavigationDataRecorderDeprecated.h.

◆ RecordingMode

Determines where the output is directed to.

Documentation

Console: std::cout NormalFile: std::ofstream ZipFile: Not supported yet -> std::cout

Enumerator
Console 
NormalFile 
ZipFile 

Definition at line 54 of file mitkNavigationDataRecorderDeprecated.h.

Constructor & Destructor Documentation

◆ NavigationDataRecorderDeprecated()

mitk::NavigationDataRecorderDeprecated::NavigationDataRecorderDeprecated ( )
protected

Definition at line 23 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ ~NavigationDataRecorderDeprecated()

mitk::NavigationDataRecorderDeprecated::~NavigationDataRecorderDeprecated ( )
overrideprotected

Definition at line 43 of file mitkNavigationDataRecorderDeprecated.cpp.

Member Function Documentation

◆ AddNavigationData()

void mitk::NavigationDataRecorderDeprecated::AddNavigationData ( const NavigationData * nd)
virtual

Adds the input NavigationDatas.

Definition at line 53 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ GenerateData()

void mitk::NavigationDataRecorderDeprecated::GenerateData ( )
overrideprotected

filter execute method here it is not used

Documentation

Definition at line 48 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ itkGetMacro() [1/3]

mitk::NavigationDataRecorderDeprecated::itkGetMacro ( RecordCounter ,
int  )

Returns the number of data sets / frames which were recorded by the NavigationDataRecorderDeprecated since start.

◆ itkGetMacro() [2/3]

mitk::NavigationDataRecorderDeprecated::itkGetMacro ( Recording ,
bool  )

Returns whether the NavigationDataRecorderDeprecated is recording or not.

◆ itkGetMacro() [3/3]

mitk::NavigationDataRecorderDeprecated::itkGetMacro ( RecordingMode ,
RecordingMode  )

Returns the recording mode.

◆ itkGetStringMacro()

mitk::NavigationDataRecorderDeprecated::itkGetStringMacro ( FileName )

Returns the file name of the recording file (in OutputMode NormalFile and ZipFile)

◆ itkNewMacro()

mitk::NavigationDataRecorderDeprecated::itkNewMacro ( Self )

◆ itkSetMacro() [1/3]

mitk::NavigationDataRecorderDeprecated::itkSetMacro ( DoNotOverwriteFiles ,
bool  )

If true the recorder will never overwrite a file.

◆ itkSetMacro() [2/3]

mitk::NavigationDataRecorderDeprecated::itkSetMacro ( OutputFormat ,
mitk::NavigationDataRecorderDeprecated::OutputFormatEnum  )

Sets the output format which causes different formats of output streams. The XML format is default. Also see enum OutputFormat for more information.

Documentation

◆ itkSetMacro() [3/3]

mitk::NavigationDataRecorderDeprecated::itkSetMacro ( RecordCountLimit ,
int  )

Sets a limit of recorded data sets / frames. Recording will be stopped if the number is reached. -1 disables the limit, -1 is default value as well.

◆ itkSetStringMacro()

mitk::NavigationDataRecorderDeprecated::itkSetStringMacro ( FileName )

sets the file name for the OutputMode NormalFile and ZipFile

Any extensions will be cut

Warning
existing files will be overridden
do not use "." in file names at the end

◆ mitkClassMacroItkParent()

mitk::NavigationDataRecorderDeprecated::mitkClassMacroItkParent ( NavigationDataRecorderDeprecated ,
itk::ProcessObject  )

◆ RemoveAdditionalAttribute()

void mitk::NavigationDataRecorderDeprecated::RemoveAdditionalAttribute ( const NavigationData * nd)

Definition at line 230 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ SetAdditionalAttribute()

void mitk::NavigationDataRecorderDeprecated::SetAdditionalAttribute ( const NavigationData * nd,
const std::string & attributeName,
const std::string & attributeValue )

set an additional attribute for a specified navigation data this will be written for each navigation data and may be updated before calling Update()

Definition at line 214 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ SetRecordingMode()

void mitk::NavigationDataRecorderDeprecated::SetRecordingMode ( RecordingMode mode)

Sets the recording mode which causes different types of output streams see enum RecordingMode.

Documentation

Definition at line 64 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ StartRecording() [1/2]

void mitk::NavigationDataRecorderDeprecated::StartRecording ( )

Starts the recording with the presetted OutputMode. This method calls StartRecording(std::ostream*). Does nothing if the recorder is already recording and the method StartRecording is called again.

Documentation

Exceptions
mitk::IGTExceptionThrows an exception if no file name or file path is set.

Definition at line 238 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ StartRecording() [2/2]

void mitk::NavigationDataRecorderDeprecated::StartRecording ( std::ostream * stream)

Starts the recording with an own preinitialized stream Does nothing if it is already recording and method StartRecorded is called.

Documentation

Exceptions
mitk::IGTExceptionThrows an exception if the stream is not good.

m_Stream << "<Version Ver=\"1\" />" << std::endl;

Definition at line 310 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ StopRecording()

void mitk::NavigationDataRecorderDeprecated::StopRecording ( )

Stops the recording and closes the stream.

Documentation

Definition at line 342 of file mitkNavigationDataRecorderDeprecated.cpp.

◆ Update()

void mitk::NavigationDataRecorderDeprecated::Update ( )
override

Every call of update causes one line for each added NavigationData in the output if the recording was started.

Documentation

Definition at line 70 of file mitkNavigationDataRecorderDeprecated.cpp.

Member Data Documentation

◆ m_AdditionalAttributes

std::map<const mitk::NavigationData*, std::pair<std::string, std::string> > mitk::NavigationDataRecorderDeprecated::m_AdditionalAttributes
protected

Definition at line 205 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_DoNotOverwriteFiles

bool mitk::NavigationDataRecorderDeprecated::m_DoNotOverwriteFiles
protected

do not overwrite any files if true

Definition at line 203 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_FileName

std::string mitk::NavigationDataRecorderDeprecated::m_FileName
protected

stores the file name and path

Definition at line 179 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_firstLine

bool mitk::NavigationDataRecorderDeprecated::m_firstLine
protected

Definition at line 197 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_NumberOfInputs

unsigned int mitk::NavigationDataRecorderDeprecated::m_NumberOfInputs
protected

counts the numbers of added input NavigationDatas

Definition at line 181 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_NumberOfRecordedFiles

unsigned int mitk::NavigationDataRecorderDeprecated::m_NumberOfRecordedFiles
protected

necessary for the naming of the file if there is more than one start-stop cycle

Definition at line 199 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_OutputFormat

OutputFormatEnum mitk::NavigationDataRecorderDeprecated::m_OutputFormat
protected

stores the output format; see enum OutputFormat

Definition at line 189 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_RecordCounter

int mitk::NavigationDataRecorderDeprecated::m_RecordCounter
protected

counts the number of frames which are recorded since StartRecording

Definition at line 193 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_RecordCountLimit

int mitk::NavigationDataRecorderDeprecated::m_RecordCountLimit
protected

limits the number of frames, recording will be stopped if the limit is reached. -1 disables the limit

Definition at line 195 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_Recording

bool mitk::NavigationDataRecorderDeprecated::m_Recording
protected

indicates whether the recording is started or not

Definition at line 191 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_RecordingMode

RecordingMode mitk::NavigationDataRecorderDeprecated::m_RecordingMode
protected

stores the mode see enum RecordingMode

Definition at line 187 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_Stream

std::ostream* mitk::NavigationDataRecorderDeprecated::m_Stream
protected

the output stream

Definition at line 183 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_StreamMustBeDeleted

bool mitk::NavigationDataRecorderDeprecated::m_StreamMustBeDeleted
protected

Definition at line 185 of file mitkNavigationDataRecorderDeprecated.h.

◆ m_SystemTimeClock

mitk::RealTimeClock::Pointer mitk::NavigationDataRecorderDeprecated::m_SystemTimeClock
protected

system time clock for system time tag in output xml file

Definition at line 201 of file mitkNavigationDataRecorderDeprecated.h.


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