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);
81 return envelope * std::cos(phase);
85 itkSetMacro(Sigma, TRealValueType);
86 itkGetConstMacro(Sigma, TRealValueType);
90 itkSetMacro(Frequency, TRealValueType);
91 itkGetConstMacro(Frequency, TRealValueType);
95 itkSetMacro(PhaseOffset, TRealValueType);
96 itkGetConstMacro(PhaseOffset, TRealValueType);
101 itkSetMacro(CalculateImaginaryPart,
bool);
102 itkGetConstMacro(CalculateImaginaryPart,
bool);
103 itkBooleanMacro(CalculateImaginaryPart);
109 this->m_CalculateImaginaryPart =
false;
110 this->m_Sigma = TRealValueType{ 1.0 };
111 this->m_Frequency = TRealValueType{ 0.4 };
112 this->m_PhaseOffset = TRealValueType{ 0.0 };
118 Superclass::PrintSelf(os, indent);
120 os << indent <<
"Sigma: " << this->GetSigma() << std::endl;
121 os << indent <<
"Frequency: " << this->GetFrequency() << std::endl;
122 os << indent <<
"PhaseOffset: " << this->GetPhaseOffset() << std::endl;
123 os << indent <<
"CalculateImaginaryPart: " << this->GetCalculateImaginaryPart() << std::endl;
127 TRealValueType m_Sigma{};
129 TRealValueType m_Frequency{};
131 TRealValueType m_PhaseOffset{};
133 bool m_CalculateImaginaryPart{};