RTK  2.6.0
Reconstruction Toolkit
rtkFFTHilbertImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
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 rtkFFTHilbertImageFilter_h
20 #define rtkFFTHilbertImageFilter_h
21 
22 #include <itkConceptChecking.h>
23 #include "rtkConfiguration.h"
25 #include "rtkMacro.h"
26 
27 namespace rtk
28 {
29 
40 template <class TInputImage, class TOutputImage = TInputImage, class TFFTPrecision = double>
41 class ITK_EXPORT FFTHilbertImageFilter
42  : public rtk::FFTProjectionsConvolutionImageFilter<TInputImage, TOutputImage, TFFTPrecision>
43 {
44 public:
45  ITK_DISALLOW_COPY_AND_MOVE(FFTHilbertImageFilter);
46 
52 
54  using InputImageType = TInputImage;
55  using OutputImageType = TOutputImage;
56  using FFTPrecisionType = TFFTPrecision;
57  using IndexType = typename InputImageType::IndexType;
58  using SizeType = typename InputImageType::SizeType;
59 
60  using FFTInputImageType = typename Superclass::FFTInputImageType;
61  using FFTInputImagePointer = typename FFTInputImageType::Pointer;
62  using FFTOutputImageType = typename Superclass::FFTOutputImageType;
63  using FFTOutputImagePointer = typename FFTOutputImageType::Pointer;
64 
66  itkNewMacro(Self);
67 
68  itkGetMacro(PixelShift, double);
69  // The Set macro is redefined to clear the current FFT kernel when a parameter
70  // is modified.
71  virtual void
72  SetPixelShift(const double _arg)
73  {
74  itkDebugMacro("setting PixelShift to " << _arg);
76  CLANG_SUPPRESS_Wfloat_equal if (this->m_PixelShift != _arg)
77  {
78  this->m_PixelShift = _arg;
79  this->Modified();
80  this->m_KernelFFT = nullptr;
81  }
83  }
84 
86 #ifdef itkOverrideGetNameOfClassMacro
87  itkOverrideGetNameOfClassMacro(FFTHilbertImageFilter);
88 #else
90 #endif
91 
92 
93 protected:
94  FFTHilbertImageFilter() = default;
95  ~FFTHilbertImageFilter() override = default;
96 
97  void
98  GenerateOutputInformation() override;
99 
102  void
103  UpdateFFTProjectionsConvolutionKernel(const SizeType s) override;
104 
105 private:
107  double m_PixelShift;
108 
109 }; // end of class
110 
111 } // end namespace rtk
112 
113 #ifndef ITK_MANUAL_INSTANTIATION
114 # include "rtkFFTHilbertImageFilter.hxx"
115 #endif
116 
117 #endif
Base class for 1D or 2D FFT based convolution of projections.
typename Superclass::FFTInputImageType FFTInputImageType
virtual void SetPixelShift(const double _arg)
TInputImage InputImageType
typename InputImageType::IndexType IndexType
typename Superclass::FFTOutputImageType FFTOutputImageType
Implements the Hilbert transform.
TOutputImage OutputImageType
typename InputImageType::SizeType SizeType
#define CLANG_PRAGMA_POP
Definition: rtkMacro.h:39
#define CLANG_PRAGMA_PUSH
Definition: rtkMacro.h:38
typename FFTOutputImageType::Pointer FFTOutputImagePointer
#define CLANG_SUPPRESS_Wfloat_equal
Definition: rtkMacro.h:40
typename FFTInputImageType::Pointer FFTInputImagePointer