35 #ifndef __itkRadialDistortionTransform_h
36 #define __itkRadialDistortionTransform_h
42 #include <itkTransform.h>
43 #include <itkExceptionObject.h>
47 #include <Core/ITKCommon/Transform/itkInverseTransform.h>
75 template <
class TScalar =
double,
unsigned int N = 2>
77 public Transform<TScalar, 2, 2>
82 typedef Transform<TScalar, 2, 2> Superclass;
83 typedef SmartPointer<Self> Pointer;
84 typedef SmartPointer<const Self> ConstPointer;
90 typedef typename InverseTransformBaseType::Pointer InverseTransformBasePointer;
93 itkStaticConstMacro(Nk,
unsigned int, N);
108 typedef typename Superclass::ParametersType ParametersType;
109 typedef typename Superclass::JacobianType JacobianType;
111 typedef typename Superclass::InputPointType InputPointType;
112 typedef typename Superclass::OutputPointType OutputPointType;
116 OutputPointType TransformPoint(
const InputPointType & p)
const;
121 InputPointType BackTransformPoint(
const OutputPointType & y)
const;
125 void SetFixedParameters(
const ParametersType & params)
126 { this->m_FixedParameters = params; }
130 const ParametersType & GetFixedParameters()
const
131 {
return this->m_FixedParameters; }
135 void SetParameters(
const ParametersType & params)
136 { this->m_Parameters = params; }
140 const ParametersType & GetParameters()
const
141 {
return this->m_Parameters; }
145 NumberOfParametersType GetNumberOfParameters()
const
151 virtual void ComputeJacobianWithRespectToParameters(
const InputPointType &, JacobianType & )
const;
154 virtual InverseTransformBasePointer GetInverseTransform()
const
156 typedef InverseTransform<Self> InvTransformType;
157 typename InvTransformType::Pointer inv = InvTransformType::New();
158 inv->SetForwardTransform(
this);
159 return inv.GetPointer();
170 const double Rmax = 0.0)
172 double & ac_ = this->m_FixedParameters[0];
173 double & bc_ = this->m_FixedParameters[1];
174 double & rmax_ = this->m_FixedParameters[2];
177 ac_ = 0.5 * (a_min + a_max);
178 bc_ = 0.5 * (b_min + b_max);
187 const double w = a_max - a_min;
188 const double h = b_max - b_min;
189 rmax_ = sqrt(w * w + h * h) / 2.0;
194 void setup_translation(
195 const double ta_Rmax = 0.0,
196 const double tb_Rmax = 0.0)
198 const double & Rmax = this->m_FixedParameters[2];
202 itkExceptionMacro(<<
"Rmax parameter is null");
206 double & ta = this->m_Parameters[N];
207 double & tb = this->m_Parameters[N + 1];
214 void eval(
const std::vector<ScalarType> & x,
215 std::vector<ScalarType> & F,
216 std::vector<std::vector<ScalarType> > & J)
const;
219 inline const double & GetRmax()
const
220 {
return this->m_FixedParameters[2]; }
223 static void setup_shared_params_mask(
bool shared, std::vector<bool> & mask)
225 mask.assign(N + 2,
false);
226 for (
unsigned int i = 0; i < N; i++)
233 RadialDistortionTransform();
237 void PrintSelf(std::ostream & s, Indent indent)
const;
241 RadialDistortionTransform(
const Self & other);
242 const Self & operator = (
const Self & t);
249 #ifndef ITK_MANUAL_INSTANTIATION
250 #include <Core/ITKCommon/Transform/itkRadialDistortionTransform.txx>
253 #endif // __itkRadialDistortionTransform_h
Definition: itkNormalizeImageFilterWithMask.h:48