Simple mechanism for monitoring the pipeline events of a filter and reporting these events to std::cout. More...
#include <itkSimpleFilterWatcher.h>
Public Member Functions | |
std::string | GetComment () |
const char * | GetNameOfClass () |
ProcessObject * | GetProcess () |
TimeProbe & | GetTimeProbe () |
void | operator= (const SimpleFilterWatcher &) |
SimpleFilterWatcher () | |
SimpleFilterWatcher (const SimpleFilterWatcher &) | |
SimpleFilterWatcher (itk::ProcessObject *o, const char *comment="") | |
virtual | ~SimpleFilterWatcher () |
Protected Member Functions | |
virtual void | ShowAbort () |
virtual void | ShowIteration () |
| |
int | GetIterations () |
bool | GetQuiet () |
int | GetSteps () |
void | QuietOff () |
void | QuietOn () |
void | SetIterations (int val) |
void | SetQuiet (bool val) |
void | SetSteps (int val) |
void | TestAbortOff () |
void | TestAbortOn () |
virtual void | EndFilter () |
virtual void | ShowProgress () |
virtual void | StartFilter () |
Simple mechanism for monitoring the pipeline events of a filter and reporting these events to std::cout.
SimpleFilterWatcher provides a simple mechanism for monitoring the execution of filter. SimpleFilterWatcher is a stack-based object which takes a pointer to a ProcessObject at constructor time. SimpleFilterWatcher creates a series of commands that are registered as observers to the specified ProcessObject. The events monitored are:
StartEvent EndEvent ProgressEvent IterationEvent AbortEvent
The callbacks routines registered for these events emit a simple message to std::cout.
Example of use:
typedef itk::BinaryThresholdImageFilter<ImageType> FilterType; FilterType::Pointer thresholdFilter = FilterType::New();
SimpleFilterWatcher watcher(thresholdFilter, "Threshold");
The second argument to the constructor to SimpleFilterWatcher is an optional string that is prepended to the event messages. This allows the user to associate the emitted messages to a particular filter/variable.
Definition at line 64 of file itkSimpleFilterWatcher.h.
itk::SimpleFilterWatcher::SimpleFilterWatcher | ( | itk::ProcessObject * | o, | |
const char * | comment = "" | |||
) |
Constructor. Takes a ProcessObject to monitor and an optional comment string that is prepended to each event message.
itk::SimpleFilterWatcher::SimpleFilterWatcher | ( | const SimpleFilterWatcher & | ) |
Copy constructor
itk::SimpleFilterWatcher::SimpleFilterWatcher | ( | ) |
Default constructor. Only provided so that you can have std::vectors of SimpleFilterWatchers.
virtual itk::SimpleFilterWatcher::~SimpleFilterWatcher | ( | ) | [virtual] |
Destructor.
virtual void itk::SimpleFilterWatcher::EndFilter | ( | ) | [inline, protected, virtual] |
Callback method to show the EndEvent
Reimplemented in itk::XMLFilterWatcher.
Definition at line 197 of file itkSimpleFilterWatcher.h.
References itkExceptionMacro.
std::string itk::SimpleFilterWatcher::GetComment | ( | ) | [inline] |
Get the comment for the watcher.
Definition at line 126 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::StartFilter().
int itk::SimpleFilterWatcher::GetIterations | ( | ) | [inline] |
Methods to control the verbosity of the messages. Quiet reporting limits the information emitted at a ProgressEvent.
Definition at line 116 of file itkSimpleFilterWatcher.h.
const char* itk::SimpleFilterWatcher::GetNameOfClass | ( | ) | [inline] |
Method to get the name of the class be monitored by this SimpleFilterWatcher
Definition at line 86 of file itkSimpleFilterWatcher.h.
ProcessObject* itk::SimpleFilterWatcher::GetProcess | ( | ) | [inline] |
Methods to access member data Get a pointer to the process object being watched.
Definition at line 107 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
bool itk::SimpleFilterWatcher::GetQuiet | ( | ) | [inline] |
Methods to control the verbosity of the messages. Quiet reporting limits the information emitted at a ProgressEvent.
Definition at line 122 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
int itk::SimpleFilterWatcher::GetSteps | ( | ) | [inline] |
Methods to control the verbosity of the messages. Quiet reporting limits the information emitted at a ProgressEvent.
Definition at line 111 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::ShowProgress().
TimeProbe& itk::SimpleFilterWatcher::GetTimeProbe | ( | ) | [inline] |
Get a reference to the TimeProbe
Definition at line 129 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), and itk::XMLFilterWatcher::StartFilter().
void itk::SimpleFilterWatcher::operator= | ( | const SimpleFilterWatcher & | ) |
operator=
void itk::SimpleFilterWatcher::QuietOff | ( | ) | [inline] |
Methods to control the verbosity of the messages. Quiet reporting limits the information emitted at a ProgressEvent.
Definition at line 94 of file itkSimpleFilterWatcher.h.
void itk::SimpleFilterWatcher::QuietOn | ( | ) | [inline] |
Methods to control the verbosity of the messages. Quiet reporting limits the information emitted at a ProgressEvent.
Definition at line 93 of file itkSimpleFilterWatcher.h.
void itk::SimpleFilterWatcher::SetIterations | ( | int | val | ) | [inline] |
Set/Get the number of iterations completed.
Definition at line 115 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::StartFilter().
void itk::SimpleFilterWatcher::SetQuiet | ( | bool | val | ) | [inline] |
Set/Get the quiet mode boolean. If true, verbose progress is reported.
Definition at line 121 of file itkSimpleFilterWatcher.h.
void itk::SimpleFilterWatcher::SetSteps | ( | int | val | ) | [inline] |
Set/Get the steps completed.
Definition at line 110 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
virtual void itk::SimpleFilterWatcher::ShowAbort | ( | ) | [inline, protected, virtual] |
Callback method to show the AbortEvent
Definition at line 159 of file itkSimpleFilterWatcher.h.
virtual void itk::SimpleFilterWatcher::ShowIteration | ( | ) | [inline, protected, virtual] |
Callback method to show the IterationEvent
Definition at line 165 of file itkSimpleFilterWatcher.h.
virtual void itk::SimpleFilterWatcher::ShowProgress | ( | ) | [inline, protected, virtual] |
Callback method to show the ProgressEvent
Reimplemented in itk::XMLFilterWatcher.
Definition at line 134 of file itkSimpleFilterWatcher.h.
virtual void itk::SimpleFilterWatcher::StartFilter | ( | ) | [inline, protected, virtual] |
Callback method to show the StartEvent
Reimplemented in itk::XMLFilterWatcher.
Definition at line 172 of file itkSimpleFilterWatcher.h.
References itk::ResourceProbe< ValueType, MeanType >::Start().
void itk::SimpleFilterWatcher::TestAbortOff | ( | ) | [inline] |
Methods to control the verbosity of the messages. Quiet reporting limits the information emitted at a ProgressEvent.
Definition at line 101 of file itkSimpleFilterWatcher.h.
void itk::SimpleFilterWatcher::TestAbortOn | ( | ) | [inline] |
Methods to use to test the AbortEvent of the a filter. If TestAbort is on, the filter being watched will be aborted when the progress reaches 30%.
Definition at line 100 of file itkSimpleFilterWatcher.h.