Skip to content

Commit

Permalink
BUG: Fix largest possible output region in itk::ConvolutionImageFilter
Browse files Browse the repository at this point in the history
As a result of disconnecting input for its internal mini-pipeline
`itk::ConvolutionImageFilter` previously set the largest possible region
for its output image to be the same as the output buffered region.

This fix updates output information prior to grafting mini-pipeline
results onto the filter output so that the largest possible output
region reflects the size of available input data with possible
adjustment for the filter's region mode. Critical for image streaming
operations.
  • Loading branch information
tbirdso committed May 2, 2022
1 parent 742d73a commit 389a374
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ ConvolutionImageFilter<TInputImage, TKernelImage, TOutputImage>::ComputeConvolut
convolutionFilter->GraftOutput(this->GetOutput());
convolutionFilter->GetOutput()->SetRequestedRegion(this->GetOutput()->GetRequestedRegion());
convolutionFilter->Update();
// Set largest possible region to that of input image
convolutionFilter->GetOutput()->SetLargestPossibleRegion(this->GetInput()->GetLargestPossibleRegion());
this->GraftOutput(convolutionFilter->GetOutput());
}
else // OutputRegionMode == Self::VALID
Expand Down Expand Up @@ -176,6 +178,8 @@ ConvolutionImageFilter<TInputImage, TKernelImage, TOutputImage>::ComputeConvolut
cropFilter->GetOutput()->SetRequestedRegion(this->GetOutput()->GetRequestedRegion());
cropFilter->Update();

// Reset the largest possible region to the valid region
cropFilter->GetOutput()->SetLargestPossibleRegion(this->GetValidRegion());

// Graft the output of the crop filter back onto this
// filter's output.
Expand Down

0 comments on commit 389a374

Please sign in to comment.