Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::SimpleFilterWatcher Class Reference

#include <itkSimpleFilterWatcher.h>

Inheritance diagram for itk::SimpleFilterWatcher:

Inheritance graph
[legend]
Collaboration diagram for itk::SimpleFilterWatcher:

Collaboration graph
[legend]
List of all members.

Detailed Description

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.

Todo:
Allow any stream object to be used for the output (not just std::cout)

Definition at line 63 of file itkSimpleFilterWatcher.h.

Public Member Functions

std::string GetComment ()
const char * GetNameOfClass ()
ProcessObjectGetProcess ()
TimeProbeGetTimeProbe ()
void operator= (const SimpleFilterWatcher &)
 SimpleFilterWatcher ()
 SimpleFilterWatcher (const SimpleFilterWatcher &)
 SimpleFilterWatcher (itk::ProcessObject *o, const char *comment="")
virtual ~SimpleFilterWatcher ()
int GetIterations ()
void SetIterations (int val)
bool GetQuiet ()
void SetQuiet (bool val)
int GetSteps ()
void SetSteps (int val)
void QuietOff ()
void QuietOn ()
void TestAbortOff ()
void TestAbortOn ()

Protected Member Functions

virtual void ShowAbort ()
virtual void ShowIteration ()
virtual void EndFilter ()
virtual void ShowProgress ()
virtual void StartFilter ()


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual void itk::SimpleFilterWatcher::EndFilter (  )  [inline, protected, virtual]

Callback method to show the EndEvent

Reimplemented in itk::XMLFilterWatcher.

Definition at line 196 of file itkSimpleFilterWatcher.h.

References itkExceptionMacro.

std::string itk::SimpleFilterWatcher::GetComment (  )  [inline]

Get the comment for the watcher.

Definition at line 125 of file itkSimpleFilterWatcher.h.

Referenced by itk::XMLFilterWatcher::StartFilter().

int itk::SimpleFilterWatcher::GetIterations (  )  [inline]

Definition at line 115 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 85 of file itkSimpleFilterWatcher.h.

ProcessObject* itk::SimpleFilterWatcher::GetProcess (  )  [inline]

Get a pointer to the process object being watched.

Definition at line 106 of file itkSimpleFilterWatcher.h.

Referenced by itk::XMLFilterWatcher::EndFilter(), and itk::XMLFilterWatcher::StartFilter().

bool itk::SimpleFilterWatcher::GetQuiet (  )  [inline]

Definition at line 121 of file itkSimpleFilterWatcher.h.

int itk::SimpleFilterWatcher::GetSteps (  )  [inline]

Definition at line 110 of file itkSimpleFilterWatcher.h.

TimeProbe& itk::SimpleFilterWatcher::GetTimeProbe (  )  [inline]

Get a reference to the TimeProbe

Definition at line 128 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]

Definition at line 93 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 92 of file itkSimpleFilterWatcher.h.

void itk::SimpleFilterWatcher::SetIterations ( int  val  )  [inline]

Set/Get the number of iterations completed.

Definition at line 114 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 progess is reported.

Definition at line 120 of file itkSimpleFilterWatcher.h.

void itk::SimpleFilterWatcher::SetSteps ( int  val  )  [inline]

Set/Get the steps completed.

Definition at line 109 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 158 of file itkSimpleFilterWatcher.h.

virtual void itk::SimpleFilterWatcher::ShowIteration (  )  [inline, protected, virtual]

Callback method to show the IterationEvent

Definition at line 164 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 133 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 171 of file itkSimpleFilterWatcher.h.

void itk::SimpleFilterWatcher::TestAbortOff (  )  [inline]

Definition at line 100 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 99 of file itkSimpleFilterWatcher.h.


The documentation for this class was generated from the following file:
Generated at Thu Nov 6 11:00:46 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000