Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Consider requested output region in FFT convolution
Prior to this change, `itk::FFTConvolutionImageFilter` and `itk::ConvolutionImageFilter` had the major difference where the former would always run on the largest possible input image region whereas the latter would run on a padded requested region. As a result spatial convolution was much more performant when run on a small region of a large image. This change revises how `itk::FFTConvolutionImageFilter` processes input and output image regions in order to perform convolution and discards the assumption that the output requested region must always be the largest possible region. The input image subregion is padded for the kernel operator and then clipped of remaining image data so that forward FFT is performed on a region exactly matching that which would be processed under spatial convolution. The kernel image is likewise padded to the match the input. The result of FFT multiplication and subsequent inversion is then cropped to remove artifacts from padding, leaving only the requested input size. This approach has the advantage of scaling with the size of the requested output region. FFT convolution continues to be disadvantaged in comparison to spatial convolution where an output region is iteratively expanded or shrunk, as under FFT convolution entirely new complex images must be generated for any change in the output region. Adds tests demonstrating functionality and equivalence to spatial convolution.
- Loading branch information