18 #ifndef __itkGaborKernelFunction_h
19 #define __itkGaborKernelFunction_h
49 template<
typename TRealValueType>
65 inline TRealValueType Evaluate(
const TRealValueType & u)
const
67 TRealValueType parameter = vnl_math_sqr(u / this->m_Sigma);
68 TRealValueType envelope = vcl_exp(static_cast< TRealValueType >(-0.5) * parameter);
69 TRealValueType phase =
static_cast< TRealValueType
>(2.0 *
vnl_math::pi) * this->m_Frequency * u
70 + this->m_PhaseOffset;
73 if ( this->m_CalculateImaginaryPart )
75 return envelope * vcl_sin(phase);
79 return envelope * vcl_cos(phase);
83 itkSetMacro(Sigma, TRealValueType);
84 itkGetConstMacro(Sigma, TRealValueType);
86 itkSetMacro(Frequency, TRealValueType);
87 itkGetConstMacro(Frequency, TRealValueType);
89 itkSetMacro(PhaseOffset, TRealValueType);
90 itkGetConstMacro(PhaseOffset, TRealValueType);
92 itkSetMacro(CalculateImaginaryPart,
bool);
93 itkGetConstMacro(CalculateImaginaryPart,
bool);
94 itkBooleanMacro(CalculateImaginaryPart);
98 this->m_CalculateImaginaryPart =
false;
100 this->m_Frequency =
static_cast<TRealValueType
>(0.4);
104 void PrintSelf(std::ostream & os,
Indent indent)
const
106 Superclass::PrintSelf(os, indent);
108 os << indent <<
"Sigma: " << this->GetSigma() << std::endl;
109 os << indent <<
"Frequency: " << this->GetFrequency() << std::endl;
110 os << indent <<
"PhaseOffset: " << this->GetPhaseOffset() << std::endl;
111 os << indent <<
"CalculateImaginaryPart: " << this->GetCalculateImaginaryPart() << std::endl;
116 void operator=(
const Self &);