15 #ifndef niftkUltrasoundPointerCalibrationCostFunction_h
16 #define niftkUltrasoundPointerCalibrationCostFunction_h
18 #include <itkMultipleValuedCostFunction.h>
19 #include <mitkPointSet.h>
20 #include <vtkSmartPointer.h>
21 #include <vtkMatrix4x4.h>
59 virtual void GetDerivative(
const ParametersType & parameters, DerivativeType & derivative )
const override;
64 void SetScales(
const ParametersType& scales);
74 vtkSmartPointer<vtkMatrix4x4>
GetRigidMatrix(
const ParametersType & parameters)
const;
79 vtkSmartPointer<vtkMatrix4x4>
GetScalingMatrix(
const ParametersType & parameters)
const;
86 virtual MeasureType
GetValue(
const ParametersType & parameters )
const override;
121 unsigned int m_NumberOfParameters;
122 ParametersType m_Scales;
123 mitk::PointSet::Pointer m_ImagePoints;
124 mitk::PointSet::Pointer m_SensorPoints;
vtkSmartPointer< vtkMatrix4x4 > GetRigidMatrix(const ParametersType ¶meters) const
Returns the rigid matrix for the given parameters.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:174
Superclass::ParametersType ParametersType
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:39
Cost function for Ultrasound Pointer based calibration, a la Muratore 2001.
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:29
void ValidateSizeOfScalesArray(const ParametersType ¶meters) const
Checks the supplied parameters array is the right size (i.e. it equals this->m_Scales.GetSize()), and throws mitk::Exception if it isnt.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:90
virtual unsigned int GetNumberOfParameters() const override
Required by base class to return the number of parameters.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:46
void SetImagePoints(const mitk::PointSet::Pointer imagePoints)
Sets the points in image space.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:61
virtual void GetDerivative(const ParametersType ¶meters, DerivativeType &derivative) const override
Simply uses central differences to approximate the derivative for each of the parameters. See also SetScales where you set the relative size of each parameter step size.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:125
GLboolean GLenum GLenum GLvoid * values
Definition: glew.h:4068
virtual ~UltrasoundPointerCalibrationCostFunction()
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:33
itk::SmartPointer< Self > Pointer
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:36
UltrasoundPointerCalibrationCostFunction & operator=(const UltrasoundPointerCalibrationCostFunction &)
UltrasoundPointerCalibrationCostFunction Self
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:34
double GetResidual(const MeasureType &values) const
Returns the RMS residual of all the values stored in the values array.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:103
itk::SmartPointer< const Self > ConstPointer
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:37
Superclass::DerivativeType DerivativeType
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:42
void SetSensorPoints(const mitk::PointSet::Pointer sensorPoints)
Sets the points in sensor space.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:69
virtual MeasureType GetValue(const ParametersType ¶meters) const override
The cost function is the residual error of the reconstructed point, where this function returns an ar...
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:199
itk::MultipleValuedCostFunction Superclass
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:35
Superclass::MeasureType MeasureType
Definition: niftkUltrasoundPointerCalibrationCostFunction.h:43
UltrasoundPointerCalibrationCostFunction()
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:22
virtual unsigned int GetNumberOfValues(void) const override
Equal to the number of points * 3.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:39
void SetScales(const ParametersType &scales)
Used when calculating derivative using central differences.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:53
void ValidateSizeOfParametersArray(const ParametersType ¶meters) const
Checks the supplied parameters array is the right size (i.e. it equals this->GetNumberOfParameters())...
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:77
vtkSmartPointer< vtkMatrix4x4 > GetScalingMatrix(const ParametersType ¶meters) const
Returns the scaling matrix for the given parameters.
Definition: niftkUltrasoundPointerCalibrationCostFunction.cxx:188
Definition: niftkExceptionObject.h:21