ANIMA  4.0
animaLinearTransformEstimationTools.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <itkAffineTransform.h>
4 #include <itkPoint.h>
5 #include <itkVector.h>
6 #include <itkImage.h>
7 
8 namespace anima
9 {
10 
11 // Transformation estimation utilities, many of these tools are implementations of X. Pennec PhD thesis (chap. 8)
12 
13 template <class TInput, class TScalarType, unsigned int NDimensions>
14 void computeLogEuclideanAverage(std::vector < vnl_matrix <TInput> > &inputTransforms, std::vector <TInput> &weights,
15  typename itk::AffineTransform<TScalarType,NDimensions>::Pointer &resultTransform);
16 
17 template <class TInput, class TScalarType, unsigned int NDimensions>
18 void computeTranslationLSWFromTranslations(std::vector < itk::Point<TInput,NDimensions> > &inputOrigins,
19  std::vector < itk::Point<TInput,NDimensions> > &inputTransformed,
20  std::vector <TInput> &weights,
21  typename itk::AffineTransform<TScalarType,NDimensions>::Pointer &resultTransform);
22 
23 template <class TInput, class TScalarType, unsigned int NDimensions>
24 void computeRigidLSWFromTranslations(std::vector < itk::Point<TInput,NDimensions> > &inputOrigins,
25  std::vector < itk::Point<TInput,NDimensions> > &inputTransformed,
26  std::vector <TInput> &weights,
27  typename itk::AffineTransform<TScalarType,NDimensions>::Pointer &resultTransform);
28 
29 template <class TInput, class TScalarType, unsigned int NDimensions>
30 itk::Point <TInput, NDimensions> computeAnisotropSimLSWFromTranslations(std::vector < itk::Point<TInput, NDimensions> > &inputOrigins,
31  std::vector < itk::Point<TInput, NDimensions> > &inputTransformed,
32  std::vector <TInput> &weights,
33  typename itk::AffineTransform<TScalarType, NDimensions>::Pointer &resultTransform,
34  vnl_matrix <double> &UMatrix);
35 
36 template <class TInput, class TScalarType, unsigned int NDimensions>
37 itk::Point <TInput, NDimensions> computeAffineLSWFromTranslations(std::vector < itk::Point<TInput,NDimensions> > &inputOrigins,
38  std::vector < itk::Point<TInput,NDimensions> > &inputTransformed,
39  std::vector <TInput> &weights,
40  typename itk::AffineTransform<TScalarType,NDimensions>::Pointer &resultTransform);
41 
42 // Quaternion utilities
43 template <class TInput, class TOutput> vnl_matrix <TOutput> computeRotationFromQuaternion(vnl_vector <TInput> eigenVector);
44 
45 template <class TInput, class TOutput, unsigned int NDimensions>
46 void pairingToQuaternion(const vnl_vector_fixed <TInput,NDimensions> &inputPoint, const vnl_vector_fixed <TInput,NDimensions> &inputTransformedPoint,
47  vnl_matrix <TOutput> &outputMatrix);
48 
49 template <class TInput, class TOutput, unsigned int NDimensions>
50 void pairingToQuaternion(const itk::Vector <TInput,NDimensions> &inputPoint, const itk::Vector <TInput,NDimensions> &inputTransformedPoint,
51  vnl_matrix <TOutput> &outputMatrix);
52 
53 template <class PointType, class TOutput>
54 void pairingToQuaternion(const PointType &inputPoint, const PointType &inputTransformedPoint, vnl_matrix <TOutput> &outputMatrix, unsigned int ndim);
55 
56 template <class TInput, class TOutput, unsigned int NDimensions>
57 void pairingToQuaternionScalingsDerivative(const vnl_vector_fixed <TInput, NDimensions> &inputPoint, const vnl_vector_fixed <TInput, NDimensions> &inputTransformedPoint,
58  vnl_matrix <TOutput> &outputMatrix, const int &dimScal);
59 
60 template <class TInput, class TOutput, unsigned int NDimensions>
61 void pairingToQuaternionScalingsDerivative(const itk::Vector <TInput, NDimensions> &inputPoint, const itk::Vector <TInput, NDimensions> &inputTransformedPoint,
62  vnl_matrix <TOutput> &outputMatrix, const int &dimScal);
63 
64 template <class PointType, class TOutput>
65 void pairingToQuaternionScalingsDerivative(const PointType &inputPoint, const PointType &inputTransformedPoint, vnl_matrix <TOutput> &outputMatrix, unsigned int ndim, const int &dimScal);
66 
67 }// end of namespace anima
68 
void pairingToQuaternionScalingsDerivative(const vnl_vector_fixed< TInput, NDimensions > &inputPoint, const vnl_vector_fixed< TInput, NDimensions > &inputTransformedPoint, vnl_matrix< TOutput > &outputMatrix, const int &dimScal)
itk::Point< TInput, NDimensions > computeAffineLSWFromTranslations(std::vector< itk::Point< TInput, NDimensions > > &inputOrigins, std::vector< itk::Point< TInput, NDimensions > > &inputTransformed, std::vector< TInput > &weights, typename itk::AffineTransform< TScalarType, NDimensions >::Pointer &resultTransform)
void computeLogEuclideanAverage(std::vector< vnl_matrix< TInput > > &inputTransforms, std::vector< TInput > &weights, typename itk::AffineTransform< TScalarType, NDimensions >::Pointer &resultTransform)
void computeTranslationLSWFromTranslations(std::vector< itk::Point< TInput, NDimensions > > &inputOrigins, std::vector< itk::Point< TInput, NDimensions > > &inputTransformed, std::vector< TInput > &weights, typename itk::AffineTransform< TScalarType, NDimensions >::Pointer &resultTransform)
void pairingToQuaternion(const vnl_vector_fixed< TInput, NDimensions > &inputPoint, const vnl_vector_fixed< TInput, NDimensions > &inputTransformedPoint, vnl_matrix< TOutput > &outputMatrix)
void computeRigidLSWFromTranslations(std::vector< itk::Point< TInput, NDimensions > > &inputOrigins, std::vector< itk::Point< TInput, NDimensions > > &inputTransformed, std::vector< TInput > &weights, typename itk::AffineTransform< TScalarType, NDimensions >::Pointer &resultTransform)
vnl_matrix< TOutput > computeRotationFromQuaternion(vnl_vector< TInput > eigenVector)
itk::Point< TInput, NDimensions > computeAnisotropSimLSWFromTranslations(std::vector< itk::Point< TInput, NDimensions > > &inputOrigins, std::vector< itk::Point< TInput, NDimensions > > &inputTransformed, std::vector< TInput > &weights, typename itk::AffineTransform< TScalarType, NDimensions >::Pointer &resultTransform, vnl_matrix< double > &UMatrix)