ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFFTImageFilterFactory.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef itkFFTImageFilterFactory_h
20#define itkFFTImageFilterFactory_h
21
22#include "itkImage.h"
24#include "itkVersion.h"
25
26#include <type_traits>
27
28namespace itk
29{
30
31// Compile-time predicates selecting which precisions a templated FFT filter
32// is registered for. Both default to enabled; an FFT backend specializes the
33// relevant predicate to std::false_type when its matching precision is
34// unavailable (e.g. FFTW without ITK_USE_FFTWD).
35template <template <typename, typename> class TFFTImageFilter>
36struct FFTImageFilterEnableFloat : std::true_type
37{};
38template <template <typename, typename> class TFFTImageFilter>
39struct FFTImageFilterEnableDouble : std::true_type
40{};
41
54template <template <typename, typename> class TFFTImageFilter>
57
58
99template <template <typename, typename> class TFFTImageFilter,
100 template <typename, unsigned int> class TInput = Image,
101 template <typename, unsigned int> class TOutput = Image>
103{
104public:
105 ITK_DISALLOW_COPY_AND_MOVE(FFTImageFilterFactory);
106
111
114 const char *
115 GetITKSourceVersion() const override
116 {
117 return ITK_SOURCE_VERSION;
118 }
119 const char *
120 GetDescription() const override
121 {
122 return "An FFTImageFilter factory";
123 }
124
126 itkFactorylessNewMacro(Self);
127
129 itkOverrideGetNameOfClassMacro(FFTImageFilterFactory);
130
132 static void
139
140protected:
146 template <typename InputPixelType, typename OutputPixelType, unsigned int D, unsigned int... ImageDimensions>
147 void
148 OverrideFFTImageFilterType(const std::integer_sequence<unsigned int, D, ImageDimensions...> &)
149 {
150 using InputImageType = TInput<InputPixelType, D>;
151 using OutputImageType = TOutput<OutputPixelType, D>;
152 this->RegisterOverride(typeid(typename TFFTImageFilter<InputImageType, OutputImageType>::Superclass).name(),
153 typeid(TFFTImageFilter<InputImageType, OutputImageType>).name(),
154 "FFT Image Filter Override",
155 true,
156 CreateObjectFunction<TFFTImageFilter<InputImageType, OutputImageType>>::New());
158 std::integer_sequence<unsigned int, ImageDimensions...>{});
159 }
160 template <typename InputPixelType, typename OutputPixelType>
161 void
162 OverrideFFTImageFilterType(const std::integer_sequence<unsigned int> &)
163 {}
164
181};
182
183} // namespace itk
184
185#endif // itkFFTImageFilterFactory_h
Used to create callback functions that create ITK Objects for use with the itk::ObjectFactory.
const char * GetITKSourceVersion() const override
const char * GetDescription() const override
void OverrideFFTImageFilterType(const std::integer_sequence< unsigned int > &)
void OverrideFFTImageFilterType(const std::integer_sequence< unsigned int, D, ImageDimensions... > &)
SmartPointer< const Self > ConstPointer
Templated n-dimensional image class.
Definition itkImage.h:89
void RegisterOverride(const char *classOverride, const char *subclass, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
static void RegisterFactoryInternal(ObjectFactoryBase *)
Implements transparent reference counting.
#define ITK_SOURCE_VERSION
Definition itkVersion.h:39
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Helper defining pixel traits for templated FFT image filters.