17 #ifndef __itkSparseKernelTransform_h 18 #define __itkSparseKernelTransform_h 20 #include <itkTransform.h> 22 #include <itkVector.h> 23 #include <itkMatrix.h> 24 #include <itkPointSet.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> 35 #include "Eigen/Dense" 36 #include "Eigen/Sparse" 74 template <
class TScalarType,
75 unsigned int NDimensions>
77 public Transform<TScalarType, NDimensions,NDimensions>
82 typedef Transform<TScalarType, NDimensions, NDimensions > Superclass;
83 typedef SmartPointer<Self> Pointer;
84 typedef SmartPointer<const Self> ConstPointer;
93 itkStaticConstMacro(SpaceDimension,
unsigned int, NDimensions);
106 typedef typename Superclass::OutputPointType OutputPointType;
110 typedef typename Superclass::OutputVectorType OutputVectorType;
114 typedef DefaultStaticMeshTraits<TScalarType,
119 typedef PointSet<InputPointType, NDimensions, PointSetTraitsType> PointSetType;
120 typedef typename PointSetType::Pointer PointSetPointer;
121 typedef typename PointSetType::PointsContainer PointsContainer;
122 typedef typename PointSetType::PointsContainerIterator PointsIterator;
123 typedef typename PointSetType::PointsContainerConstIterator PointsConstIterator;
127 typedef typename VectorSetType::Pointer VectorSetPointer;
130 itkGetObjectMacro( SourceLandmarks, PointSetType);
133 virtual void SetSourceLandmarks(PointSetType *);
136 itkGetObjectMacro( TargetLandmarks, PointSetType);
139 virtual void SetTargetLandmarks(PointSetType *);
143 itkGetObjectMacro( Displacements, VectorSetType );
146 void ComputeWMatrix(
void)
const;
152 virtual OutputPointType TransformPoint(
const InputPointType& thisPoint)
const;
163 virtual void SetIdentity();
169 virtual void SetParameters(
const ParametersType &);
176 virtual void SetFixedParameters(
const ParametersType &);
179 virtual void UpdateParameters(
void)
const;
182 virtual const ParametersType& GetParameters(
void)
const;
185 virtual const ParametersType& GetFixedParameters(
void)
const;
186 virtual void ComputeJacobianWithRespectToParameters(
187 const InputPointType &in, JacobianType &jacobian)
const;
200 {m_Stiffness=(stiffness>0)?stiffness:0.0;
201 m_LMatrixComputed=
false;
202 m_LInverseComputed=
false;
203 m_WMatrixComputed=
false;
207 itkGetMacro(Stiffness,
double);
213 void PrintSelf(std::ostream& os, Indent indent)
const;
277 virtual const GMatrixType & ComputeG(
const InputVectorType & landmarkVector)
const;
285 virtual const GMatrixType & ComputeReflexiveG(PointsIterator)
const;
290 virtual void ComputeDeformationContribution(
const InputPointType & inputPoint,
291 OutputPointType & result )
const;
294 void ComputeK()
const;
297 void ComputeL()
const;
301 void ComputeP()
const;
304 void ComputeY()
const;
307 void ComputeD()
const;
313 void ReorganizeW(
void)
const;
370 void operator=(
const Self&);
376 #ifndef ITK_MANUAL_INSTANTIATION 377 #include "itkSparseKernelTransform.hxx" 380 #endif // __itkSparseKernelTransform_h
A small structure to hold a non zero as a triplet (i,j,value).