15 #ifndef itkInvariantPointCalibrationCostFunction_h
16 #define itkInvariantPointCalibrationCostFunction_h
18 #include <itkMultipleValuedCostFunction.h>
20 #include <mitkPoint.h>
21 #include <mitkVector.h>
62 itkSetMacro(InvariantPoint, mitk::Point3D);
63 itkGetConstMacro(InvariantPoint, mitk::Point3D);
65 itkSetMacro(OptimiseInvariantPoint,
bool);
66 itkGetConstMacro(OptimiseInvariantPoint,
bool);
68 itkSetMacro(TimingLag,
double);
69 itkGetConstMacro(TimingLag,
double);
71 itkSetMacro(AllowableTimingError, TimeStampType);
72 itkGetConstMacro(AllowableTimingError, TimeStampType);
74 itkSetMacro(OptimiseTimingLag,
bool);
75 itkGetConstMacro(OptimiseTimingLag,
bool);
77 itkSetMacro(OptimiseRigidTransformation,
bool);
78 itkGetConstMacro(OptimiseRigidTransformation,
bool);
80 itkSetMacro(Verbose,
bool);
81 itkGetConstMacro(Verbose,
bool);
110 virtual void GetDerivative(
const ParametersType & parameters, DerivativeType & derivative )
const override;
115 void SetScales(
const ParametersType& scales);
130 void SetPointData(std::vector< std::pair<unsigned long long, cv::Point3d> >* pointData);
137 virtual MeasureType
GetValue(
const ParametersType & parameters )
const override;
182 double GetLag(
const ParametersType & parameters)
const;
194 std::vector< std::pair<TimeStampType, cv::Point3d> > *
m_PointData;
itk::SmartPointer< Self > Pointer
Definition: itkInvariantPointCalibrationCostFunction.h:54
cv::Matx44d GetTranslationTransformation(const ParametersType ¶meters) const
Computes the translation transformation.
Definition: itkInvariantPointCalibrationCostFunction.cxx:224
Base class for Ultrasound Pin/Cross-Wire calibration and Video Hand-Eye calibration cost functions...
Definition: itkInvariantPointCalibrationCostFunction.h:47
Superclass::DerivativeType DerivativeType
Definition: itkInvariantPointCalibrationCostFunction.h:58
Superclass::ParametersType ParametersType
Definition: itkInvariantPointCalibrationCostFunction.h:57
Superclass::MeasureType MeasureType
Definition: itkInvariantPointCalibrationCostFunction.h:59
void SetScales(const ParametersType &scales)
Used when calculating derivative using central differences.
Definition: itkInvariantPointCalibrationCostFunction.cxx:300
void SetTrackingData(mitk::TrackingAndTimeStampsContainer *trackingData)
Sets the tracking data onto this object.
Definition: itkInvariantPointCalibrationCostFunction.cxx:316
virtual unsigned int GetNumberOfParameters() const override
Required by base class to return the number of parameters. See introduction to this class...
Definition: itkInvariantPointCalibrationCostFunction.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: itkInvariantPointCalibrationCostFunction.cxx:139
unsigned int m_NumberOfValues
Definition: itkInvariantPointCalibrationCostFunction.h:191
unsigned long long TimeStamp
Definition: mitkTimeStampsContainer.h:34
mitk::TimeStampsContainer::TimeStamp TimeStampType
Definition: itkInvariantPointCalibrationCostFunction.h:60
mitk::Point3D m_InvariantPoint
Definition: itkInvariantPointCalibrationCostFunction.h:185
const GLfloat * params
Definition: glew.h:1515
itk::SmartPointer< const Self > ConstPointer
Definition: itkInvariantPointCalibrationCostFunction.h:55
Definition: niftkITKAffineResampleImage.cxx:74
mitk::TrackingAndTimeStampsContainer * m_TrackingData
Definition: itkInvariantPointCalibrationCostFunction.h:195
unsigned int m_NumberOfParameters
Definition: itkInvariantPointCalibrationCostFunction.h:193
double m_TimingLag
Definition: itkInvariantPointCalibrationCostFunction.h:187
GLboolean GLenum GLenum GLvoid * values
Definition: glew.h:4068
void SetRigidTransformationParameters(const std::vector< double > ¶ms)
Definition: itkInvariantPointCalibrationCostFunction.cxx:131
double GetResidual(const MeasureType &values) const
Returns the RMS residual of all the values stored in the values array.
Definition: itkInvariantPointCalibrationCostFunction.cxx:278
bool m_Verbose
Definition: itkInvariantPointCalibrationCostFunction.h:196
ParametersType m_Scales
Definition: itkInvariantPointCalibrationCostFunction.h:184
void SetPointData(std::vector< std::pair< unsigned long long, cv::Point3d > > *pointData)
Sets the point data onto this object, setting the number of values = pointData.size()*3.
Definition: itkInvariantPointCalibrationCostFunction.cxx:324
std::vector< double > m_RigidTransformation
Definition: itkInvariantPointCalibrationCostFunction.h:189
bool m_OptimiseRigidTransformation
Definition: itkInvariantPointCalibrationCostFunction.h:190
InvariantPointCalibrationCostFunction()
Definition: itkInvariantPointCalibrationCostFunction.cxx:23
bool m_OptimiseTimingLag
Definition: itkInvariantPointCalibrationCostFunction.h:188
bool m_OptimiseInvariantPoint
Definition: itkInvariantPointCalibrationCostFunction.h:186
Contains a matched vector of timestamps, and 4x4 tracking Matrices.
Definition: mitkTrackingAndTimeStampsContainer.h:32
void SetRigidTransformation(const cv::Matx44d &rigidBodyTrans)
Definition: itkInvariantPointCalibrationCostFunction.cxx:69
virtual cv::Matx44d GetCalibrationTransformation(const ParametersType ¶meters) const =0
Computes the calibration (image-to-probe) or (hand-eye) transformation from the current estimate of t...
virtual unsigned int GetNumberOfValues(void) const override
Equal to the number of points * 3.
Definition: itkInvariantPointCalibrationCostFunction.cxx:54
void SetNumberOfParameters(const int &numberOfParameters)
Sets the number of parameters being optimised. This should be called before optimisation starts...
Definition: itkInvariantPointCalibrationCostFunction.cxx:308
itk::MultipleValuedCostFunction Superclass
Definition: itkInvariantPointCalibrationCostFunction.h:53
InvariantPointCalibrationCostFunction Self
Definition: itkInvariantPointCalibrationCostFunction.h:52
TimeStampType m_AllowableTimingError
Definition: itkInvariantPointCalibrationCostFunction.h:192
std::vector< double > GetRigidTransformationParameters() const
Definition: itkInvariantPointCalibrationCostFunction.cxx:124
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: itkInvariantPointCalibrationCostFunction.cxx:367
InvariantPointCalibrationCostFunction & operator=(const InvariantPointCalibrationCostFunction &)
std::vector< std::pair< TimeStampType, cv::Point3d > > * m_PointData
Definition: itkInvariantPointCalibrationCostFunction.h:194
virtual ~InvariantPointCalibrationCostFunction()
Definition: itkInvariantPointCalibrationCostFunction.cxx:48
cv::Matx44d GetRigidTransformation() const
Definition: itkInvariantPointCalibrationCostFunction.cxx:96
void ValidateSizeOfParametersArray(const ParametersType ¶meters) const
Checks the supplied parameters array is the right size (i.e. it equals this->GetNumberOfParameters())...
Definition: itkInvariantPointCalibrationCostFunction.cxx:333
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: itkInvariantPointCalibrationCostFunction.cxx:355
double GetLag(const ParametersType ¶meters) const
Extracts the lag parameter from the array of things being optimised.
Definition: itkInvariantPointCalibrationCostFunction.cxx:247