18 #ifndef itkGaborKernelFunction_h
19 #define itkGaborKernelFunction_h
50 template <
typename TRealValueType>
69 Evaluate(
const TRealValueType & u)
const override
71 TRealValueType parameter = itk::Math::sqr(u / this->m_Sigma);
72 TRealValueType envelope = std::exp(TRealValueType{ -0.5 } * parameter);
73 TRealValueType phase = TRealValueType{ 2.0 *
itk::Math::pi } * this->m_Frequency * u + this->m_PhaseOffset;
76 if (this->m_CalculateImaginaryPart)
78 return envelope * std::sin(phase);
82 return envelope * std::cos(phase);
87 itkSetMacro(Sigma, TRealValueType);
88 itkGetConstMacro(Sigma, TRealValueType);
92 itkSetMacro(Frequency, TRealValueType);
93 itkGetConstMacro(Frequency, TRealValueType);
97 itkSetMacro(PhaseOffset, TRealValueType);
98 itkGetConstMacro(PhaseOffset, TRealValueType);
103 itkSetMacro(CalculateImaginaryPart,
bool);
104 itkGetConstMacro(CalculateImaginaryPart,
bool);
105 itkBooleanMacro(CalculateImaginaryPart);
111 this->m_CalculateImaginaryPart =
false;
112 this->m_Sigma = TRealValueType{ 1.0 };
113 this->m_Frequency = TRealValueType{ 0.4 };
114 this->m_PhaseOffset = TRealValueType{ 0.0 };
120 Superclass::PrintSelf(os, indent);
122 os << indent <<
"Sigma: " << this->GetSigma() << std::endl;
123 os << indent <<
"Frequency: " << this->GetFrequency() << std::endl;
124 os << indent <<
"PhaseOffset: " << this->GetPhaseOffset() << std::endl;
125 os << indent <<
"CalculateImaginaryPart: " << this->GetCalculateImaginaryPart() << std::endl;
129 TRealValueType m_Sigma{};
131 TRealValueType m_Frequency{};
133 TRealValueType m_PhaseOffset{};
135 bool m_CalculateImaginaryPart{};