ITK  5.1.0
Insight Toolkit
Public Member Functions | List of all members
itk::ProgressReporter Class Reference

#include <itkProgressReporter.h>

+ Collaboration diagram for itk::ProgressReporter:

Public Member Functions

 ProgressReporter (ProcessObject *filter, ThreadIdType threadId, SizeValueType numberOfPixels, SizeValueType numberOfUpdates=100, float initialProgress=0.0f, float progressWeight=1.0f)
 
 ~ProgressReporter ()
 
ProcessObjectm_Filter
 
ThreadIdType m_ThreadId
 
float m_InverseNumberOfPixels
 
SizeValueType m_CurrentPixel
 
SizeValueType m_PixelsPerUpdate
 
SizeValueType m_PixelsBeforeUpdate
 
float m_InitialProgress
 
float m_ProgressWeight
 
void CompletedPixel ()
 

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 60 of file itkProgressReporter.h.

Constructor & Destructor Documentation

◆ ProgressReporter()

itk::ProgressReporter::ProgressReporter ( ProcessObject filter,
ThreadIdType  threadId,
SizeValueType  numberOfPixels,
SizeValueType  numberOfUpdates = 100,
float  initialProgress = 0.0f,
float  progressWeight = 1.0f 
)

Constructor sets progress to 0 because the filter is starting.

◆ ~ProgressReporter()

itk::ProgressReporter::~ProgressReporter ( )

Destructor sets progress to 1 because the filter has finished.

Member Function Documentation

◆ CompletedPixel()

void itk::ProgressReporter::CompletedPixel ( )
inline

Member Data Documentation

◆ m_CurrentPixel

SizeValueType itk::ProgressReporter::m_CurrentPixel
protected

Called by a filter once per pixel.

Definition at line 108 of file itkProgressReporter.h.

◆ m_Filter

ProcessObject* itk::ProgressReporter::m_Filter
protected

Called by a filter once per pixel.

Definition at line 105 of file itkProgressReporter.h.

◆ m_InitialProgress

float itk::ProgressReporter::m_InitialProgress
protected

Called by a filter once per pixel.

Definition at line 111 of file itkProgressReporter.h.

◆ m_InverseNumberOfPixels

float itk::ProgressReporter::m_InverseNumberOfPixels
protected

Called by a filter once per pixel.

Definition at line 107 of file itkProgressReporter.h.

◆ m_PixelsBeforeUpdate

SizeValueType itk::ProgressReporter::m_PixelsBeforeUpdate
protected

Called by a filter once per pixel.

Definition at line 110 of file itkProgressReporter.h.

◆ m_PixelsPerUpdate

SizeValueType itk::ProgressReporter::m_PixelsPerUpdate
protected

Called by a filter once per pixel.

Definition at line 109 of file itkProgressReporter.h.

◆ m_ProgressWeight

float itk::ProgressReporter::m_ProgressWeight
protected

Called by a filter once per pixel.

Definition at line 112 of file itkProgressReporter.h.

◆ m_ThreadId

ThreadIdType itk::ProgressReporter::m_ThreadId
protected

Called by a filter once per pixel.

Definition at line 106 of file itkProgressReporter.h.


The documentation for this class was generated from the following file:
itk::ProgressReporter::ProgressReporter
ProgressReporter(ProcessObject *filter, ThreadIdType threadId, SizeValueType numberOfPixels, SizeValueType numberOfUpdates=100, float initialProgress=0.0f, float progressWeight=1.0f)