Skip to content

Commit a8c1dc3

Browse files
committed
Correct bug in Voss et al distortion correction
1 parent 7b7ed39 commit a8c1dc3

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

Anima/registration/anatomical-commands/distortion_correction/animaDistortionCorrectionImageFilter.hxx

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,24 @@ template< typename TInputImage >
4242
void DistortionCorrectionImageFilter < TInputImage >
4343
::GenerateData()
4444
{
45-
// Call a method that can be overridden by a subclass to allocate
46-
// memory for the filter's outputs
47-
this->AllocateOutputs();
48-
49-
// Call a method that can be overridden by a subclass to perform
50-
// some calculations prior to splitting the main computations into
51-
// separate threads
52-
this->BeforeThreadedGenerateData();
53-
54-
using RegionType = itk::ImageRegion <TInputImage::ImageDimension>;
55-
typename OutputImageType::Pointer outputImage(this->GetOutput());
56-
const RegionType region = outputImage->GetRequestedRegion();
57-
58-
this->GetMultiThreader()->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits());
59-
this->GetMultiThreader()->template ParallelizeImageRegionRestrictDirection<OutputImageType::ImageDimension>(
60-
this->m_Direction, region, [this](const RegionType & lambdaRegion) { this->DynamicThreadedGenerateData(lambdaRegion); }, this);
45+
// Call a method that can be overridden by a subclass to allocate
46+
// memory for the filter's outputs
47+
this->AllocateOutputs();
48+
49+
// Call a method that can be overridden by a subclass to perform
50+
// some calculations prior to splitting the main computations into
51+
// separate threads
52+
this->BeforeThreadedGenerateData();
53+
54+
using RegionType = itk::ImageRegion <TInputImage::ImageDimension>;
55+
typename OutputImageType::Pointer outputImage(this->GetOutput());
56+
const RegionType region = outputImage->GetRequestedRegion();
57+
58+
this->GetMultiThreader()->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits());
59+
this->GetMultiThreader()->template ParallelizeImageRegionRestrictDirection<OutputImageType::ImageDimension>(
60+
this->m_Direction, region, [this](const RegionType & lambdaRegion) { this->DynamicThreadedGenerateData(lambdaRegion); }, this);
61+
62+
this->AfterThreadedGenerateData();
6163
}
6264

6365
template< typename TInputImage >

0 commit comments

Comments
 (0)