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  * http://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_ASSIGN(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 
87 
88 protected:
89  FFTHilbertImageFilter() = default;
90  ~FFTHilbertImageFilter() override = default;
91 
92  void
93  GenerateOutputInformation() override;
94 
97  void
98  UpdateFFTProjectionsConvolutionKernel(const SizeType s) override;
99 
100 private:
102  double m_PixelShift;
103 
104 }; // end of class
105 
106 } // end namespace rtk
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 # include "rtkFFTHilbertImageFilter.hxx"
110 #endif
111 
112 #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