![]() |
Orfeo Toolbox
3.16
|
Simple mechanism for monitoring the pipeline events of a filter and reporting these events to std::cout. More...
#include <itkSimpleFilterWatcher.h>
Inheritance diagram for itk::SimpleFilterWatcher:
Collaboration diagram for itk::SimpleFilterWatcher:Public Member Functions | |
| SimpleFilterWatcher (itk::ProcessObject *o, const char *comment="") | |
| SimpleFilterWatcher (const SimpleFilterWatcher &) | |
| SimpleFilterWatcher () | |
| virtual | ~SimpleFilterWatcher () |
| std::string | GetComment () |
| int | GetIterations () |
| const char * | GetNameOfClass () |
| ProcessObject * | GetProcess () |
| bool | GetQuiet () |
| int | GetSteps () |
| TimeProbe & | GetTimeProbe () |
| void | operator= (const SimpleFilterWatcher &) |
| void | QuietOff () |
| void | QuietOn () |
| void | SetIterations (int val) |
| void | SetQuiet (bool val) |
| void | SetSteps (int val) |
| void | TestAbortOff () |
| void | TestAbortOn () |
Protected Member Functions | |
| virtual void | EndFilter () |
| virtual void | ShowAbort () |
| virtual void | ShowIteration () |
| virtual void | ShowProgress () |
| virtual void | StartFilter () |
Private Types | |
| typedef SimpleMemberCommand < SimpleFilterWatcher > | CommandType |
Private Attributes | |
| CommandType::Pointer | m_AbortFilterCommand |
| unsigned long | m_AbortTag |
| std::string | m_Comment |
| CommandType::Pointer | m_EndFilterCommand |
| unsigned long | m_EndTag |
| CommandType::Pointer | m_IterationFilterCommand |
| int | m_Iterations |
| unsigned long | m_IterationTag |
| itk::ProcessObject::Pointer | m_Process |
| CommandType::Pointer | m_ProgressFilterCommand |
| unsigned long | m_ProgressTag |
| bool | m_Quiet |
| CommandType::Pointer | m_StartFilterCommand |
| unsigned long | m_StartTag |
| int | m_Steps |
| bool | m_TestAbort |
| TimeProbe | m_TimeProbe |
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.
|
private |
Definition at line 226 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.
Definition at line 27 of file itkSimpleFilterWatcher.cxx.
References EndFilter(), ShowAbort(), ShowIteration(), ShowProgress(), and StartFilter().
| itk::SimpleFilterWatcher::SimpleFilterWatcher | ( | const SimpleFilterWatcher & | watch | ) |
Copy constructor
Definition at line 91 of file itkSimpleFilterWatcher.cxx.
References EndFilter(), m_Comment, m_Iterations, m_Process, m_Quiet, m_Steps, m_TestAbort, m_TimeProbe, ShowAbort(), ShowIteration(), ShowProgress(), and StartFilter().
| itk::SimpleFilterWatcher::SimpleFilterWatcher | ( | ) |
Default constructor. Only provided so that you can have std::vectors of SimpleFilterWatchers.
Definition at line 74 of file itkSimpleFilterWatcher.cxx.
|
virtual |
Destructor.
Definition at line 245 of file itkSimpleFilterWatcher.cxx.
|
inlineprotectedvirtual |
Callback method to show the EndEvent
Reimplemented in itk::XMLFilterWatcher.
Definition at line 189 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
inline |
Get the comment for the watcher.
Definition at line 120 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::StartFilter().
|
inline |
Definition at line 112 of file itkSimpleFilterWatcher.h.
|
inline |
Method to get the name of the class be monitored by this SimpleFilterWatcher
Definition at line 86 of file itkSimpleFilterWatcher.h.
|
inline |
Methods to access member data Get a pointer to the process object being watched.
Definition at line 104 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
|
inline |
Definition at line 117 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
|
inline |
Definition at line 108 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::ShowProgress().
|
inline |
Get a reference to the TimeProbe
Definition at line 123 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::EndFilter(), and itk::XMLFilterWatcher::StartFilter().
| void itk::SimpleFilterWatcher::operator= | ( | const SimpleFilterWatcher & | watch | ) |
operator=
Definition at line 169 of file itkSimpleFilterWatcher.cxx.
References EndFilter(), m_Comment, m_Iterations, m_Process, m_Quiet, m_Steps, m_TestAbort, m_TimeProbe, ShowAbort(), ShowIteration(), ShowProgress(), and StartFilter().
|
inline |
Definition at line 94 of file itkSimpleFilterWatcher.h.
|
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.
|
inline |
Set/Get the number of iterations completed.
Definition at line 111 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::StartFilter().
|
inline |
Set/Get the quiet mode boolean. If true, verbose progress is reported.
Definition at line 116 of file itkSimpleFilterWatcher.h.
|
inline |
Set/Get the steps completed.
Definition at line 107 of file itkSimpleFilterWatcher.h.
Referenced by itk::XMLFilterWatcher::ShowProgress(), and itk::XMLFilterWatcher::StartFilter().
|
inlineprotectedvirtual |
Callback method to show the AbortEvent
Definition at line 152 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
inlineprotectedvirtual |
Callback method to show the IterationEvent
Definition at line 158 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
inlineprotectedvirtual |
Callback method to show the ProgressEvent
Reimplemented in itk::XMLFilterWatcher.
Definition at line 128 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
inlineprotectedvirtual |
Callback method to show the StartEvent
Reimplemented in itk::XMLFilterWatcher.
Definition at line 165 of file itkSimpleFilterWatcher.h.
References itk::ResourceProbe< ValueType, MeanType >::Start().
Referenced by operator=(), and SimpleFilterWatcher().
|
inline |
Definition at line 100 of file itkSimpleFilterWatcher.h.
|
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 99 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 231 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 237 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 223 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
private |
Definition at line 228 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 234 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 230 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 220 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
private |
Definition at line 236 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 224 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
private |
Definition at line 229 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 235 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 221 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
private |
Definition at line 227 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 233 of file itkSimpleFilterWatcher.h.
|
private |
Definition at line 219 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
private |
Definition at line 222 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().
|
private |
Definition at line 218 of file itkSimpleFilterWatcher.h.
Referenced by operator=(), and SimpleFilterWatcher().