Skip to content

Commit

Permalink
BUG: Fix itk::AttenuationImageFilter region threading
Browse files Browse the repository at this point in the history
Disables dynamic threading in order to enforce continuity along each scan
line using a region splitter.

Closes #185.
  • Loading branch information
tbirdso authored and dzenanz committed Mar 17, 2022
1 parent e836049 commit 1bc9bec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/itkAttenuationImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class ITK_TEMPLATE_EXPORT AttenuationImageFilter : public ImageToImageFilter<TIn
BeforeThreadedGenerateData() override;

void
DynamicThreadedGenerateData(const OutputRegionType &) override;
ThreadedGenerateData(const OutputRegionType & regionForThread, ThreadIdType) override;

const ImageRegionSplitterBase *
GetImageRegionSplitter() const override;
Expand Down
7 changes: 4 additions & 3 deletions include/itkAttenuationImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ template <typename TInputImage, typename TOutputImage, typename TMaskImage>
AttenuationImageFilter<TInputImage, TOutputImage, TMaskImage>::AttenuationImageFilter()
{
this->SetNumberOfRequiredInputs(1);
this->DynamicMultiThreadingOn();
this->DynamicMultiThreadingOff();
}

template <typename TInputImage, typename TOutputImage, typename TMaskImage>
Expand Down Expand Up @@ -126,8 +126,9 @@ AttenuationImageFilter<TInputImage, TOutputImage, TMaskImage>::BeforeThreadedGen

template <typename TInputImage, typename TOutputImage, typename TMaskImage>
void
AttenuationImageFilter<TInputImage, TOutputImage, TMaskImage>::DynamicThreadedGenerateData(
const OutputRegionType & regionForThread)
AttenuationImageFilter<TInputImage, TOutputImage, TMaskImage>::ThreadedGenerateData(
const OutputRegionType & regionForThread,
ThreadIdType)
{
if (regionForThread.GetNumberOfPixels() == 0)
{
Expand Down

0 comments on commit 1bc9bec

Please sign in to comment.