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

#include <itkTotalProgressReporter.h>

+ Collaboration diagram for itk::TotalProgressReporter:

Public Member Functions

 TotalProgressReporter (ProcessObject *filter, SizeValueType totalNumberOfPixels, SizeValueType numberOfUpdates=100, float progressWeight=1.0f)
 
 ~TotalProgressReporter ()
 
ProcessObjectm_Filter
 
float m_InverseNumberOfPixels
 
SizeValueType m_CurrentPixel
 
SizeValueType m_PixelsPerUpdate
 
SizeValueType m_PixelsBeforeUpdate
 
float m_ProgressWeight
 
void CheckAbortGenerateData ()
 
void CompletedPixel ()
 
void Completed (SizeValueType count)
 

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.

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
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 64 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 101 of file itkTotalProgressReporter.h.

◆ CompletedPixel()

void itk::TotalProgressReporter::CompletedPixel ( )
inline

Called by a filter once per pixel.

Definition at line 80 of file itkTotalProgressReporter.h.

Member Data Documentation

◆ m_CurrentPixel

SizeValueType itk::TotalProgressReporter::m_CurrentPixel
protected

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

Definition at line 128 of file itkTotalProgressReporter.h.

◆ m_Filter

ProcessObject* itk::TotalProgressReporter::m_Filter
protected

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

Definition at line 126 of file itkTotalProgressReporter.h.

◆ m_InverseNumberOfPixels

float itk::TotalProgressReporter::m_InverseNumberOfPixels
protected

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

Definition at line 127 of file itkTotalProgressReporter.h.

◆ m_PixelsBeforeUpdate

SizeValueType itk::TotalProgressReporter::m_PixelsBeforeUpdate
protected

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

Definition at line 130 of file itkTotalProgressReporter.h.

◆ m_PixelsPerUpdate

SizeValueType itk::TotalProgressReporter::m_PixelsPerUpdate
protected

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

Definition at line 129 of file itkTotalProgressReporter.h.

◆ m_ProgressWeight

float itk::TotalProgressReporter::m_ProgressWeight
protected

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

Definition at line 131 of file itkTotalProgressReporter.h.


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