Skip to content

Commit

Permalink
Fix progress to report just a portion for each streamed iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
blowekamp committed Apr 17, 2015
1 parent 5f3c0ca commit d8415cf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/itkStreamingStatisticsImageFilter.hxx
Expand Up @@ -282,9 +282,17 @@ StreamingStatisticsImageFilter< TInputImage >

ImageScanlineConstIterator< TInputImage > it (this->GetInput(), inputRegion);

int currentIterationNumber = this->GetCurrentRequestNumber();
int numberOfIterations = this->GetNumberOfInputRequestedRegions();

// support progress methods/callbacks
const size_t numberOfLinesToProcess =inputRegion.GetNumberOfPixels() / size0;
ProgressReporter progress( this, threadId, numberOfLinesToProcess );
ProgressReporter progress( this, threadId,
numberOfLinesToProcess,
100,
float( currentIterationNumber ) / numberOfIterations,
1.0 / numberOfIterations
);

// do the work
while ( !it.IsAtEnd() )
Expand Down

0 comments on commit d8415cf

Please sign in to comment.