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

#include <mitkUSImageLoggingFilter.h>

Inheritance diagram for mitk::USImageLoggingFilter:

Public Member Functions

 mitkClassMacro (USImageLoggingFilter, mitk::ImageToImageFilter)
 
 itkNewMacro (USImageLoggingFilter)
 
void GenerateData () override
 
void AddMessageToCurrentImage (std::string message)
 
void SaveImages (std::string path, std::vector< std::string > &imageFilenames, std::string &csvFileName)
 
void SaveImages (std::string path)
 
bool SetImageFilesExtension (std::string extension)
 

Protected Types

typedef std::vector< mitk::Image::Pointer > ImageCollection
 

Protected Member Functions

 USImageLoggingFilter ()
 
 ~USImageLoggingFilter () override
 

Protected Attributes

mitk::RealTimeClock::Pointer m_SystemTimeClock
 system time clock for system time tag
 
ImageCollection m_LoggedImages
 An image collection for every input. The string identifies the input.
 
std::map< int, std::string > m_LoggedMessages
 (Optional) messages for every logged image
 
std::vector< double > m_LoggedMITKSystemTimes
 Logged system times for every logged image.
 
std::string m_ImageExtension
 stores the image extension, default is ".nrrd"
 

Detailed Description

An object of this class is a filter which saves/logs a clone of the current image whenever Update() is called. Additionally a timestamp of this image is saved. Optionally you can add messages. All data (images, timestamps and messages) is written to the harddisc when the method SaveImages(...) is called.

Caution: only supports logging of one input at the moment, multiple inputs are ignored!

Definition at line 32 of file mitkUSImageLoggingFilter.h.

Member Typedef Documentation

◆ ImageCollection

std::vector<mitk::Image::Pointer> mitk::USImageLoggingFilter::ImageCollection
protected

Definition at line 79 of file mitkUSImageLoggingFilter.h.

Constructor & Destructor Documentation

◆ USImageLoggingFilter()

mitk::USImageLoggingFilter::USImageLoggingFilter ( )
protected

Definition at line 24 of file mitkUSImageLoggingFilter.cpp.

◆ ~USImageLoggingFilter()

mitk::USImageLoggingFilter::~USImageLoggingFilter ( )
overrideprotected

Definition at line 29 of file mitkUSImageLoggingFilter.cpp.

Member Function Documentation

◆ AddMessageToCurrentImage()

void mitk::USImageLoggingFilter::AddMessageToCurrentImage ( std::string message)

Adds a message to the current (last logged) image. This message is internally stored and written to the harddisc when SaveImages(...) is called.

Parameters
messageThe string which contains the message which is logged to the current image

Definition at line 80 of file mitkUSImageLoggingFilter.cpp.

◆ GenerateData()

void mitk::USImageLoggingFilter::GenerateData ( )
override

This method is internally called by the Update() mechanism of the pipeline. Don't call it directly.

Definition at line 33 of file mitkUSImageLoggingFilter.cpp.

◆ itkNewMacro()

mitk::USImageLoggingFilter::itkNewMacro ( USImageLoggingFilter )

◆ mitkClassMacro()

mitk::USImageLoggingFilter::mitkClassMacro ( USImageLoggingFilter ,
mitk::ImageToImageFilter  )

◆ SaveImages() [1/2]

void mitk::USImageLoggingFilter::SaveImages ( std::string path)

Saves all logged data to the given path. Every image is written to a separate image file. Additionaly a csv file containing a list of all images together with timestamps and messages is saved. For one call of this method all files will start with a unique number to avoid overwrite of old files.

Parameters
[in]pathShould contain a valid path were all logging data will be stored.
Exceptions
mitk::ExceptionThrows an exception if there is a problem during writing the images. E.g., if the path is not valid / not writable.

Definition at line 85 of file mitkUSImageLoggingFilter.cpp.

◆ SaveImages() [2/2]

void mitk::USImageLoggingFilter::SaveImages ( std::string path,
std::vector< std::string > & imageFilenames,
std::string & csvFileName )

Saves all logged data to the given path. Every image is written to a separate image file. Additionaly a csv file containing a list of all images together with timestamps and messages is saved. For one call of this method all files will start with a unique number to avoid overwrite of old files.

Parameters
[in]pathShould contain a valid path were all logging data will be stored.
[out]imageFilenamesReturns a list of all images filenames which were stored to the harddisc.
[out]csvFileNameReturns the filename of the csv list with the timestamps and the messages.
Exceptions
mitk::ExceptionThrows an exception if there is a problem during writing the images. E.g., if the path is not valid / not writable.

Definition at line 92 of file mitkUSImageLoggingFilter.cpp.

◆ SetImageFilesExtension()

bool mitk::USImageLoggingFilter::SetImageFilesExtension ( std::string extension)

Sets the extension of the output images which alse defines the file type. E.g., ".nrrd" or ".jpg". ".nrrd" is default.

Returns
Returns true if the file extension was successfully set which means it is supported. False if not.

Definition at line 142 of file mitkUSImageLoggingFilter.cpp.

Member Data Documentation

◆ m_ImageExtension

std::string mitk::USImageLoggingFilter::m_ImageExtension
protected

stores the image extension, default is ".nrrd"

Definition at line 86 of file mitkUSImageLoggingFilter.h.

◆ m_LoggedImages

ImageCollection mitk::USImageLoggingFilter::m_LoggedImages
protected

An image collection for every input. The string identifies the input.

Definition at line 83 of file mitkUSImageLoggingFilter.h.

◆ m_LoggedMessages

std::map<int, std::string> mitk::USImageLoggingFilter::m_LoggedMessages
protected

(Optional) messages for every logged image

Definition at line 84 of file mitkUSImageLoggingFilter.h.

◆ m_LoggedMITKSystemTimes

std::vector<double> mitk::USImageLoggingFilter::m_LoggedMITKSystemTimes
protected

Logged system times for every logged image.

Definition at line 85 of file mitkUSImageLoggingFilter.h.

◆ m_SystemTimeClock

mitk::RealTimeClock::Pointer mitk::USImageLoggingFilter::m_SystemTimeClock
protected

system time clock for system time tag

Definition at line 80 of file mitkUSImageLoggingFilter.h.


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