NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Projection/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 
26 namespace itk
27 {
28 
33  template <class TScalarType = double>
34  class ITK_EXPORT EulerAffineTransformMatrixAndItsVariations : public Object
35  {
36  public:
39  typedef Object Superclass;
40  typedef SmartPointer<Self> Pointer;
41  typedef SmartPointer<const Self> ConstPointer;
42 
44  itkNewMacro(Self);
45 
48 
50  typedef typename itk::Size<3> VolumeSizeType;
51 
55 
57  typedef vnl_sparse_matrix<TScalarType> SparseMatrixType;
58  typedef vnl_matrix<TScalarType> FullMatrixType;
59  typedef vnl_vector<TScalarType> VectorType;
60 
62  itkSetObjectMacro( AffineTransform, EulerAffineTransformType );
64  itkGetObjectMacro( AffineTransform, EulerAffineTransformType );
65 
67  void SetVolumeSize(const VolumeSizeType &r) {m_VolumeSize = r; m_FlagInitialised = false;}
68 
70  void GetAffineTransformationSparseMatrix(SparseMatrixType &R, VolumeSizeType &inSize, EulerAffineTransformParametersType &parameters);
71 
73  void GetAffineTransformationSparseMatrixT(SparseMatrixType &R, SparseMatrixType &RTrans, VolumeSizeType &inSize);
74 
76  void CalculteMatrixVectorMultiplication(SparseMatrixType &R, VectorType const& inputImageVector, VectorType &outputImageVector);
77 
79  void SetFDMDifference(const double &diffVal) {m_FDMDiffValue = diffVal;}
80 
82  void CalculteMatrixVectorGradient(VolumeSizeType &inSize, VectorType const& inputImageVector, VectorType &outputGradVector, EulerAffineTransformParametersType &parameters, unsigned int paraNum);
83 
85  void CalculteMatrixVectorGradient(FullMatrixType &jacobianMatrix, VolumeSizeType &inSize, EulerAffineTransformParametersType &parameters);
86 
87 
88  protected:
91  void PrintSelf(std::ostream& os, Indent indent) const;
92 
94  VolumeSizeType m_VolumeSize;
95  unsigned long int m_input3DImageTotalSize;
96 
99 
102 
104  FullMatrixType m_affineCoreMatrix;
105  // FullMatrixType m_affineCoreMatrixInverse;
106 
110 
114 
116  // SparseMatrixType const* pSparseAffineTransformMatrix;
117 
119  // SparseMatrixType const* pSparseTransposeAffineTransformMatrix;
120 
121 
122  private:
123  EulerAffineTransformMatrixAndItsVariations(const Self&); //purposely not implemented
124  void operator=(const Self&); //purposely not implemented
125 
126  };
127 
128 } // end namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkEulerAffineTransformMatrixAndItsVariations.txx"
132 #endif
133 
134 #endif
itk::Size< 3 > VolumeSizeType
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:47
Class to apply the affine transformation matrix to a 3D image.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:34
VectorType m_outputCoordinateVector
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:109
vnl_matrix< TScalarType > FullMatrixType
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:58
EulerAffineTransformType::Pointer m_AffineTransform
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:112
EulerAffineTransformType::ParametersType EulerAffineTransformParametersType
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:54
Definition: niftkITKAffineResampleImage.cxx:74
EulerAffineTransformType::Pointer EulerAffineTransformPointerType
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:53
itk::EulerAffineTransform< double, 3, 3 > EulerAffineTransformType
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:52
void SetFDMDifference(const double &diffVal)
Set the Finite Difference Method (FDM) difference value.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:79
Superclass::ParametersType ParametersType
Definition: itkEulerAffineTransform.h:66
Euler Affine transform.
Definition: itkEulerAffineTransform.h:38
vnl_sparse_matrix< TScalarType > SparseMatrixType
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:57
EulerAffineTransformType::JacobianType m_JacobianArray
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:113
VolumeSizeType m_VolumeSize
A pointer to the 3D volume size.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:94
virtual ~EulerAffineTransformMatrixAndItsVariations(void)
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:90
Object Superclass
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:39
vnl_vector< TScalarType > VectorType
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:59
GLdouble GLdouble GLdouble r
Definition: glew.h:1390
SmartPointer< const Self > ConstPointer
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:41
void SetVolumeSize(const VolumeSizeType &r)
Set the volume size.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:67
EulerAffineTransformMatrixAndItsVariations Self
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:38
VectorType m_inputCoordinateVector
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:108
SmartPointer< Self > Pointer
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:40
bool m_FlagInitialised
Flag indicating whether the object has been initialised.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:101
Superclass::JacobianType JacobianType
Definition: itkEulerAffineTransform.h:69
SmartPointer< Self > Pointer
Definition: itkEulerAffineTransform.h:49
FullMatrixType m_affineCoreMatrix
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:104
unsigned long int m_input3DImageTotalSize
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:95
double m_FDMDiffValue
FDM difference value.
Definition: Projection/itkEulerAffineTransformMatrixAndItsVariations.h:98