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 >