35 #ifndef __itkRBFTransform_h
36 #define __itkRBFTransform_h
43 #include <itkTransform.h>
44 #include <itkExceptionObject.h>
48 #include <Core/ITKCommon/Transform/itkInverseTransform.h>
85 typedef Transform<double, 2, 2> Superclass;
86 typedef SmartPointer<Self> Pointer;
87 typedef SmartPointer<const Self> ConstPointer;
92 typedef InverseTransformBaseType::Pointer InverseTransformBasePointer;
108 typedef Superclass::ParametersType ParametersType;
109 typedef Superclass::JacobianType JacobianType;
111 typedef Superclass::InputPointType InputPointType;
112 typedef Superclass::OutputPointType OutputPointType;
115 virtual OutputPointType TransformPoint(
const InputPointType & uv)
const;
120 InputPointType BackTransformPoint(
const OutputPointType & y)
const;
124 void SetFixedParameters(
const ParametersType & params)
125 { this->m_FixedParameters = params; }
129 const ParametersType & GetFixedParameters()
const
130 {
return this->m_FixedParameters; }
134 void SetParameters(
const ParametersType & params)
135 { this->m_Parameters = params; }
139 const ParametersType & GetParameters()
const
140 {
return this->m_Parameters; }
144 NumberOfParametersType GetNumberOfParameters()
const
145 {
return this->m_Parameters.size(); }
147 bool GetInverse(Self* inverse)
const;
150 virtual InverseTransformBasePointer GetInverseTransform()
const;
155 const OutputPointType & tile_min,
156 const OutputPointType & tile_max,
159 const unsigned int num_pts,
160 const InputPointType * uv,
161 const OutputPointType * xy);
167 virtual void ComputeJacobianWithRespectToParameters(
const InputPointType &, JacobianType & )
const;
178 inline unsigned int num_points()
const
179 {
return (this->m_FixedParameters.size() - 4) / 2; }
182 inline static unsigned int index_a(
const unsigned int & i)
185 inline static unsigned int index_b(
const unsigned int & i)
186 {
return i * 2 + 1; }
188 inline static unsigned int index_f(
const unsigned int & i)
189 {
return i * 2 + 6; }
191 inline static unsigned int index_g(
const unsigned int & i)
192 {
return i * 2 + 7; }
194 inline static unsigned int index_uv(
const unsigned int & i)
195 {
return i * 2 + 4; }
198 inline const double & GetXmax()
const
199 {
return this->m_FixedParameters[0]; }
201 inline const double & GetYmax()
const
202 {
return this->m_FixedParameters[1]; }
205 inline const double & GetUc()
const
206 {
return this->m_FixedParameters[2]; }
208 inline const double & GetVc()
const
209 {
return this->m_FixedParameters[3]; }
212 inline const double * uv(
const unsigned int & i)
const
213 {
return &(this->m_FixedParameters[index_uv(i)]); }
216 inline const double & a(
const unsigned int & i)
const
217 {
return this->m_Parameters[index_a(i)]; }
219 inline const double & b(
const unsigned int & i)
const
220 {
return this->m_Parameters[index_b(i)]; }
223 inline const double & f(
const unsigned int & i)
const
224 {
return this->m_Parameters[index_f(i)]; }
226 inline const double & g(
const unsigned int & i)
const
227 {
return this->m_Parameters[index_g(i)]; }
230 inline static double kernel(
const double * uv,
235 double U = (uv[0] - uv_i[0]) / Xmax;
236 double V = (uv[1] - uv_i[1]) / Ymax;
237 double R = U * U + V * V;
238 return R == 0 ? 0 : R * log(R);
247 void PrintSelf(std::ostream & s, Indent indent)
const;
251 RBFTransform(
const Self & other);
252 const Self & operator = (
const Self & t);
259 #endif // __itkRBFTransform_h
Definition: itkNormalizeImageFilterWithMask.h:48