ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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 "rtkConfiguration.h"
24#include "rtkMacro.h"
25#include <itkConceptChecking.h>
26
27// The Set macro is redefined to clear the current FFT kernel when a parameter
28// is modified.
29// clang-format off
30#ifndef ITK_GCC_PRAGMA_PUSH
31#define ITK_GCC_PRAGMA_PUSH CLANG_PRAGMA_PUSH
32#endif
33#ifndef ITK_GCC_SUPPRESS_Wfloat_equal
34#define ITK_GCC_SUPPRESS_Wfloat_equal CLANG_SUPPRESS_Wfloat_equal
35#endif
36#ifndef ITK_GCC_PRAGMA_POP
37#define ITK_GCC_PRAGMA_POP CLANG_PRAGMA_POP
38#endif
39#undef itkSetMacro
40#define itkSetMacro(name, type) \
41 virtual void Set##name(type _arg) \
42 { \
43 itkDebugMacro("setting " #name " to " << _arg); \
44 ITK_GCC_PRAGMA_PUSH \
45 ITK_GCC_SUPPRESS_Wfloat_equal \
46 if (this->m_##name != _arg) \
47 { \
48 this->m_##name = std::move(_arg); \
49 this->Modified(); \
50 this->m_KernelFFT = nullptr; \
51 } \
52 ITK_GCC_PRAGMA_POP \
53 } \
54 ITK_MACROEND_NOOP_STATEMENT
55// clang-format on
56
57namespace rtk
58{
59
72
73template <class TInputImage, class TOutputImage = TInputImage, class TFFTPrecision = double>
74class ITK_TEMPLATE_EXPORT FFTRampImageFilter
75 : public rtk::FFTProjectionsConvolutionImageFilter<TInputImage, TOutputImage, TFFTPrecision>
76{
77public:
78 ITK_DISALLOW_COPY_AND_MOVE(FFTRampImageFilter);
79
85
87 using InputImageType = TInputImage;
88 using OutputImageType = TOutputImage;
89 using FFTPrecisionType = TFFTPrecision;
90 using IndexType = typename InputImageType::IndexType;
91 using SizeType = typename InputImageType::SizeType;
92
94 using FFTInputImagePointer = typename FFTInputImageType::Pointer;
96 using FFTOutputImagePointer = typename FFTOutputImageType::Pointer;
97
99 itkNewMacro(Self);
100
102 itkOverrideGetNameOfClassMacro(FFTRampImageFilter);
103
105 itkGetConstMacro(HannCutFrequency, double);
106 itkSetMacro(HannCutFrequency, double);
107
109 itkGetConstMacro(CosineCutFrequency, double);
110 itkSetMacro(CosineCutFrequency, double);
111
113 itkGetConstMacro(HammingFrequency, double);
114 itkSetMacro(HammingFrequency, double);
115
117 itkGetConstMacro(HannCutFrequencyY, double);
118 itkSetMacro(HannCutFrequencyY, double);
119
127 itkGetConstMacro(RamLakCutFrequency, double);
128 itkSetMacro(RamLakCutFrequency, double);
129
137 itkGetConstMacro(SheppLoganCutFrequency, double);
138 itkSetMacro(SheppLoganCutFrequency, double);
139
140protected:
142 ~FFTRampImageFilter() override = default;
143
144 void
146
149 void
151
153
154private:
159 double m_HannCutFrequency{ 0. };
161 double m_HammingFrequency{ 0. };
163
168
169}; // end of class
170
171} // end namespace rtk
172
173#ifndef ITK_MANUAL_INSTANTIATION
174# include "rtkFFTRampImageFilter.hxx"
175#endif
176
177// Rollback to the original definition of the Set macro
178// clang-format off
179#undef itkSetMacro
180#define itkSetMacro(name, type) \
181 virtual void Set##name(type _arg) \
182 { \
183 itkDebugMacro("setting " #name " to " << _arg); \
184 ITK_GCC_PRAGMA_PUSH \
185 ITK_GCC_SUPPRESS_Wfloat_equal \
186 if (this->m_##name != _arg) \
187 { \
188 this->m_##name = std::move(_arg); \
189 this->Modified(); \
190 } \
191 ITK_GCC_PRAGMA_POP \
192 } \
193 ITK_MACROEND_NOOP_STATEMENT
194// clang-format on
195#endif
Implements transparent reference counting.
Base class for 1D or 2D FFT based convolution of projections.
typename itk::Image< TFFTPrecision, TInputImage::ImageDimension > FFTInputImageType
typename itk::Image< std::complex< TFFTPrecision >, TInputImage::ImageDimension > FFTOutputImageType
void UpdateFFTProjectionsConvolutionKernel(SizeType s) override
itkSetMacro(RamLakCutFrequency, double)
itkSetMacro(CosineCutFrequency, double)
~FFTRampImageFilter() override=default
itkSetMacro(HammingFrequency, double)
itkSetMacro(HannCutFrequencyY, double)
rtk::FFTProjectionsConvolutionImageFilter< OutputImageType, OutputImageType, TFFTPrecision > Superclass
void GenerateInputRequestedRegion() override
itkSetMacro(HannCutFrequency, double)
itkSetMacro(SheppLoganCutFrequency, double)