RTK  2.0.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  * 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 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 \
36  if ( this->m_##name != _arg ) \
37  { \
38  this->m_##name = _arg; \
39  this->Modified(); \
40  this->m_KernelFFT = nullptr; \
41  } \
42 CLANG_PRAGMA_POP \
43  }
44 
45 namespace rtk
46 {
47 
61 template<class TInputImage, class TOutputImage=TInputImage, class TFFTPrecision=double>
62 class ITK_EXPORT FFTRampImageFilter :
63  public rtk::FFTProjectionsConvolutionImageFilter<TInputImage, TOutputImage, TFFTPrecision>
64 {
65 public:
66  ITK_DISALLOW_COPY_AND_ASSIGN(FFTRampImageFilter);
67 
71  TOutputImage,
72  TFFTPrecision>;
75 
77  using InputImageType = TInputImage;
78  using OutputImageType = TOutputImage;
79  using FFTPrecisionType = TFFTPrecision;
80  using IndexType = typename InputImageType::IndexType;
81  using SizeType = typename InputImageType::SizeType;
82 
83  using FFTInputImageType = typename Superclass::FFTInputImageType;
84  using FFTInputImagePointer = typename FFTInputImageType::Pointer;
85  using FFTOutputImageType = typename Superclass::FFTOutputImageType;
86  using FFTOutputImagePointer = typename FFTOutputImageType::Pointer;
87 
89  itkNewMacro(Self);
90 
93 
95  itkGetConstMacro(HannCutFrequency, double);
96  itkSetMacro(HannCutFrequency, double);
98 
100  itkGetConstMacro(CosineCutFrequency, double);
101  itkSetMacro(CosineCutFrequency, double);
103 
105  itkGetConstMacro(HammingFrequency, double);
106  itkSetMacro(HammingFrequency, double);
108 
110  itkGetConstMacro(HannCutFrequencyY, double);
111  itkSetMacro(HannCutFrequencyY, double);
113 
121  itkGetConstMacro(RamLakCutFrequency, double);
122  itkSetMacro(RamLakCutFrequency, double);
124 
132  itkGetConstMacro(SheppLoganCutFrequency, double);
133  itkSetMacro(SheppLoganCutFrequency, double);
135 
136 protected:
138  ~FFTRampImageFilter() override = default;
139 
140  void GenerateInputRequestedRegion() override;
141 
144  void UpdateFFTProjectionsConvolutionKernel(const SizeType size) override;
145 
146 private:
151  double m_HannCutFrequency{0.};
152  double m_CosineCutFrequency{0.};
153  double m_HammingFrequency{0.};
154  double m_HannCutFrequencyY{0.};
155 
158  double m_RamLakCutFrequency{0.};
159  double m_SheppLoganCutFrequency{0.};
160 
162 }; // end of class
163 
164 } // end namespace rtk
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
167 #include "rtkFFTRampImageFilter.hxx"
168 #endif
169 
170 // Rollback to the original definition of the Set macro
171 #undef itkSetMacro
172 #define itkSetMacro(name, type) \
173  virtual void Set##name (const type _arg) \
174  { \
175  itkDebugMacro("setting " #name " to " << _arg); \
176 CLANG_PRAGMA_PUSH \
177 CLANG_SUPPRESS_Wfloat_equal \
178  if ( this->m_##name != _arg ) \
179  { \
180  this->m_##name = _arg; \
181  this->Modified(); \
182  } \
183 CLANG_PRAGMA_POP \
184  }
185 
186 #endif
Base class for 1D or 2D FFT based convolution of projections.
typename itk::Image< TFFTPrecision, TInputImage::ImageDimension > FFTInputImageType
TInputImage InputImageType
TOutputImage OutputImageType
Implements the ramp image filter of the filtered backprojection algorithm.
typename itk::Image< std::complex< TFFTPrecision >, TInputImage::ImageDimension > FFTOutputImageType
#define itkSetMacro(name, type)