ITK  6.0.0
Insight Toolkit
itkFFTWInverseFFTImageFilter.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 #ifndef itkFFTWInverseFFTImageFilter_h
19 #define itkFFTWInverseFFTImageFilter_h
20 
22 #include "itkFFTWCommon.h"
23 
25 
26 namespace itk
27 {
49 template <typename TInputImage,
50  typename TOutputImage = Image<typename TInputImage::PixelType::value_type, TInputImage::ImageDimension>>
51 class ITK_TEMPLATE_EXPORT FFTWInverseFFTImageFilter : public InverseFFTImageFilter<TInputImage, TOutputImage>
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_MOVE(FFTWInverseFFTImageFilter);
55 
57  using InputImageType = TInputImage;
58  using InputPixelType = typename InputImageType::PixelType;
60  using OutputImageType = TOutputImage;
61  using OutputPixelType = typename OutputImageType::PixelType;
63 
68 
75 
77 
79  itkNewMacro(Self);
80 
82  itkOverrideGetNameOfClassMacro(FFTWInverseFFTImageFilter);
83 
85  static constexpr unsigned int ImageDimension = InputImageType::ImageDimension;
86 
96  virtual void
97  SetPlanRigor(const int & value)
98  {
99 #ifndef ITK_USE_CUFFTW
100  // Use that method to check the value.
102 #endif
103  if (m_PlanRigor != value)
104  {
105  m_PlanRigor = value;
106  this->Modified();
107  }
108  }
109  itkGetConstReferenceMacro(PlanRigor, int);
110  void
111  SetPlanRigor(const std::string & name)
112  {
113 #ifndef ITK_USE_CUFFTW
114  this->SetPlanRigor(FFTWGlobalConfiguration::GetPlanRigorValue(name));
115 #endif
116  }
120  GetSizeGreatestPrimeFactor() const override;
121 
122 protected:
124  ~FFTWInverseFFTImageFilter() override = default;
125 
126  void
127  BeforeThreadedGenerateData() override;
128 
129  void
130  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
131 
132  void
133  PrintSelf(std::ostream & os, Indent indent) const override;
134 
135 private:
136  int m_PlanRigor{};
137 };
138 
139 
140 // Describe whether input/output are real- or complex-valued
141 // for factory registration
142 template <>
144 {
145  template <typename TUnderlying>
146  using InputPixelType = std::complex<TUnderlying>;
147  template <typename TUnderlying>
148  using OutputPixelType = TUnderlying;
149  using FilterDimensions = std::integer_sequence<unsigned int, 4, 3, 2, 1>;
150 };
151 
152 } // namespace itk
153 
154 #ifndef ITK_MANUAL_INSTANTIATION
155 # include "itkFFTWInverseFFTImageFilter.hxx"
156 #endif
157 
158 #endif // itkFFTWInverseFFTImageFilter_h
itk::FFTWInverseFFTImageFilter::SetPlanRigor
void SetPlanRigor(const std::string &name)
Definition: itkFFTWInverseFFTImageFilter.h:111
itkInverseFFTImageFilter.h
itk::FFTWInverseFFTImageFilter::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition: itkFFTWInverseFFTImageFilter.h:61
itk::FFTWGlobalConfiguration::GetPlanRigorName
static std::string GetPlanRigorName(const int value)
itk::FFTImageFilterTraits< FFTWInverseFFTImageFilter >::FilterDimensions
std::integer_sequence< unsigned int, 4, 3, 2, 1 > FilterDimensions
Definition: itkFFTWInverseFFTImageFilter.h:149
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::FFTWInverseFFTImageFilter::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition: itkFFTWInverseFFTImageFilter.h:58
itk::FFTImageFilterTraits
Helper defining pixel traits for templated FFT image filters.
Definition: itkFFTImageFilterFactory.h:42
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::FFTImageFilterTraits< FFTWInverseFFTImageFilter >::InputPixelType
std::complex< TUnderlying > InputPixelType
Definition: itkFFTWInverseFFTImageFilter.h:146
itk::FFTWGlobalConfiguration::GetPlanRigorValue
static int GetPlanRigorValue(const std::string &name)
itk::InverseFFTImageFilter
Base class for inverse Fast Fourier Transform.
Definition: itkInverseFFTImageFilter.h:51
itk::ImageToImageFilter::InputImageType
TInputImage InputImageType
Definition: itkImageToImageFilter.h:129
itk::FFTWInverseFFTImageFilter::FFTWProxyType
typename fftw::Proxy< OutputPixelType > FFTWProxyType
Definition: itkFFTWInverseFFTImageFilter.h:74
itk::FFTWInverseFFTImageFilter::OutputSizeType
typename OutputImageType::SizeType OutputSizeType
Definition: itkFFTWInverseFFTImageFilter.h:62
itk::ImageSource::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition: itkImageSource.h:92
itkFFTWCommon.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::FFTImageFilterTraits< FFTWInverseFFTImageFilter >::OutputPixelType
TUnderlying OutputPixelType
Definition: itkFFTWInverseFFTImageFilter.h:148
itkFFTImageFilterFactory.h
itk::FFTWInverseFFTImageFilter
FFTW-based inverse Fast Fourier Transform.
Definition: itkFFTWInverseFFTImageFilter.h:51
itk::FFTWInverseFFTImageFilter::SetPlanRigor
virtual void SetPlanRigor(const int &value)
Definition: itkFFTWInverseFFTImageFilter.h:97
itk::FFTWInverseFFTImageFilter::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition: itkFFTWInverseFFTImageFilter.h:59
itk::fftw::Proxy
Definition: itkFFTWCommon.h:54
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::ImageSource::OutputImageType
TOutputImage OutputImageType
Definition: itkImageSource.h:90