NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Transforms/itkEulerAffineTransformMatrixAndItsVariations.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkEulerAffineTransformMatrixAndItsVariations_h
16 #define itkEulerAffineTransformMatrixAndItsVariations_h
17 
19 #include <itkImage.h>
20 
21 #include <vnl/vnl_math.h>
22 #include <vnl/vnl_vector.h>
23 #include <vnl/vnl_sparse_matrix.h>
24 
25 namespace itk
26 {
27 
32  template <class TScalarType = double>
33  class ITK_EXPORT EulerAffineTransformMatrixAndItsVariations : public Object
34  {
35  public:
38  typedef Object Superclass;
39  typedef SmartPointer<Self> Pointer;
40  typedef SmartPointer<const Self> ConstPointer;
41 
43  itkNewMacro(Self);
44 
47 
49  typedef typename itk::Size<3> VolumeSizeType;
50 
54 
56  typedef vnl_sparse_matrix<TScalarType> SparseMatrixType;
57  typedef vnl_matrix<TScalarType> FullMatrixType;
58  typedef vnl_vector<TScalarType> VectorType;
59 
61  itkSetObjectMacro( AffineTransform, EulerAffineTransformType );
63  itkGetObjectMacro( AffineTransform, EulerAffineTransformType );
64 
66  void SetVolumeSize(const VolumeSizeType &r) {m_VolumeSize = r; m_FlagInitialised = false;}
67 
69  void GetAffineTransformationSparseMatrix(SparseMatrixType &R, VolumeSizeType &inSize, EulerAffineTransformParametersType &parameters);
70 
72  void GetAffineTransformationSparseMatrixT(SparseMatrixType &R, SparseMatrixType &RTrans, VolumeSizeType &inSize);
73 
75  void CalculteMatrixVectorMultiplication(SparseMatrixType &R, VectorType const& inputImageVector, VectorType &outputImageVector);
76 
78  void CalculteMatrixVectorGradient(VolumeSizeType &inSize, VectorType const& inputImageVector, VectorType &outputGradVector, EulerAffineTransformParametersType &parameters, unsigned int paraNum);
79 
81  void CalculteMatrixVectorGradient(FullMatrixType &jacobianMatrix, VolumeSizeType &inSize, EulerAffineTransformParametersType &parameters);
82 
83 
84  protected:
87  void PrintSelf(std::ostream& os, Indent indent) const;
88 
90  VolumeSizeType m_VolumeSize;
91  unsigned long int m_input3DImageTotalSize;
92 
94  bool m_FlagInitialised;
95 
97  FullMatrixType m_affineCoreMatrix;
98  FullMatrixType m_affineCoreMatrixInverse;
99 
101  VectorType m_inputCoordinateVector;
102  VectorType m_outputCoordinateVector;
103 
105  EulerAffineTransformType::Pointer m_AffineTransform;
107 
109  // SparseMatrixType const* pSparseAffineTransformMatrix;
110 
112  // SparseMatrixType const* pSparseTransposeAffineTransformMatrix;
113 
114 
115  private:
116  EulerAffineTransformMatrixAndItsVariations(const Self&); //purposely not implemented
117  void operator=(const Self&); //purposely not implemented
118 
119  };
120 
121 } // end namespace itk
122 
123 #ifndef ITK_MANUAL_INSTANTIATION
124 #include "itkEulerAffineTransformMatrixAndItsVariations.txx"
125 #endif
126 
127 #endif
itk::Size< 3 > VolumeSizeType
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:46
Class to apply the affine transformation matrix to a 3D image.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:34
vnl_matrix< TScalarType > FullMatrixType
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:57
EulerAffineTransformType::ParametersType EulerAffineTransformParametersType
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:53
Definition: niftkITKAffineResampleImage.cxx:74
EulerAffineTransformType::Pointer EulerAffineTransformPointerType
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:52
itk::EulerAffineTransform< double, 3, 3 > EulerAffineTransformType
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:51
Superclass::ParametersType ParametersType
Definition: itkEulerAffineTransform.h:66
Euler Affine transform.
Definition: itkEulerAffineTransform.h:38
FullMatrixType m_affineCoreMatrixInverse
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:98
vnl_sparse_matrix< TScalarType > SparseMatrixType
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:56
virtual ~EulerAffineTransformMatrixAndItsVariations(void)
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:86
Object Superclass
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:38
vnl_vector< TScalarType > VectorType
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:58
GLdouble GLdouble GLdouble r
Definition: glew.h:1390
SmartPointer< const Self > ConstPointer
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:40
void SetVolumeSize(const VolumeSizeType &r)
Set the volume size.
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:66
EulerAffineTransformMatrixAndItsVariations Self
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:37
SmartPointer< Self > Pointer
Definition: Transforms/itkEulerAffineTransformMatrixAndItsVariations.h:39
Superclass::JacobianType JacobianType
Definition: itkEulerAffineTransform.h:69
SmartPointer< Self > Pointer
Definition: itkEulerAffineTransform.h:49