From a8c1dc3e573bf362a0d184b0d13fc408bef6b125 Mon Sep 17 00:00:00 2001 From: Olivier Commowick Date: Fri, 4 Sep 2020 08:07:10 +0200 Subject: [PATCH] Correct bug in Voss et al distortion correction --- .../animaDistortionCorrectionImageFilter.hxx | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Anima/registration/anatomical-commands/distortion_correction/animaDistortionCorrectionImageFilter.hxx b/Anima/registration/anatomical-commands/distortion_correction/animaDistortionCorrectionImageFilter.hxx index 8c110d9ff..9b95ad77e 100644 --- a/Anima/registration/anatomical-commands/distortion_correction/animaDistortionCorrectionImageFilter.hxx +++ b/Anima/registration/anatomical-commands/distortion_correction/animaDistortionCorrectionImageFilter.hxx @@ -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 ; - typename OutputImageType::Pointer outputImage(this->GetOutput()); - const RegionType region = outputImage->GetRequestedRegion(); - - this->GetMultiThreader()->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); - this->GetMultiThreader()->template ParallelizeImageRegionRestrictDirection( - 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 ; + typename OutputImageType::Pointer outputImage(this->GetOutput()); + const RegionType region = outputImage->GetRequestedRegion(); + + this->GetMultiThreader()->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits()); + this->GetMultiThreader()->template ParallelizeImageRegionRestrictDirection( + this->m_Direction, region, [this](const RegionType & lambdaRegion) { this->DynamicThreadedGenerateData(lambdaRegion); }, this); + + this->AfterThreadedGenerateData(); } template< typename TInputImage >