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

itk::ProgressReporter Class Reference

Implements progress tracking for a filter. More...

#include <itkProgressReporter.h>

Collaboration diagram for itk::ProgressReporter:

Collaboration graph
[legend]
List of all members.

Public Methods

 ProgressReporter (ProcessObject *filter, int threadId, unsigned long numberOfPixels, unsigned long numberOfUpdates=100)
 ~ProgressReporter ()
void CompletedPixel ()

Protected Attributes

ProcessObjectm_Filter
int m_ThreadId
float m_InverseNumberOfPixels
unsigned long m_CurrentPixel
unsigned long m_PixelsPerUpdate
unsigned long m_PixelsBeforeUpdate

Detailed Description

Implements progress tracking for a filter.

This is a utility class for use by filter implementations in GenerateData() and ThreadedGenerateData().

The class constructor sets the progress to 0, and the destructor sets it to 1. In between, there should be one call to CompletedPixel() per pixel. The reporter will automatically update the filter's progress at an interval resulting in the specified number of updates. The default number of updates is 100.

Example usage:

   ProgressReporter progress(this, threadId,
                             threadRegion.GetNumberOfPixels(), 100);
   for( each pixel )
     {
     ...
     progress.CompletedPixel();
     }

When used in a non-threaded filter, the threadId argument should be 0.

See also:
This class is a tool for filter implementers to equip a filter to report on its progress. For information on how to acquire this progress information, see:

Definition at line 58 of file itkProgressReporter.h.


Constructor & Destructor Documentation

itk::ProgressReporter::ProgressReporter ProcessObject   filter,
int    threadId,
unsigned long    numberOfPixels,
unsigned long    numberOfUpdates = 100
 

Constructor sets progress to 0 because the filter is starting.

itk::ProgressReporter::~ProgressReporter  
 

Destructor sets progress to 1 because the filter has finished.


Member Function Documentation

void itk::ProgressReporter::CompletedPixel   [inline]
 

Called by a filter once per pixel.

Definition at line 70 of file itkProgressReporter.h.

References m_CurrentPixel, m_Filter, m_InverseNumberOfPixels, m_PixelsBeforeUpdate, m_PixelsPerUpdate, and itk::ProcessObject::UpdateProgress().


Member Data Documentation

unsigned long itk::ProgressReporter::m_CurrentPixel [protected]
 

Definition at line 87 of file itkProgressReporter.h.

Referenced by CompletedPixel().

ProcessObject* itk::ProgressReporter::m_Filter [protected]
 

Definition at line 84 of file itkProgressReporter.h.

Referenced by CompletedPixel().

float itk::ProgressReporter::m_InverseNumberOfPixels [protected]
 

Definition at line 86 of file itkProgressReporter.h.

Referenced by CompletedPixel().

unsigned long itk::ProgressReporter::m_PixelsBeforeUpdate [protected]
 

Definition at line 89 of file itkProgressReporter.h.

Referenced by CompletedPixel().

unsigned long itk::ProgressReporter::m_PixelsPerUpdate [protected]
 

Definition at line 88 of file itkProgressReporter.h.

Referenced by CompletedPixel().

int itk::ProgressReporter::m_ThreadId [protected]
 

Definition at line 85 of file itkProgressReporter.h.


The documentation for this class was generated from the following file:
Generated at Fri May 21 01:38:28 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000