Orfeo Toolbox  4.0
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
itk::ProgressReporter Class Reference

Implements progress tracking for a filter. More...

#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 ()
 
void CompletedPixel ()
 

Protected Attributes

SizeValueType m_CurrentPixel
 
ProcessObjectm_Filter
 
float m_InitialProgress
 
float m_InverseNumberOfPixels
 
SizeValueType m_PixelsBeforeUpdate
 
SizeValueType m_PixelsPerUpdate
 
float m_ProgressWeight
 
ThreadIdType m_ThreadId
 

Private Member Functions

 ProgressReporter ()
 

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

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.

Definition at line 23 of file itkProgressReporter.cxx.

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

itk::ProgressReporter::~ProgressReporter ( )

Destructor sets progress to 1 because the filter has finished.

Definition at line 55 of file itkProgressReporter.cxx.

References m_Filter, m_InitialProgress, m_ProgressWeight, m_ThreadId, and itk::ProcessObject::UpdateProgress().

itk::ProgressReporter::ProgressReporter ( )
private

Member Function Documentation

void itk::ProgressReporter::CompletedPixel ( )
inline

Called by a filter once per pixel.

Definition at line 74 of file itkProgressReporter.h.

References itk::Math::e, and itk::ExceptionObject::SetDescription().

Referenced by itk::BinaryImageToLabelMapFilter< TInputImage, TOutputImage >::AfterThreadedGenerateData(), otb::BSplineDecompositionImageFilter< TInputImage, TOutputImage >::DataToCoefficientsND(), itk::BSplineDecompositionImageFilter< TInputImage, TOutputImage >::DataToCoefficientsND(), itk::BSplineCenteredResampleImageFilterBase< TInputImage, TOutputImage >::Expand1DImage(), itk::BSplineResampleImageFilterBase< TInputImage, TOutputImage >::Expand1DImage(), otb::Statistics::ConcatenateSampleListFilter< TSampleList >::GenerateData(), otb::VectorImageToImageListFilter< TVectorImageType, TImageList >::GenerateData(), itk::IsoDataThresholdCalculator< THistogram, TOutput >::GenerateData(), itk::ParametricSpaceToImageSpaceMeshFilter< TInputMesh, TOutputMesh >::GenerateData(), otb::Statistics::ShiftScaleSampleListFilter< TInputSampleList, TOutputSampleList >::GenerateData(), otb::ImageMultiSegmentationToRCC8GraphFilter< TInputImage, TOutputGraph >::GenerateData(), itk::ImageToParametricSpaceFilter< TInputImage, TOutputMesh >::GenerateData(), itk::IntermodesThresholdCalculator< THistogram, TOutput >::GenerateData(), itk::ShiftScaleLabelMapFilter< TImage >::GenerateData(), itk::AttributeRelabelLabelMapFilter< TImage, TAttributeAccessor >::GenerateData(), itk::BinaryMorphologicalClosingImageFilter< TInputImage, TOutputImage, TKernel >::GenerateData(), itk::BinomialBlurImageFilter< TInputImage, TOutputImage >::GenerateData(), otb::SparseWvltToAngleMapperListFilter< TInputImageList, TOutputSampleList, VNbInputImages >::GenerateData(), itk::BinaryMaskToNarrowBandPointSetFilter< TInputImage, TOutputMesh >::GenerateData(), itk::GaussianImageSource< TOutputImage >::GenerateData(), itk::HardConnectedComponentImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::NeighborhoodConnectedImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::ExponentialDisplacementFieldImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::ExponentialDeformationFieldImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::VotingBinaryIterativeHoleFillingImageFilter< TImage >::GenerateData(), itk::LandmarkDisplacementFieldSource< TOutputImage >::GenerateData(), itk::ReconstructionImageFilter< TInputImage, TOutputImage, TCompare >::GenerateData(), itk::DeformationFieldSource< TOutputImage >::GenerateData(), itk::SliceBySliceImageFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::GenerateData(), itk::InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::InverseDeformationFieldImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::ObjectByObjectLabelMapFilter< TInputImage, TOutputImage, TInputFilter, TOutputFilter, TInternalInputImage, TInternalOutputImage >::GenerateData(), itk::IsolatedConnectedImageFilter< TInputImage, TOutputImage >::GenerateData(), itk::FastMarchingBase< TInput, TOutput >::GenerateData(), otb::FastICAImageFilter< TInputImage, TOutputImage, TDirectionOfTransformation >::GenerateTransformationMatrix(), itk::MergeLabelMapFilter< TImage >::MergeWithAggregate(), itk::MergeLabelMapFilter< TImage >::MergeWithKeep(), itk::MergeLabelMapFilter< TImage >::MergeWithPack(), itk::MergeLabelMapFilter< TImage >::MergeWithStrict(), itk::TransformToDisplacementFieldSource< TOutputImage, TTransformPrecisionType >::NonlinearThreadedGenerateData(), itk::TransformToDeformationFieldSource< TOutputImage, TTransformPrecisionType >::NonlinearThreadedGenerateData(), otb::OGRLayerStreamStitchingFilter< TInputImage >::ProcessStreamingLine(), itk::BSplineCenteredResampleImageFilterBase< TInputImage, TOutputImage >::Reduce1DImage(), itk::BSplineResampleImageFilterBase< TInputImage, TOutputImage >::Reduce1DImage(), itk::ShapeRelabelLabelMapFilter< TImage >::TemplatedGenerateData(), itk::Statistics::MaskedImageToHistogramFilter< TImage, TMaskImage >::ThreadedComputeHistogram(), itk::Statistics::ImageToHistogramFilter< TImage >::ThreadedComputeHistogram(), itk::Statistics::MaskedImageToHistogramFilter< TImage, TMaskImage >::ThreadedComputeMinimumAndMaximum(), itk::Statistics::ImageToHistogramFilter< TImage >::ThreadedComputeMinimumAndMaximum(), itk::AnchorErodeDilateImageFilter< TImage, TKernel, TFunction1 >::ThreadedGenerateData(), itk::VanHerkGilWermanErodeDilateImageFilter< TImage, TKernel, TFunction1 >::ThreadedGenerateData(), itk::AnchorOpenCloseImageFilter< TImage, TKernel, TCompare1, TCompare2 >::ThreadedGenerateData(), otb::UnaryFunctorObjectListBooleanFilter< TInputList, TOutputList, TFunction >::ThreadedGenerateData(), otb::UnaryFunctorObjectListFilter< TInputList, TOutputList, TFunction >::ThreadedGenerateData(), itk::RecursiveSeparableImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), otb::ThresholdVectorImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), otb::ClampImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), otb::ClampVectorImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::NaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::ThreadedGenerateData(), itk::PermuteAxesImageFilter< TImage >::ThreadedGenerateData(), itk::UnaryFunctorImageFilter< TInputImage, TOutputImage, TFunction >::ThreadedGenerateData(), itk::RegionOfInterestImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::PadImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::BinShrinkImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::FlipImageFilter< TImage >::ThreadedGenerateData(), otb::PolygonListToRCC8GraphFilter< TPolygonList, TOutputGraph >::ThreadedGenerateData(), itk::ThresholdImageFilter< TImage >::ThreadedGenerateData(), itk::LabelContourImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::BinaryContourImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::TernaryFunctorImageFilter< TInputImage1, TInputImage2, TInputImage3, TOutputImage, TFunction >::ThreadedGenerateData(), itk::PasteImageFilter< TInputImage, TSourceImage, TOutputImage >::ThreadedGenerateData(), itk::StatisticsImageFilter< TInputImage >::ThreadedGenerateData(), itk::BinaryImageToLabelMapFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::SignedMaurerDistanceMapImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), itk::ConnectedComponentImageFilter< TInputImage, TOutputImage, TMaskImage >::ThreadedGenerateData(), itk::BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage, TFunction >::ThreadedGenerateData(), itk::ExtractImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData(), otb::WaveletFilterBank< TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE >::ThreadedGenerateData(), otb::WaveletFilterBank< TInputImage, TOutputImage, TWaveletOperator, Wavelet::FORWARD >::ThreadedGenerateDataAtDimensionN(), and otb::WaveletFilterBank< TInputImage, TOutputImage, TWaveletOperator, Wavelet::INVERSE >::ThreadedGenerateDataAtDimensionN().

