ITK  6.0.0
Insight Toolkit
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"
23 #include "itkObjectFactoryBase.h"
24 #include "itkVersion.h"
25 
26 namespace itk
27 {
28 
41 template <template <typename, typename> class TFFTImageFilter>
43 {};
44 
45 
86 template <template <typename, typename> class TFFTImageFilter,
87  template <typename, unsigned int> class TInput = Image,
88  template <typename, unsigned int> class TOutput = Image>
90 {
91 public:
92  ITK_DISALLOW_COPY_AND_MOVE(FFTImageFilterFactory);
93 
98 
100  const char *
101  GetITKSourceVersion() const override
102  {
103  return ITK_SOURCE_VERSION;
104  }
105  const char *
106  GetDescription() const override
107  {
108  return "An FFTImageFilter factory";
109  }
113  itkFactorylessNewMacro(Self);
114 
116  itkOverrideGetNameOfClassMacro(FFTImageFilterFactory);
117 
119  static void
121  {
122  auto factory = FFTImageFilterFactory::New();
123 
125  }
126 
127 protected:
132  template <typename InputPixelType, typename OutputPixelType, unsigned int D, unsigned int... ImageDimensions>
133  void
134  OverrideFFTImageFilterType(const std::integer_sequence<unsigned int, D, ImageDimensions...> &)
135  {
136  using InputImageType = TInput<InputPixelType, D>;
137  using OutputImageType = TOutput<OutputPixelType, D>;
139  typeid(TFFTImageFilter<InputImageType, OutputImageType>).name(),
140  "FFT Image Filter Override",
141  true,
142  CreateObjectFunction<TFFTImageFilter<InputImageType, OutputImageType>>::New());
143  OverrideFFTImageFilterType<InputPixelType, OutputPixelType>(
144  std::integer_sequence<unsigned int, ImageDimensions...>{});
145  }
146  template <typename InputPixelType, typename OutputPixelType>
147  void
148  OverrideFFTImageFilterType(const std::integer_sequence<unsigned int> &)
149  {}
153  {
154  OverrideFFTImageFilterType<typename FFTImageFilterTraits<TFFTImageFilter>::template InputPixelType<float>,
155  typename FFTImageFilterTraits<TFFTImageFilter>::template OutputPixelType<float>>(
157 
158  OverrideFFTImageFilterType<typename FFTImageFilterTraits<TFFTImageFilter>::template InputPixelType<double>,
159  typename FFTImageFilterTraits<TFFTImageFilter>::template OutputPixelType<double>>(
161  }
162 };
163 
164 } // namespace itk
165 
166 #endif // itkFFTImageFilterFactory_h
itk::FFTImageFilterFactory::GetDescription
const char * GetDescription() const override
Definition: itkFFTImageFilterFactory.h:106
itk::FFTImageFilterFactory::FFTImageFilterFactory
FFTImageFilterFactory()
Definition: itkFFTImageFilterFactory.h:152
itk::ObjectFactoryBase
Create instances of classes using an object factory.
Definition: itkObjectFactoryBase.h:59
itk::ObjectFactoryBase::RegisterOverride
void RegisterOverride(const char *classOverride, const char *subclass, const char *description, bool enableFlag, CreateObjectFunctionBase *createFunction)
itk::FFTImageFilterFactory::RegisterOneFactory
static void RegisterOneFactory()
Definition: itkFFTImageFilterFactory.h:120
itkImage.h
itk::FFTImageFilterTraits
Helper defining pixel traits for templated FFT image filters.
Definition: itkFFTImageFilterFactory.h:42
itk::SmartPointer< Self >
ITK_SOURCE_VERSION
#define ITK_SOURCE_VERSION
Definition: itkVersion.h:39
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkObjectFactoryBase.h
itk::FFTImageFilterFactory::New
static Pointer New()
itk::ObjectFactoryBase::ObjectFactoryBase
ObjectFactoryBase()
itk::CreateObjectFunction
Used to create callback functions that create ITK Objects for use with the itk::ObjectFactory.
Definition: itkCreateObjectFunction.h:60
itk::FFTImageFilterFactory
Object factory implementation for FFT filters.
Definition: itkFFTImageFilterFactory.h:89
itk::ObjectFactoryBase::RegisterFactoryInternal
static void RegisterFactoryInternal(ObjectFactoryBase *)
itkVersion.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::FFTImageFilterFactory::OverrideFFTImageFilterType
void OverrideFFTImageFilterType(const std::integer_sequence< unsigned int > &)
Definition: itkFFTImageFilterFactory.h:148
itk::FFTImageFilterFactory::GetITKSourceVersion
const char * GetITKSourceVersion() const override
Definition: itkFFTImageFilterFactory.h:101
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
AddImageFilter
Definition: itkAddImageFilter.h:81
Superclass
BinaryGeneratorImageFilter< TInputImage1, TInputImage2, TOutputImage > Superclass
Definition: itkAddImageFilter.h:90
itk::FFTImageFilterFactory::OverrideFFTImageFilterType
void OverrideFFTImageFilterType(const std::integer_sequence< unsigned int, D, ImageDimensions... > &)
Definition: itkFFTImageFilterFactory.h:134