Orfeo Toolbox  3.16
itkKernelTransform.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkKernelTransform.h,v $
5  Language: C++
6  Date: $Date: 2009-05-17 14:27:01 $
7  Version: $Revision: 1.49 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkKernelTransform_h
18 #define __itkKernelTransform_h
19 
20 #include "itkTransform.h"
21 #include "itkPoint.h"
22 #include "itkVector.h"
23 #include "itkMatrix.h"
24 #include "itkPointSet.h"
25 #include <deque>
26 #include <math.h>
27 #include "vnl/vnl_matrix_fixed.h"
28 #include "vnl/vnl_matrix.h"
29 #include "vnl/vnl_vector.h"
30 #include "vnl/vnl_vector_fixed.h"
31 #include "vnl/algo/vnl_svd.h"
32 #include "vnl/vnl_sample.h"
33 
34 namespace itk
35 {
36 
62 template <class TScalarType, // probably only float and double make sense here
63  unsigned int NDimensions> // Number of dimensions
65  public Transform<TScalarType, NDimensions,NDimensions>
66 {
67 public:
73 
75  itkTypeMacro( KernelTransform, Transform );
76 
78  itkNewMacro( Self );
79 
81  itkStaticConstMacro(SpaceDimension, unsigned int, NDimensions);
82 
85 
88 
91 
95 
99 
102  typedef DefaultStaticMeshTraits<TScalarType, NDimensions,
103  NDimensions, TScalarType,
104  TScalarType> PointSetTraitsType;
109  typedef typename PointSetType::PointsContainerIterator
113 
117 
119  itkGetObjectMacro( SourceLandmarks, PointSetType);
120 
122  virtual void SetSourceLandmarks(PointSetType *);
123 
125  itkGetObjectMacro( TargetLandmarks, PointSetType);
126 
128  virtual void SetTargetLandmarks(PointSetType *);
129 
132  itkGetObjectMacro( Displacements, VectorSetType );
133 
135  void ComputeWMatrix(void);
136 
138  virtual OutputPointType TransformPoint(const InputPointType& thisPoint) const;
139 
141  typedef vnl_matrix_fixed<TScalarType, NDimensions, NDimensions> IMatrixType;
142 
143 
145  virtual const JacobianType & GetJacobian(const InputPointType &point) const;
146 
151  virtual void SetParameters(const ParametersType &);
152 
158  virtual void SetFixedParameters(const ParametersType &);
159 
161  virtual void UpdateParameters(void) const;
162 
164  virtual const ParametersType& GetParameters(void) const;
165 
167  virtual const ParametersType& GetFixedParameters(void) const;
168 
172  virtual bool IsLinear() const { return false; }
173 
184  itkSetClampMacro(Stiffness, double, 0.0, NumericTraits<double>::max());
185  itkGetConstMacro(Stiffness, double);
186 
187 
188 protected:
189  KernelTransform();
190  virtual ~KernelTransform();
191  void PrintSelf(std::ostream& os, Indent indent) const;
192 
193 public:
195  typedef vnl_matrix_fixed<TScalarType, NDimensions, NDimensions> GMatrixType;
196 
199 
202 
205 
208 
211 
214 
216  typedef vnl_matrix_fixed<TScalarType,NDimensions,NDimensions> AMatrixType;
217 
219  typedef vnl_vector_fixed<TScalarType,NDimensions> BMatrixType;
220 
222  typedef vnl_matrix_fixed<TScalarType, 1, NDimensions> RowMatrixType;
223 
225  typedef vnl_matrix_fixed<TScalarType, NDimensions, 1> ColumnMatrixType;
226 
227 
228 protected:
235  virtual void ComputeG(const InputVectorType& landmarkVector,
236  GMatrixType & gmatrix ) const;
240  itkLegacyMacro( virtual const GMatrixType & ComputeG(
241  const InputVectorType & landmarkVector
242  ) const );
243 
244 
254  virtual const GMatrixType & ComputeReflexiveG(PointsIterator) const;
255 
256 
259  virtual void ComputeDeformationContribution(
260  const InputPointType & inputPoint,
261  OutputPointType & result ) const;
262 
264  void ComputeK();
265 
267  void ComputeL();
268 
270  void ComputeP();
271 
273  void ComputeY();
274 
276  void ComputeD();
277 
282  void ReorganizeW(void);
283 
285  double m_Stiffness;
286 
290 
293 
296 
299 
302 
305 
312 
315 
318 
323 
326 
329 
332 
335 
336 private:
337  KernelTransform(const Self&); //purposely not implemented
338  void operator=(const Self&); //purposely not implemented
339 
340 };
341 
342 } // end namespace itk
343 
344 // Define instantiation macro for this template.
345 #define ITK_TEMPLATE_KernelTransform(_, EXPORT, x, y) namespace itk { \
346  _(2(class EXPORT KernelTransform< ITK_TEMPLATE_2 x >)) \
347  namespace Templates { typedef KernelTransform< ITK_TEMPLATE_2 x > \
348  KernelTransform##y; } \
349  }
350 
351 #if ITK_TEMPLATE_EXPLICIT
352 # include "Templates/itkKernelTransform+-.h"
353 #endif
354 
355 #if ITK_TEMPLATE_TXX
356 # include "itkKernelTransform.txx"
357 #endif
358 
359 #endif // __itkKernelTransform_h

Generated at Sat Feb 2 2013 23:47:17 for Orfeo Toolbox with doxygen 1.8.1.1