Member Data Documentation

SizeValueType itk::ProgressReporter::m_CurrentPixel
protected

Definition at line 103 of file itkProgressReporter.h.

ProcessObject* itk::ProgressReporter::m_Filter
protected

Definition at line 100 of file itkProgressReporter.h.

Referenced by ProgressReporter(), and ~ProgressReporter().

float itk::ProgressReporter::m_InitialProgress
protected

Definition at line 106 of file itkProgressReporter.h.

Referenced by ProgressReporter(), and ~ProgressReporter().

float itk::ProgressReporter::m_InverseNumberOfPixels
protected

Definition at line 102 of file itkProgressReporter.h.

Referenced by ProgressReporter().

SizeValueType itk::ProgressReporter::m_PixelsBeforeUpdate
protected

Definition at line 105 of file itkProgressReporter.h.

Referenced by ProgressReporter().

SizeValueType itk::ProgressReporter::m_PixelsPerUpdate
protected

Definition at line 104 of file itkProgressReporter.h.

Referenced by ProgressReporter().

float itk::ProgressReporter::m_ProgressWeight
protected

Definition at line 107 of file itkProgressReporter.h.

Referenced by ~ProgressReporter().

ThreadIdType itk::ProgressReporter::m_ThreadId
protected

Definition at line 101 of file itkProgressReporter.h.

Referenced by ProgressReporter(), and ~ProgressReporter().


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

Generated at Sat Mar 8 2014 17:35:58 for Orfeo Toolbox with doxygen 1.8.3.1