Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <mitkUSImageLoggingFilter.h>
Public Member Functions | |
mitkClassMacro (USImageLoggingFilter, mitk::ImageToImageFilter) | |
virtual 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) |
InputImageType * | GetInput (void) |
InputImageType * | GetInput (unsigned int idx) |
const InputImageType * | GetInput (void) const |
const InputImageType * | GetInput (unsigned int idx) const |
Public Member Functions inherited from mitk::ImageSource | |
Pointer | Clone () const |
OutputType * | GetOutput () |
Get the output data of this image source object. More... | |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (DataObjectPointerArraySizeType idx) const |
virtual itk::DataObject::Pointer | MakeOutput (DataObjectPointerArraySizeType idx) override |
Make a DataObject of the correct type to used as the specified output. More... | |
virtual itk::DataObject::Pointer | MakeOutput (const DataObjectIdentifierType &name) override |
virtual vtkImageData * | GetVtkImageData () |
virtual const vtkImageData * | GetVtkImageData () const |
Public Member Functions inherited from mitk::BaseDataSource | |
OutputType * | GetOutput () |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (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::Pointer > | ImageCollection |
Protected Member Functions | |
USImageLoggingFilter () | |
virtual | ~USImageLoggingFilter () |
Protected Member Functions inherited from mitk::ImageToImageFilter | |
ImageToImageFilter () | |
virtual | ~ImageToImageFilter () |
virtual void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
virtual void | GenerateInputRequestedRegion () override |
Protected Member Functions inherited from mitk::ImageSource | |
ImageSource () | |
virtual | ~ImageSource () |
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... | |
virtual 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 () | |
virtual | ~BaseDataSource () |
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... | |
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 36 of file mitkUSImageLoggingFilter.h.
|
protected |
Definition at line 83 of file mitkUSImageLoggingFilter.h.
|
protected |
Definition at line 28 of file mitkUSImageLoggingFilter.cpp.
|
protectedvirtual |
Definition at line 33 of file mitkUSImageLoggingFilter.cpp.
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.
message | The string which contains the message which is logged to the current image |
Definition at line 84 of file mitkUSImageLoggingFilter.cpp.
|
overridevirtual |
This method is internally called by the Update() mechanism of the pipeline. Don't call it directly.
Reimplemented from mitk::ImageSource.
Definition at line 37 of file mitkUSImageLoggingFilter.cpp.
References MITK_WARN.
mitk::USImageLoggingFilter::mitkClassMacro | ( | USImageLoggingFilter | , |
mitk::ImageToImageFilter | |||
) |
|
static |
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.
[in] | path | Should contain a valid path were all logging data will be stored. |
[out] | imageFilenames | Returns a list of all images filenames which were stored to the harddisc. |
[out] | csvFileName | Returns the filename of the csv list with the timestamps and the messages. |
mitk::Exception | Throws an exception if there is a problem during writing the images. E.g., if the path is not valid / not writable. |
Definition at line 96 of file mitkUSImageLoggingFilter.cpp.
References mitk::UIDGenerator::GetUID(), mitkThrow, and mitk::IOUtil::Save().
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.
[in] | path | Should contain a valid path were all logging data will be stored. |
mitk::Exception | Throws an exception if there is a problem during writing the images. E.g., if the path is not valid / not writable. |
Definition at line 89 of file mitkUSImageLoggingFilter.cpp.
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.
Definition at line 146 of file mitkUSImageLoggingFilter.cpp.
References mitk::IOMimeTypes::CATEGORY_IMAGES(), mitk::CoreServices::GetMimeTypeProvider(), and mitk::IMimeTypeProvider::GetMimeTypesForCategory().
|
protected |
stores the image extension, default is ".nrrd"
Definition at line 90 of file mitkUSImageLoggingFilter.h.
|
protected |
An image collection for every input. The string identifies the input.
Definition at line 87 of file mitkUSImageLoggingFilter.h.
|
protected |
(Optional) messages for every logged image
Definition at line 88 of file mitkUSImageLoggingFilter.h.
|
protected |
Logged system times for every logged image.
Definition at line 89 of file mitkUSImageLoggingFilter.h.
|
protected |
system time clock for system time tag
Definition at line 84 of file mitkUSImageLoggingFilter.h.