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

Logs data node properties to an XML file. More...

#include <mitkUSNavigationExperimentLogging.h>

Inheritance diagram for mitk::USNavigationExperimentLogging:

Public Member Functions

 mitkClassMacroItkParent (USNavigationExperimentLogging, itk::Object)
 
 itkNewMacro (USNavigationExperimentLogging)
 
void Reset ()
 Clears the XML tree. Can be used to start logging a new experiment. Make sure that the output file name was changed by calling SetFileName() before setting a new result by calling SetResult() if you do not want your previous results to be overwritten.
 
void SetFileName (const std::string &fileName)
 Setter for the file path and name of the XML file.
 
void SetResult (const itk::SmartPointer< mitk::DataNode > resultNode)
 The properties of the given node are appended to the XML tree. The data node gets its own XML node under the root of the XML tree and the XML node will get the name of the data node as its name. The properties of the data node are stored as nodes under this XML node. The current tree is written to the output file on every call of this method.
 
 itkSetMacro (KeyPrefix, std::string)
 Only properties with this prefix are written into the output file.
 
 itkGetMacro (KeyPrefix, std::string)
 

Protected Member Functions

 USNavigationExperimentLogging ()
 Constructs an empty XML tree and starts the real time clock.
 
 ~USNavigationExperimentLogging () override
 
void AddCurrentTimeAttributes (Poco::AutoPtr< Poco::XML::Element >)
 
void WriteXmlToFile ()
 Does the actual writing of the complete XML tree to the file system.
 

Protected Attributes

std::string m_KeyPrefix
 
std::string m_FileName
 
unsigned int m_CurrentResultNumber
 
itk::SmartPointer< itk::RealTimeClock > m_RealTimeClock
 
double m_StartTime
 
Poco::AutoPtr< Poco::XML::Document > m_OutputXML
 
Poco::AutoPtr< Poco::XML::Element > m_OutputXMLRoot
 

Detailed Description

Logs data node properties to an XML file.

Definition at line 41 of file mitkUSNavigationExperimentLogging.h.

Constructor & Destructor Documentation

◆ USNavigationExperimentLogging()

mitk::USNavigationExperimentLogging::USNavigationExperimentLogging ( )
protected

Constructs an empty XML tree and starts the real time clock.

Definition at line 25 of file mitkUSNavigationExperimentLogging.cpp.

◆ ~USNavigationExperimentLogging()

mitk::USNavigationExperimentLogging::~USNavigationExperimentLogging ( )
overrideprotected

Definition at line 32 of file mitkUSNavigationExperimentLogging.cpp.

Member Function Documentation

◆ AddCurrentTimeAttributes()

void mitk::USNavigationExperimentLogging::AddCurrentTimeAttributes ( Poco::AutoPtr< Poco::XML::Element > element)
protected

Definition at line 89 of file mitkUSNavigationExperimentLogging.cpp.

◆ itkGetMacro()

mitk::USNavigationExperimentLogging::itkGetMacro ( KeyPrefix ,
std::string  )

◆ itkNewMacro()

mitk::USNavigationExperimentLogging::itkNewMacro ( USNavigationExperimentLogging )

◆ itkSetMacro()

mitk::USNavigationExperimentLogging::itkSetMacro ( KeyPrefix ,
std::string  )

Only properties with this prefix are written into the output file.

◆ mitkClassMacroItkParent()

mitk::USNavigationExperimentLogging::mitkClassMacroItkParent ( USNavigationExperimentLogging ,
itk::Object  )

◆ Reset()

void mitk::USNavigationExperimentLogging::Reset ( )

Clears the XML tree. Can be used to start logging a new experiment. Make sure that the output file name was changed by calling SetFileName() before setting a new result by calling SetResult() if you do not want your previous results to be overwritten.

The real time clock is restarted, too.

Definition at line 36 of file mitkUSNavigationExperimentLogging.cpp.

◆ SetFileName()

void mitk::USNavigationExperimentLogging::SetFileName ( const std::string & fileName)

Setter for the file path and name of the XML file.

Definition at line 45 of file mitkUSNavigationExperimentLogging.cpp.

◆ SetResult()

void mitk::USNavigationExperimentLogging::SetResult ( const itk::SmartPointer< mitk::DataNode > resultNode)

The properties of the given node are appended to the XML tree. The data node gets its own XML node under the root of the XML tree and the XML node will get the name of the data node as its name. The properties of the data node are stored as nodes under this XML node. The current tree is written to the output file on every call of this method.

If a key prefix is set by SetKeyPrefix, only properties which keys that are starting with this prefix are stored in the XML tree. The prefix is cut from the resulting key for the XML tree.

Definition at line 50 of file mitkUSNavigationExperimentLogging.cpp.

◆ WriteXmlToFile()

void mitk::USNavigationExperimentLogging::WriteXmlToFile ( )
protected

Does the actual writing of the complete XML tree to the file system.

Definition at line 104 of file mitkUSNavigationExperimentLogging.cpp.

Member Data Documentation

◆ m_CurrentResultNumber

unsigned int mitk::USNavigationExperimentLogging::m_CurrentResultNumber
protected

Definition at line 98 of file mitkUSNavigationExperimentLogging.h.

◆ m_FileName

std::string mitk::USNavigationExperimentLogging::m_FileName
protected

Definition at line 97 of file mitkUSNavigationExperimentLogging.h.

◆ m_KeyPrefix

std::string mitk::USNavigationExperimentLogging::m_KeyPrefix
protected

Definition at line 95 of file mitkUSNavigationExperimentLogging.h.

◆ m_OutputXML

Poco::AutoPtr<Poco::XML::Document> mitk::USNavigationExperimentLogging::m_OutputXML
protected

Definition at line 103 of file mitkUSNavigationExperimentLogging.h.

◆ m_OutputXMLRoot

Poco::AutoPtr<Poco::XML::Element> mitk::USNavigationExperimentLogging::m_OutputXMLRoot
protected

Definition at line 104 of file mitkUSNavigationExperimentLogging.h.

◆ m_RealTimeClock

itk::SmartPointer<itk::RealTimeClock> mitk::USNavigationExperimentLogging::m_RealTimeClock
protected

Definition at line 100 of file mitkUSNavigationExperimentLogging.h.

◆ m_StartTime

double mitk::USNavigationExperimentLogging::m_StartTime
protected

Definition at line 101 of file mitkUSNavigationExperimentLogging.h.


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