Skip to content

Commit

Permalink
Correct bug in Voss et al distortion correction
Browse files Browse the repository at this point in the history
  • Loading branch information
ocommowi committed Sep 4, 2020
1 parent 7b7ed39 commit a8c1dc3
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,24 @@ template< typename TInputImage >
void DistortionCorrectionImageFilter < TInputImage >
::GenerateData()
{
// Call a method that can be overridden by a subclass to allocate
// memory for the filter's outputs
this->AllocateOutputs();

// Call a method that can be overridden by a subclass to perform
// some calculations prior to splitting the main computations into
// separate threads
this->BeforeThreadedGenerateData();

using RegionType = itk::ImageRegion <TInputImage::ImageDimension>;
typename OutputImageType::Pointer outputImage(this->GetOutput());
const RegionType region = outputImage->GetRequestedRegion();

this->GetMultiThreader()->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits());
this->GetMultiThreader()->template ParallelizeImageRegionRestrictDirection<OutputImageType::ImageDimension>(
this->m_Direction, region, [this](const RegionType & lambdaRegion) { this->DynamicThreadedGenerateData(lambdaRegion); }, this);
// Call a method that can be overridden by a subclass to allocate
// memory for the filter's outputs
this->AllocateOutputs();

// Call a method that can be overridden by a subclass to perform
// some calculations prior to splitting the main computations into
// separate threads
this->BeforeThreadedGenerateData();

using RegionType = itk::ImageRegion <TInputImage::ImageDimension>;
typename OutputImageType::Pointer outputImage(this->GetOutput());
const RegionType region = outputImage->GetRequestedRegion();

this->GetMultiThreader()->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits());
this->GetMultiThreader()->template ParallelizeImageRegionRestrictDirection<OutputImageType::ImageDimension>(
this->m_Direction, region, [this](const RegionType & lambdaRegion) { this->DynamicThreadedGenerateData(lambdaRegion); }, this);

this->AfterThreadedGenerateData();
}

template< typename TInputImage >
Expand Down

0 comments on commit a8c1dc3

Please sign in to comment.