Open tbirdso opened 2 years ago
I'm entering this issue to capture follow-up discussion from #3065.
@dzenanz Could this please be assigned to me?
cc @blowekamp @N-Dekker
This could be achieved with compile-time iteration over integers in a template parameter pack:
https://devtut.github.io/cpp/metaprogramming.html#iterating-over-a-parameter-pack
it gets nicer with C++17 but could still be done with C++14.
It would be best to enable setting this as a build configuration option in CMake with a variable, then use it in the project via itkConfigure.h.in. It should be initialized with the wrapping image dimensions, if possible, and there should be a check that there is an intersection of the wrapping image dimensions and the supported FFT dimensions.
Description
Following up from #3065,
itk::FFTImageFilterFactory
should be updated to allow a developer to specify a list of image dimensions that the user is allowed to input for override.For instance,
VnlForwardFFTImageFilter
is the default forward FFT implementation in ITK and should override typicalitk::Image
dimensions 1 through 4. Meanwhile, in the ITKVkFFTBackend external moduleVkForwardFFTImageFilter
is an accelerated implementation only supporting 1D, 2D, and 3D FFT. Rather than writing a completely new factory, the external developer should be able to pass in a list of dimensions toitk::FFTImageFilterFactory
at compile time with the result that instantiating a filter for forward 1D, 2D, or 3D FFT yields aVkForwardFFTImageFilter
backend, while instantiating a filter for forward 4D FFT yields aVnlForwardFFTImageFilter
backend.Current behavior
1,2,3,4
is manually specified initkFFTImageFilterFactory.hxx
with no means of override.Proposed behavior
Traits
structure and can be overridden for external classes.Additional Information
Once we have settled on a design pattern here it can be reused elsewhere to assist in implementing swappable backends for any other ITK filters via the object factory.