Shapeworks Studio  2.1
Shape analysis software suite
itkPSMRBFCorrespondenceInterpolator.h
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkPSMRBFCorrespondenceInterpolator_h
19 #define __itkPSMRBFCorrespondenceInterpolator_h
20 
21 #include <vector>
22 #include <vnl/vnl_vector.h>
23 #include <vnl/vnl_matrix.h>
24 #include <vnl/algo/vnl_svd.h>
25 
26 #include "itkFunctionBase.h"
27 #include "itkPoint.h"
28 #include "itkMacro.h"
29 
30 namespace itk
31 {
32 
39 template <unsigned int VDimension>
41  public FunctionBase<Point<double,VDimension>, Point<double,VDimension> >
42 {
43 public:
45  itkStaticConstMacro(Dimension, unsigned int, VDimension);
46 
50  typedef FunctionBase <PointType, PointType> Superclass;
51  typedef SmartPointer<Self> Pointer;
52  typedef SmartPointer<const Self> ConstPointer;
53 
55  itkNewMacro(Self);
56 
58  itkTypeMacro( PSMRBFCorrespondenceInterpolator, FunctionBase );
59 
63  void SetPointSetA(const std::vector<PointType> &v)
64  {
65  m_PointSetA = v;
66  }
67  const std::vector<PointType> & GetPointSetA() const
68  {
69  return m_PointSetA;
70  }
71 
75  void SetPointSetB(const std::vector<PointType> &v)
76  {
77  m_PointSetB = v;
78  }
79  const std::vector<PointType> & GetPointSetB() const
80  {
81  return m_PointSetB;
82  }
83 
85  void Initialize();
86 
88  itkGetMacro(Initialized, bool);
89 
92  virtual PointType Evaluate( const PointType& pt ) const;
93 
94 protected:
97  void PrintSelf(std::ostream& os, Indent indent) const
98  {
99  Superclass::PrintSelf(os,indent);
100  }
101 
102 private:
103  PSMRBFCorrespondenceInterpolator(const Self&); //purposely not implemented
104  void operator=(const Self&); //purposely not implemented
105 
106  bool m_Initialized;
107 
108  std::vector<PointType> m_PointSetA;
109  std::vector<PointType> m_PointSetB;
110 
112  vnl_matrix<double> m_P;
113  vnl_matrix<double> m_C;
114 
115 };
116 
117 } // end namespace itk
118 
119 #ifndef ITK_MANUAL_INSTANTIATION
120 #include "itkPSMRBFCorrespondenceInterpolator.hxx"
121 #endif
122 
123 #endif
void SetPointSetA(const std::vector< PointType > &v)
void SetPointSetB(const std::vector< PointType > &v)