ITK  6.0.0
Insight Toolkit
Public Member Functions | Protected Attributes | List of all members
itk::TotalProgressReporter Class Reference

#include <itkTotalProgressReporter.h>

Detailed Description

A progress reporter for concurrent threads.

Each thread should construct their own instance of the class. The ProcessObject::IncrementProgress method will be called to update the progress from all threads. The ProcessObject's method will automatically create ProgressEvents when the pipeline invoking thread updates the progress.

All threads concurrently contribute parts of the progress to the total number of pixels for all threads. This report will update the progress after a sufficient number of pixel to meet the numberOfUpdates requirement between all threads. Also when the object is deconstructed, all remaining pixels will increment the progress.

Definition at line 40 of file itkTotalProgressReporter.h.

+ Collaboration diagram for itk::TotalProgressReporter:

Public Member Functions

void Completed (SizeValueType count)
 
 TotalProgressReporter (ProcessObject *filter, SizeValueType totalNumberOfPixels, SizeValueType numberOfUpdates=100, float progressWeight=1.0f)
 
 ~TotalProgressReporter ()
 
void CheckAbortGenerateData ()
 
void CompletedPixel ()
 

Protected Attributes

SizeValueType m_CurrentPixel
 
ProcessObjectm_Filter
 
float m_InverseNumberOfPixels
 
SizeValueType m_PixelsBeforeUpdate
 
SizeValueType m_PixelsPerUpdate
 
float m_ProgressWeight
 

Constructor & Destructor Documentation

◆ TotalProgressReporter()

itk::TotalProgressReporter::TotalProgressReporter ( ProcessObject filter,
SizeValueType  totalNumberOfPixels,
SizeValueType  numberOfUpdates = 100,
float  progressWeight = 1.0f 
)

Construct a TotalProgressReporter.

Parameters
filter- the ProcessObject which whose progress will be updated. If nullptr then no updates will occur.
totalNumberOfPixels- the number of pixels between all threads and chunks that will be updated. If zero, any completed chunk will result in a progress event.
numberOfUpdates- controls how often the ProcessObject's progress will be incremented
progressWeight- A percentage of the filters progress, this total number of pixels will contribute

◆ ~TotalProgressReporter()

itk::TotalProgressReporter::~TotalProgressReporter ( )

Destructor sets progress to 1 because the filter has finished.

Member Function Documentation

◆ CheckAbortGenerateData()

void itk::TotalProgressReporter::CheckAbortGenerateData ( )
inline

Check if the filter has the ProcessObject::AbortGenerateData flag set. If true, then a ProcessAborted exception will be thrown.

Definition at line 65 of file itkTotalProgressReporter.h.

References itk::Math::e.

◆ Completed()

void itk::TotalProgressReporter::Completed ( SizeValueType  count)
inline

Called by a filter when a chunk, region, scan-line, etc. is completed.

Definition at line 102 of file itkTotalProgressReporter.h.

◆ CompletedPixel()

void itk::TotalProgressReporter::CompletedPixel ( )
inline

Called by a filter once per pixel.

Definition at line 81 of file itkTotalProgressReporter.h.

Member Data Documentation

◆ m_CurrentPixel

SizeValueType itk::TotalProgressReporter::m_CurrentPixel
protected

Definition at line 129 of file itkTotalProgressReporter.h.

◆ m_Filter

ProcessObject* itk::TotalProgressReporter::m_Filter
protected

Definition at line 127 of file itkTotalProgressReporter.h.

◆ m_InverseNumberOfPixels

float itk::TotalProgressReporter::m_InverseNumberOfPixels
protected

Definition at line 128 of file itkTotalProgressReporter.h.

◆ m_PixelsBeforeUpdate

SizeValueType itk::TotalProgressReporter::m_PixelsBeforeUpdate
protected

Definition at line 131 of file itkTotalProgressReporter.h.

◆ m_PixelsPerUpdate

SizeValueType itk::TotalProgressReporter::m_PixelsPerUpdate
protected

Definition at line 130 of file itkTotalProgressReporter.h.

◆ m_ProgressWeight

float itk::TotalProgressReporter::m_ProgressWeight
protected

Definition at line 132 of file itkTotalProgressReporter.h.


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