SignUKFRegistration.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:       TheSIGN
00004   Module:        SignUKFRegistration.h
00005   Language:      C++
00006   Date:          Date: 2006/08/04 10:27:51
00007   Version:
00008 
00009   Project:       TheSIGN
00010   Application:   Ventriculoscopy-Navigation  (Beluga (?))
00011   Author:        Christian Bauer
00012 
00013 
00014 =========================================================================*/
00015 
00016 
00017 #ifndef __SignUKFRegistration_h
00018 #define __SignUKFRegistration_h
00019 
00020 // includes
00021 #include "vtkPoints.h"
00022 #include "vtkLinearTransform.h"
00023 
00024 #include <vtkMatrix4x4.h>
00025 #include <SignFiducialCollection.h>
00026 #include <SignContext.h>
00027 #include <SignUIBase.h>
00028 // defines
00029 
00030 // class
00031 //class SignElement;
00032 
00033 class SIGN_EXPORT SignUKFRegistration : public vtkLinearTransform
00034 //class SignUKFRegistration : public vtkObject
00035 {
00036 
00037  public:
00038   //SignUKFRegistration(SignContext* context_);
00039 
00040 
00041 
00042   vtkTypeRevisionMacro(SignUKFRegistration,vtkLinearTransform);
00043   void PrintSelf(ostream& os, vtkIndent indent);
00044 
00045   static SignUKFRegistration *New();
00046 
00047   void SetSourcePoints(vtkPoints *sourcepoints);
00048   void SetTargetPoints(vtkPoints *targetpoints);
00049   vtkGetObjectMacro(SourcePoints, vtkPoints);
00050   vtkGetObjectMacro(TargetPoints, vtkPoints);
00051 
00052   vtkMatrix4x4 *RegisterWithUKF(SignFiducialCollection *set1, SignFiducialCollection *set2);
00053 
00054   //vtkMatrix4x4 InternalUpdate();
00055   void InternalUpdate();
00056   double HomogenousTransform[4][4];
00057   // Description:
00058   // Get the MTime.
00059   unsigned long GetMTime();
00060 
00061   void SetContext(SignContext*);
00062   void SetUIBase(SignUIBase*);
00063 
00064   double GetMeanSDError();
00065   double GetMaxSDError();
00066   // Description:
00067   // Invert the transformation.  This is done by switching the
00068   // source and target landmarks.
00069   void Inverse();
00070 
00071   // Description:
00072   // Make another transform of the same type.
00073   vtkAbstractTransform *MakeTransform();
00074 
00075 
00076 
00077 protected:
00078 
00079   SignUKFRegistration();
00080   ~SignUKFRegistration();
00081 
00082   SignContext* context;
00083   SignUIBase* gui;
00084 //   void UKF(double state_vector4ukf[6], double state_covariance4ukf[6][6],
00085 //                             double nearestneighbour_transponated[t][3], double Var_State[6][6],
00086 //                             double MRTPoints4ukf[3][t], double Var_Observ_Diag_3malt[3*t][3*t],
00087 //                             double t, double alpha, double beta, double kappa,
00088 //                             double state_vector[6], double state_covariance[6][6]);
00089   void UKF(double state_vector4ukf[6], double state_covariance4ukf[6][6],
00090            double **nearest_neighbours, double Var_State[6][6],
00091            double **SourcePoints4ukf, double **Var_Observ_Diag_3malt,
00092            int t, double alpha, double beta, double kappa,
00093            double state_vector_new[6], double state_covariance_new[6][6]);
00094 
00095 //  void HfunReg(double x[6][13], double t, double u[3][t], double y[3*t][13]);
00096   void HfunReg(double xSigmaPts4HfunReg[6][13], int t, double **nearest_neighbour_transposed, double **zPredSigmaPts);
00097 
00098   void ScaledSymmetricSigmaPts(double xQ[6], double PQ[6][6], double alpha, double beta, double kappa, double xPts[6][13], double wPts[14]);
00099 
00100   void CholeskyFactorization(double matrix2factorize[6][6]);
00101 
00102   void rotateM(double vector2rot[3], double R[3][3]);
00103 
00104   void AllocateMatrix(double**& M, int r, int c);
00105   void DeallocateMatrix(double **M, int r);
00106   void PrintMatrix(double **M, int r, int c, const char* name);
00107 
00108   void MultiplyMatrix4UKF(double **A, double **B,
00109                           unsigned int rowA, unsigned int colA,
00110                           unsigned int rowB, unsigned int colB,
00111                           double **C);
00112 
00113   vtkPoints *SourcePoints;
00114   vtkPoints *TargetPoints;
00115 
00116 private:
00117   SignUKFRegistration(const SignUKFRegistration&);  // Not implemented.
00118   void operator=(const SignUKFRegistration&);  // Not implemented.
00119 
00120   double mean_squared_dist;
00121   double max_squared_dist;
00122 
00123 };
00124 #endif

Generated on Mon Feb 26 12:11:16 2007 for TheSIGN by  doxygen 1.4.6