Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitk::USImageLoggingFilter Class Reference

#include <mitkUSImageLoggingFilter.h>

Inheritance diagram for mitk::USImageLoggingFilter:
Collaboration diagram for mitk::USImageLoggingFilter:

Public Member Functions

 mitkClassMacro (USImageLoggingFilter, mitk::ImageToImageFilter)
 
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)
 
- Public Member Functions inherited from mitk::ImageToImageFilter
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
virtual void SetInput (const InputImageType *image)
 
virtual void SetInput (unsigned int, const InputImageType *image)
 
InputImageTypeGetInput (void)
 
InputImageTypeGetInput (unsigned int idx)
 
const InputImageTypeGetInput (void) const
 
const InputImageTypeGetInput (unsigned int idx) const
 
- Public Member Functions inherited from mitk::ImageSource
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Make a DataObject of the correct type to used as the specified output. More...
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 
virtual const vtkImageData * GetVtkImageData () const
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Access itk::ProcessObject::m_Updating. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageToImageFilter
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 

Protected Types

typedef std::vector< mitk::Image::PointerImageCollection
 

Protected Member Functions

 USImageLoggingFilter ()
 
 ~USImageLoggingFilter () override
 
- Protected Member Functions inherited from mitk::ImageToImageFilter
 ImageToImageFilter ()
 
 ~ImageToImageFilter () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
void GenerateInputRequestedRegion () override
 
- Protected Member Functions inherited from mitk::ImageSource
 ImageSource ()
 
 ~ImageSource () override
 
void GenerateData () override
 A version of GenerateData() specific for image processing filters. More...
 
virtual void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More...
 
void PrepareOutputs () override
 This method is intentionally left blank. More...
 
virtual void AllocateOutputs ()
 The GenerateData method normally allocates the buffers for all of the outputs of a filter. More...
 
virtual void BeforeThreadedGenerateData ()
 If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More...
 
virtual void AfterThreadedGenerateData ()
 If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More...
 
virtual unsigned int SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion)
 Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
 ~BaseDataSource () override
 

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from mitk::ImageToImageFilter
typedef ImageToImageFilter Self
 
typedef ImageSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::OutputImageRegionType OutputImageRegionType
 
typedef mitk::Image InputImageType
 
typedef InputImageType::Pointer InputImagePointer
 
typedef InputImageType::ConstPointer InputImageConstPointer
 
typedef SlicedData::RegionType InputImageRegionType
 
- Public Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 
- Static Protected Member Functions inherited from mitk::ImageSource
static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

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

Definition at line 79 of file mitkUSImageLoggingFilter.h.

Constructor & Destructor Documentation

◆ USImageLoggingFilter()

mitk::USImageLoggingFilter::USImageLoggingFilter ( )
protected

◆ ~USImageLoggingFilter()

mitk::USImageLoggingFilter::~USImageLoggingFilter ( )
overrideprotected

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

◆ GenerateData()

void mitk::USImageLoggingFilter::GenerateData ( )
override

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

◆ mitkClassMacro()

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

◆ New()

static Pointer mitk::USImageLoggingFilter::New ( )
static

◆ 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.

◆ 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.

◆ 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.

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 file: