00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00041 #ifndef __vtkIterativeClosestPointTransform_h
00042 #define __vtkIterativeClosestPointTransform_h
00043 
00044 #include "vtkLinearTransform.h"
00045 
00046 #define VTK_ICP_MODE_RMS 0
00047 #define VTK_ICP_MODE_AV 1
00048 
00049 class vtkCellLocator;
00050 class vtkLandmarkTransform;
00051 class vtkDataSet;
00052 
00053 class VTK_HYBRID_EXPORT vtkIterativeClosestPointTransform : public vtkLinearTransform
00054 {
00055 public:
00056   static vtkIterativeClosestPointTransform *New();
00057   vtkTypeMacro(vtkIterativeClosestPointTransform,vtkLinearTransform);
00058   void PrintSelf(ostream& os, vtkIndent indent);
00059 
00061 
00062   void SetSource(vtkDataSet *source);
00063   void SetTarget(vtkDataSet *target);
00064   vtkGetObjectMacro(Source, vtkDataSet);
00065   vtkGetObjectMacro(Target, vtkDataSet);
00067 
00069 
00071   void SetLocator(vtkCellLocator *locator);
00072   vtkGetObjectMacro(Locator,vtkCellLocator);
00074 
00076 
00077   vtkSetMacro(MaximumNumberOfIterations, int);
00078   vtkGetMacro(MaximumNumberOfIterations, int);
00080 
00082 
00083   vtkGetMacro(NumberOfIterations, int);
00085 
00087 
00089   vtkSetMacro(CheckMeanDistance, int);
00090   vtkGetMacro(CheckMeanDistance, int);
00091   vtkBooleanMacro(CheckMeanDistance, int);
00093 
00095 
00100   vtkSetClampMacro(MeanDistanceMode,int,
00101                    VTK_ICP_MODE_RMS,VTK_ICP_MODE_AV);
00102   vtkGetMacro(MeanDistanceMode,int);
00103   void SetMeanDistanceModeToRMS()
00104     {this->SetMeanDistanceMode(VTK_ICP_MODE_RMS);}
00105   void SetMeanDistanceModeToAbsoluteValue()
00106     {this->SetMeanDistanceMode(VTK_ICP_MODE_AV);}
00107   const char *GetMeanDistanceModeAsString();
00109 
00111 
00114   vtkSetMacro(MaximumMeanDistance, double);
00115   vtkGetMacro(MaximumMeanDistance, double);
00117   
00119 
00120   vtkGetMacro(MeanDistance, double);
00122   
00124 
00127   vtkSetMacro(MaximumNumberOfLandmarks, int);
00128   vtkGetMacro(MaximumNumberOfLandmarks, int);
00130 
00132 
00134   vtkSetMacro(StartByMatchingCentroids, int);
00135   vtkGetMacro(StartByMatchingCentroids, int);
00136   vtkBooleanMacro(StartByMatchingCentroids, int);
00138 
00140 
00143   vtkGetObjectMacro(LandmarkTransform,vtkLandmarkTransform);
00145   
00148   void Inverse();
00149 
00151   vtkAbstractTransform *MakeTransform();
00152 
00153 protected:
00154 
00156 
00157   void ReleaseSource(void);
00158   void ReleaseTarget(void);
00160 
00162   void ReleaseLocator(void);
00163 
00165   void CreateDefaultLocator(void);
00166 
00168   unsigned long int GetMTime();
00169 
00170   vtkIterativeClosestPointTransform();
00171   ~vtkIterativeClosestPointTransform();
00172 
00173   void InternalUpdate();
00174 
00176   void InternalDeepCopy(vtkAbstractTransform *transform);
00177 
00178   vtkDataSet* Source;
00179   vtkDataSet* Target;
00180   vtkCellLocator *Locator;
00181   int MaximumNumberOfIterations;
00182   int CheckMeanDistance;
00183   int MeanDistanceMode;
00184   double MaximumMeanDistance;
00185   int MaximumNumberOfLandmarks;
00186   int StartByMatchingCentroids;
00187 
00188   int NumberOfIterations;
00189   double MeanDistance;
00190   vtkLandmarkTransform *LandmarkTransform;
00191 private:
00192   vtkIterativeClosestPointTransform(const vtkIterativeClosestPointTransform&);  
00193   void operator=(const vtkIterativeClosestPointTransform&);  
00194 };
00195 
00196 #endif