ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkSimpleFilterWatcher.h>
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 67 of file itkSimpleFilterWatcher.h.
typedef SimpleMemberCommand< SimpleFilterWatcher > itk::SimpleFilterWatcher::CommandType [private] |
Definition at line 237 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.
Copy constructor
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 199 of file itkSimpleFilterWatcher.h.
std::string itk::SimpleFilterWatcher::GetComment | ( | ) | [inline] |
Get the comment for the watcher.
Definition at line 129 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::StartFilter().
int itk::SimpleFilterWatcher::GetIterations | ( | ) | [inline] |
Set/Get the number of iterations completed.
Definition at line 119 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 89 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 110 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
bool itk::SimpleFilterWatcher::GetQuiet | ( | ) | [inline] |
Set/Get the quiet mode boolean. If true, verbose progress is reported.
Definition at line 125 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
int itk::SimpleFilterWatcher::GetSteps | ( | ) | [inline] |
Set/Get the steps completed.
Definition at line 114 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::ShowProgress().
TimeProbe& itk::SimpleFilterWatcher::GetTimeProbe | ( | ) | [inline] |
Get a reference to the TimeProbe
Definition at line 132 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 97 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 96 of file itkSimpleFilterWatcher.h.
void itk::SimpleFilterWatcher::SetIterations | ( | int | val | ) | [inline] |
Set/Get the number of iterations completed.
Definition at line 118 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 124 of file itkSimpleFilterWatcher.h.
void itk::SimpleFilterWatcher::SetSteps | ( | int | val | ) | [inline] |
Set/Get the steps completed.
Definition at line 113 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 161 of file itkSimpleFilterWatcher.h.
virtual void itk::SimpleFilterWatcher::ShowIteration | ( | ) | [inline, protected, virtual] |
Callback method to show the IterationEvent
Definition at line 167 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 136 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 174 of file itkSimpleFilterWatcher.h.
References itk::ResourceProbe< ValueType, MeanType >::Start().
void itk::SimpleFilterWatcher::TestAbortOff | ( | ) | [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 104 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 103 of file itkSimpleFilterWatcher.h.
Definition at line 242 of file itkSimpleFilterWatcher.h.
unsigned long itk::SimpleFilterWatcher::m_AbortTag [private] |
Definition at line 248 of file itkSimpleFilterWatcher.h.
std::string itk::SimpleFilterWatcher::m_Comment [private] |
Definition at line 234 of file itkSimpleFilterWatcher.h.
Definition at line 239 of file itkSimpleFilterWatcher.h.
unsigned long itk::SimpleFilterWatcher::m_EndTag [private] |
Definition at line 245 of file itkSimpleFilterWatcher.h.
Definition at line 241 of file itkSimpleFilterWatcher.h.
int itk::SimpleFilterWatcher::m_Iterations [private] |
Definition at line 231 of file itkSimpleFilterWatcher.h.
unsigned long itk::SimpleFilterWatcher::m_IterationTag [private] |
Definition at line 247 of file itkSimpleFilterWatcher.h.
Definition at line 235 of file itkSimpleFilterWatcher.h.
Definition at line 240 of file itkSimpleFilterWatcher.h.
unsigned long itk::SimpleFilterWatcher::m_ProgressTag [private] |
Definition at line 246 of file itkSimpleFilterWatcher.h.
bool itk::SimpleFilterWatcher::m_Quiet [private] |
Definition at line 232 of file itkSimpleFilterWatcher.h.
Definition at line 238 of file itkSimpleFilterWatcher.h.
unsigned long itk::SimpleFilterWatcher::m_StartTag [private] |
Definition at line 244 of file itkSimpleFilterWatcher.h.
int itk::SimpleFilterWatcher::m_Steps [private] |
Definition at line 230 of file itkSimpleFilterWatcher.h.
bool itk::SimpleFilterWatcher::m_TestAbort [private] |
Definition at line 233 of file itkSimpleFilterWatcher.h.
Definition at line 229 of file itkSimpleFilterWatcher.h.