RTK  2.4.1
Reconstruction Toolkit
rtkFFTRampImageFilter.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 rtkFFTRampImageFilter_h
20 #define rtkFFTRampImageFilter_h
21 
22 #include <itkConceptChecking.h>
23 #include "rtkConfiguration.h"
25 #include "rtkMacro.h"
26 
27 // The Set macro is redefined to clear the current FFT kernel when a parameter
28 // is modified.
29 #undef itkSetMacro
30 #define itkSetMacro(name, type) \
31  virtual void Set##name(const type _arg) \
32  { \
33  itkDebugMacro("setting " #name " to " << _arg); \
34  CLANG_PRAGMA_PUSH \
35  CLANG_SUPPRESS_Wfloat_equal if (this->m_##name != _arg) \
36  { \
37  this->m_##name = _arg; \
38  this->Modified(); \
39  this->m_KernelFFT = nullptr; \
40  } \
41  CLANG_PRAGMA_POP \
42  }
43 
44 namespace rtk
45 {
46 
60 template <class TInputImage, class TOutputImage = TInputImage, class TFFTPrecision = double>
61 class ITK_TEMPLATE_EXPORT FFTRampImageFilter
62  : public rtk::FFTProjectionsConvolutionImageFilter<TInputImage, TOutputImage, TFFTPrecision>
63 {
64 public:
65  ITK_DISALLOW_COPY_AND_MOVE(FFTRampImageFilter);
66 
72 
74  using InputImageType = TInputImage;
75  using OutputImageType = TOutputImage;
76  using FFTPrecisionType = TFFTPrecision;
77  using IndexType = typename InputImageType::IndexType;
78  using SizeType = typename InputImageType::SizeType;
79 
80  using FFTInputImageType = typename Superclass::FFTInputImageType;
81  using FFTInputImagePointer = typename FFTInputImageType::Pointer;
82  using FFTOutputImageType = typename Superclass::FFTOutputImageType;
83  using FFTOutputImagePointer = typename FFTOutputImageType::Pointer;
84 
86  itkNewMacro(Self);
87 
90 
92  itkGetConstMacro(HannCutFrequency, double);
93  itkSetMacro(HannCutFrequency, double);
95 
97  itkGetConstMacro(CosineCutFrequency, double);
98  itkSetMacro(CosineCutFrequency, double);
100 
102  itkGetConstMacro(HammingFrequency, double);
103  itkSetMacro(HammingFrequency, double);
105 
107  itkGetConstMacro(HannCutFrequencyY, double);
108  itkSetMacro(HannCutFrequencyY, double);
110 
118  itkGetConstMacro(RamLakCutFrequency, double);
119  itkSetMacro(RamLakCutFrequency, double);
121 
129  itkGetConstMacro(SheppLoganCutFrequency, double);
130  itkSetMacro(SheppLoganCutFrequency, double);
132 
133 protected:
135  ~FFTRampImageFilter() override = default;
136 
137  void
138  GenerateInputRequestedRegion() override;
139 
142  void
143  UpdateFFTProjectionsConvolutionKernel(const SizeType s) override;
144 
145 private:
150  double m_HannCutFrequency{ 0. };
151  double m_CosineCutFrequency{ 0. };
152  double m_HammingFrequency{ 0. };
153  double m_HannCutFrequencyY{ 0. };
154 
157  double m_RamLakCutFrequency{ 0. };
158  double m_SheppLoganCutFrequency{ 0. };
159 
161 }; // end of class
162 
163 } // end namespace rtk
164 
165 #ifndef ITK_MANUAL_INSTANTIATION
166 # include "rtkFFTRampImageFilter.hxx"
167 #endif
168 
169 // Rollback to the original definition of the Set macro
170 #undef itkSetMacro
171 #define itkSetMacro(name, type) \
172  virtual void Set##name(const type _arg) \
173  { \
174  itkDebugMacro("setting " #name " to " << _arg); \
175  CLANG_PRAGMA_PUSH \
176  CLANG_SUPPRESS_Wfloat_equal if (this->m_##name != _arg) \
177  { \
178  this->m_##name = _arg; \
179  this->Modified(); \
180  } \
181  CLANG_PRAGMA_POP \
182  }
183 
184 #endif
Base class for 1D or 2D FFT based convolution of projections.
TInputImage InputImageType
#define itkSetMacro(name, type)
TOutputImage OutputImageType
typename itk::Image< TFFTPrecision, TInputImage::ImageDimension > FFTInputImageType
Implements the ramp image filter of the filtered backprojection algorithm.
typename itk::Image< std::complex< TFFTPrecision >, TInputImage::ImageDimension > FFTOutputImageType