Shapeworks Studio  2.1
Shape analysis software suite
itkPSMProcrustesRegistration.h
1 /*=========================================================================
2  Program: ShapeWorks: Particle-based Shape Correspondence & Visualization
3  Module: $RCSfile: itkPSMProcrustesRegistration.h,v $
4  Date: $Date: 2011/03/24 01:17:33 $
5  Version: $Revision: 1.3 $
6  Author: $Author: wmartin $
7 
8  Copyright (c) 2009 Scientific Computing and Imaging Institute.
9  See ShapeWorksLicense.txt for details.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 =========================================================================*/
15 #ifndef __itkPSMProcrustesRegistration_h
16 #define __itkPSMProcrustesRegistration_h
17 
18 #include "itkDataObject.h"
19 #include "itkWeakPointer.h"
20 #include "vnl/vnl_matrix.h"
21 #include "itkPSMParticleSystem.h"
22 #include "itkPSMProcrustesFunction.h"
23 
24 namespace itk
25 {
35 template <unsigned int VDimension>
36 class ITK_EXPORT PSMProcrustesRegistration: public DataObject
37 {
38 public:
40  // typedef TDataType DataType;
42  typedef DataObject Superclass;
43  typedef SmartPointer<Self> Pointer;
44  typedef SmartPointer<const Self> ConstPointer;
45  typedef WeakPointer<const Self> ConstWeakPointer;
46 
49  typedef typename PSMParticleSystemType::TransformType TransformType;
50 
53  typedef typename PSMProcrustesFunctionType::ShapeListType ShapeListType;
54  typedef typename PSMProcrustesFunctionType::ShapeType ShapeType;
55  typedef typename PSMProcrustesFunctionType::PointType PointType;
56  typedef typename PSMProcrustesFunctionType::SimilarityTransformListType SimilarityTransformListType;
58  itkNewMacro(Self);
59 
61  itkTypeMacro(PSMProcrustesRegistration, DataObject);
62 
64  void SetPSMParticleSystem(PSMParticleSystemType *p)
65  { m_PSMParticleSystem = p; }
66  const PSMParticleSystemType *GetPSMParticleSystem() const
67  { return m_PSMParticleSystem; }
68  PSMParticleSystemType *GetPSMParticleSystem()
69  { return m_PSMParticleSystem; }
70 
73  void IterationCallback(itk::Object *, const itk::EventObject &)
74  {
75  this->RunRegistration();
76  }
77 
81  void RunRegistration(int i);
82  void RunRegistration()
83  {
84  for (int i = 0; i < m_DomainsPerShape; i++)
85  {
86  this->RunRegistration(i);
87  }
88  }
89 
92  void SetDomainsPerShape(int i)
93  { m_DomainsPerShape = i; }
94  int GetDomainsPerShape() const
95  { return m_DomainsPerShape; }
96 
99  bool GetScaling() const
100  { return m_Scaling; }
101  void ScalingOn()
102  { m_Scaling = true; }
103  void ScalingOff()
104  { m_Scaling = false; }
105 
108  { m_Procrustes_Interval = i; }
109  int GetProcrustesInterval()
110  { return m_Procrustes_Interval; }
111 
112 
113 protected:
114  PSMProcrustesRegistration() : m_Procrustes_Interval(0),
115  m_DomainsPerShape(1), m_Scaling(true)
116  { }
117  virtual ~PSMProcrustesRegistration() {};
118 
119  void PrintSelf(std::ostream& os, Indent indent) const
120  { Superclass::PrintSelf(os,indent); }
121 
122 private:
123  PSMProcrustesRegistration(const Self&); //purposely not implemented
124  void operator=(const Self&); //purposely not implemented
125 
127  int m_Procrustes_Interval;
128 
130  int m_DomainsPerShape;
131 
133  bool m_Scaling;
134 
136  PSMParticleSystemType *m_PSMParticleSystem;
137 };
138 
139 } // end namespace
140 
141 #endif
Generalized Procrustes Analysis is the rigid registration between different input shapes represented ...
void IterationCallback(itk::Object *, const itk::EventObject &)
A facade class that manages interactions with a particle system.
PSMParticleSystem< VDimension > PSMParticleSystemType
PSMProcrustesFunction< VDimension > PSMProcrustesFunctionType
This class interfaces with the PSMProcrustesFunction class to register a list of point sets...
void SetPSMParticleSystem(PSMParticleSystemType *p)
vnl_matrix_fixed< double, VDimension+1, VDimension+1 > TransformType