ITK  4.6.0
Insight Segmentation and Registration Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
itk::ProgressAccumulator Class Reference

#include <itkProgressAccumulator.h>

+ Inheritance diagram for itk::ProgressAccumulator:
+ Collaboration diagram for itk::ProgressAccumulator:

Detailed Description

Facilitates progress reporting for filters that wrap around multiple other filters.

This object allows a mini-pipeline filters to easily keep track of the progress performed by the internal filters. See DiscreteGaussianImageFilter.hxx for an implementation example.

See Also
DiscreteGaussianImageFilter

Definition at line 40 of file itkProgressAccumulator.h.

Classes

struct  FilterRecord
 

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef GenericFilterType::Pointer GenericFilterPointer
 
typedef ProcessObject GenericFilterType
 
typedef SmartPointer< SelfPointer
 
typedef ProgressAccumulator Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual float GetAccumulatedProgress () const
 
virtual const ProcessObjectGetMiniPipelineFilter () const
 
virtual ProcessObjectGetModifiableMiniPipelineFilter ()
 
virtual const char * GetNameOfClass () const
 
void RegisterInternalFilter (GenericFilterType *filter, float weight)
 
void ResetFilterProgressAndKeepAccumulatedProgress ()
 
void ResetProgress ()
 
virtual void SetMiniPipelineFilter (ProcessObject *_arg)
 
void UnregisterAllFilters ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary (void)
 
const MetaDataDictionaryGetMetaDataDictionary (void) const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const ITK_OVERRIDE
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) ITK_OVERRIDE
 
virtual void UnRegister () const ITK_OVERRIDE
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

virtual void PrintSelf (std::ostream &s, Indent indent) const ITK_OVERRIDE
 
 ProgressAccumulator ()
 
virtual ~ProgressAccumulator ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Types

typedef CommandType::Pointer CommandPointer
 
typedef MemberCommand< SelfCommandType
 
typedef std::vector< struct
FilterRecord
FilterRecordVector
 

Private Member Functions

void ReportProgress (Object *object, const EventObject &event)
 

Private Attributes

float m_AccumulatedProgress
 
float m_BaseAccumulatedProgress
 
CommandPointer m_CallbackCommand
 
FilterRecordVector m_FilterRecord
 
GenericFilterPointer m_MiniPipelineFilter
 

Additional Inherited Members

- Protected Types inherited from itk::LightObject
typedef int InternalReferenceCountType
 
- Protected Attributes inherited from itk::LightObject
InternalReferenceCountType m_ReferenceCount
 
SimpleFastMutexLock m_ReferenceCountLock
 

Member Typedef Documentation

Definition at line 123 of file itkProgressAccumulator.h.

Command for observing progress of pipeline filters

Definition at line 122 of file itkProgressAccumulator.h.

Definition at line 48 of file itkProgressAccumulator.h.

typedef std::vector< struct FilterRecord > itk::ProgressAccumulator::FilterRecordVector
private

An array of record structures

Definition at line 145 of file itkProgressAccumulator.h.

Definition at line 52 of file itkProgressAccumulator.h.

Typedef for inputting filters

Definition at line 51 of file itkProgressAccumulator.h.

Definition at line 47 of file itkProgressAccumulator.h.

Standard class typedefs.

Definition at line 45 of file itkProgressAccumulator.h.

Definition at line 46 of file itkProgressAccumulator.h.

Constructor & Destructor Documentation

itk::ProgressAccumulator::ProgressAccumulator ( )
protected
virtual itk::ProgressAccumulator::~ProgressAccumulator ( )
protectedvirtual

Member Function Documentation

virtual::itk::LightObject::Pointer itk::ProgressAccumulator::CreateAnother ( void  ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

virtual float itk::ProgressAccumulator::GetAccumulatedProgress ( ) const
virtual

Get the total progress accumulated by this object

virtual const ProcessObject* itk::ProgressAccumulator::GetMiniPipelineFilter ( ) const
virtual
virtual ProcessObject* itk::ProgressAccumulator::GetModifiableMiniPipelineFilter ( )
virtual

Set the mini-pipeline filter

virtual const char* itk::ProgressAccumulator::GetNameOfClass ( ) const
virtual

Runtime information support.

Reimplemented from itk::Object.

static Pointer itk::ProgressAccumulator::New ( )
static

Standard New method.

virtual void itk::ProgressAccumulator::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
protectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

void itk::ProgressAccumulator::RegisterInternalFilter ( GenericFilterType filter,
float  weight 
)

Register a filter with the progress accumulator and specify the fraction of the overall progress associated with this filter. The sum of the weights for all filters that are registered should be 1. However, if streaming is used, the weight should be divided by the number of streams because each stream will reset the filter after capturing its progress. For example, if the desired weight of a filter is 0.4, but it is streamed into 4 streams, the weight should be 0.1. The ProgressAccumulator will then ensure that each of the 4 runs of this filter will add 0.1 to the filter's progress.

void itk::ProgressAccumulator::ReportProgress ( Object object,
const EventObject event 
)
private

A callback function that is called by the progressing filters

void itk::ProgressAccumulator::ResetFilterProgressAndKeepAccumulatedProgress ( )
Deprecated:
Reset the filter progress but keep the accumulated progress. This method is deprecated because the ProgressAccumulator now internally checks if a filter has been restarted and updates the accumulated progress automatically. This method also used to have the unfortunate side effect of forcing filters to rerun even if their parameters and input had not changed. This is because it called SetProgress(0) on the filters, which triggered a ModifiedTime and thus caused the filters to rerun. To avoid this behavior, the implementation of this method is now empty.
void itk::ProgressAccumulator::ResetProgress ( )
Deprecated:
Reset the progress accumulator. This method should not be necessary because this functionality is already present in the filter constructor.
virtual void itk::ProgressAccumulator::SetMiniPipelineFilter ( ProcessObject _arg)
virtual

Set the mini-pipeline filter

void itk::ProgressAccumulator::UnregisterAllFilters ( )

Unregister all filters that have been registered with this object

Member Data Documentation

float itk::ProgressAccumulator::m_AccumulatedProgress
private

The total accumulated progress

Definition at line 148 of file itkProgressAccumulator.h.

float itk::ProgressAccumulator::m_BaseAccumulatedProgress
private

The total accumulated progress for multiple runs of the mini-pipeline

Definition at line 151 of file itkProgressAccumulator.h.

CommandPointer itk::ProgressAccumulator::m_CallbackCommand
private

The callback command

Definition at line 160 of file itkProgressAccumulator.h.

FilterRecordVector itk::ProgressAccumulator::m_FilterRecord
private

A list of progress proportions of the different filters in the pipeline

Definition at line 157 of file itkProgressAccumulator.h.

GenericFilterPointer itk::ProgressAccumulator::m_MiniPipelineFilter
private

The client mini-pipeline filter

Definition at line 142 of file itkProgressAccumulator.h.


The documentation for this class was generated from the following file: