PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
vtkPlusProbeCalibrationOptimizerAlgo.h
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 #ifndef __vtkPlusProbeCalibrationOptimizerAlgo_h
8 #define __vtkPlusProbeCalibrationOptimizerAlgo_h
9 
10 #include "PlusConfigure.h"
11 
12 #include "vtkObject.h"
13 
15 
16 #include <set>
17 
18 class vtkXMLDataElement;
20 
21 //-----------------------------------------------------------------------------
22 
36 class vtkPlusProbeCalibrationOptimizerAlgo : public vtkObject
37 {
38 
39 public:
40 
41  /* Choose one of the posible metrics*/
43  {
47  };
48 
49  vtkTypeMacro(vtkPlusProbeCalibrationOptimizerAlgo,vtkObject);
51 
52  PlusStatus ReadConfiguration( vtkXMLDataElement* aConfig );
53 
55  bool Enabled();
56 
59 
61  PlusStatus SetInputDataForMiddlePointMethod(std::vector< vnl_vector<double> > *calibrationMiddleWireIntersectionPointsPos_Image, std::vector< vnl_vector<double> > *calibrationMiddleWireIntersectionPointsPos_Probe, vnl_matrix_fixed<double,4,4> *imageToProbeTransformMatrix, std::set<int>* outliers);
62 
64  PlusStatus SetOptimizerDataUsingNWires(std::vector< vnl_vector<double> > *calibrationAllWiresIntersectionPointsPos_Image, std::vector<PlusNWire> *nWires, std::vector< vnl_matrix_fixed<double,4,4> > *probeToPhantomTransforms, vnl_matrix_fixed<double,4,4> *imageToProbeTransformMatrix, std::set<int>* outliers);
65 
67  vnl_matrix_fixed<double,4,4> GetOptimizedImageToProbeTransformMatrix();
68 
69  void ComputeError(const vnl_matrix_fixed<double,4,4> &imageToProbeTransformationMatrix, double &errorMean, double &errorStDev, double &errorRms);
70 
72  void SetIsotropicPixelSpacing(bool isotropicPixelSpacing) { this->IsotropicPixelSpacing=isotropicPixelSpacing; }
73 
75  void SetOptimizationMethod(OptimizationMethodType optimizationMethod) { this->OptimizationMethod=optimizationMethod; }
77 
78  void SetImageToProbeSeedTransform(const vnl_matrix_fixed<double,4,4> &imageToProbeTransformMatrix);
79 
80  void SetProbeCalibrationAlgo(vtkPlusProbeCalibrationAlgo* probeCalibrationAlgo);
81 
82 protected:
83 
84  PlusStatus ShowTransformation(const vnl_matrix_fixed<double,4,4> &transformationMatrix);
85 
88 
89 protected:
92 
95 
97  vnl_matrix_fixed<double,4,4> ImageToProbeSeedTransformMatrix;
98 
100  vnl_matrix_fixed<double,4,4> ImageToProbeTransformMatrix;
101 
103 
104 };
105 
106 #endif
Refines the image to probe transform using non-linear optimization.
PlusStatus SetOptimizerDataUsingNWires(std::vector< vnl_vector< double > > *calibrationAllWiresIntersectionPointsPos_Image, std::vector< PlusNWire > *nWires, std::vector< vnl_matrix_fixed< double, 4, 4 > > *probeToPhantomTransforms, vnl_matrix_fixed< double, 4, 4 > *imageToProbeTransformMatrix, std::set< int > *outliers)
static const char * GetOptimizationMethodAsString(OptimizationMethodType type)
void SetIsotropicPixelSpacing(bool isotropicPixelSpacing)
PlusStatus SetInputDataForMiddlePointMethod(std::vector< vnl_vector< double > > *calibrationMiddleWireIntersectionPointsPos_Image, std::vector< vnl_vector< double > > *calibrationMiddleWireIntersectionPointsPos_Probe, vnl_matrix_fixed< double, 4, 4 > *imageToProbeTransformMatrix, std::set< int > *outliers)
igsioStatus PlusStatus
Definition: PlusCommon.h:40
void SetImageToProbeSeedTransform(const vnl_matrix_fixed< double, 4, 4 > &imageToProbeTransformMatrix)
void SetProbeCalibrationAlgo(vtkPlusProbeCalibrationAlgo *probeCalibrationAlgo)
PlusStatus ShowTransformation(const vnl_matrix_fixed< double, 4, 4 > &transformationMatrix)
vnl_matrix_fixed< double, 4, 4 > GetOptimizedImageToProbeTransformMatrix()
void ComputeError(const vnl_matrix_fixed< double, 4, 4 > &imageToProbeTransformationMatrix, double &errorMean, double &errorStDev, double &errorRms)
vnl_matrix_fixed< double, 4, 4 > ImageToProbeTransformMatrix
void SetOptimizationMethod(OptimizationMethodType optimizationMethod)
static vtkPlusProbeCalibrationOptimizerAlgo * New()
vnl_matrix_fixed< double, 4, 4 > ImageToProbeSeedTransformMatrix
PlusStatus ReadConfiguration(vtkXMLDataElement *aConfig)
Probe calibration algorithm class.