ANIMA  4.0
animaSymmetryPlaneTransform.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <iostream>
4 #include <itkMatrixOffsetTransformBase.h>
5 
6 namespace anima
7 {
8 
9 template < class TScalarType=double > // Data type for scalars (double or double)
11 public itk::MatrixOffsetTransformBase< TScalarType, 3 >
12 {
13 public:
16  typedef itk::MatrixOffsetTransformBase <TScalarType, 3> Superclass;
17  typedef itk::SmartPointer<Self> Pointer;
18  typedef itk::SmartPointer<const Self> ConstPointer;
19 
21  itkNewMacro(Self)
22 
23 
24  itkTypeMacro(SymmetryPlaneTransform, MatrixOffsetTransformBase)
25 
26 
27  itkStaticConstMacro(SpaceDimension, unsigned int, 3);
28  itkStaticConstMacro(InputSpaceDimension, unsigned int, 3);
29  itkStaticConstMacro(OutputSpaceDimension, unsigned int, 3);
30  itkStaticConstMacro(ParametersDimension, unsigned int, 3);
31 
32  //Check which typedefs are useful
33  typedef typename Superclass::ParametersType ParametersType;
34  typedef typename Superclass::ParametersValueType ParametersValueType;
35  typedef typename Superclass::JacobianType JacobianType;
36  typedef typename Superclass::ScalarType ScalarType;
37  typedef typename Superclass::InputVectorType InputVectorType;
38  typedef typename Superclass::OutputVectorType OutputVectorType;
39  typedef typename Superclass::InputCovariantVectorType InputCovariantVectorType;
41  typedef typename Superclass::InputVnlVectorType InputVnlVectorType;
42  typedef typename Superclass::OutputVnlVectorType OutputVnlVectorType;
43  typedef typename Superclass::InputPointType InputPointType;
44  typedef typename Superclass::OutputPointType OutputPointType;
45  typedef typename Superclass::MatrixType MatrixType;
46  typedef itk::Matrix <ScalarType,4,4> HomogeneousMatrixType;
47  typedef typename Superclass::InverseMatrixType InverseMatrixType;
48  typedef typename Superclass::CenterType CenterType;
49  typedef typename Superclass::TranslationType TranslationType;
50  typedef typename Superclass::OffsetType OffsetType;
51  typedef typename Superclass::ScalarType AngleType;
52 
53  void SetParameters(const ParametersType & parameters) ITK_OVERRIDE;
54  const ParametersType& GetParameters() const ITK_OVERRIDE;
55 
56  //const JacobianType & GetJacobian(const InputPointType &point ) const;
57 
58  virtual void SetIdentity() ITK_OVERRIDE;
59 
60  // St a rotation center for the symmetry plane (easier for optimization)
61  void SetRotationCenter(OutputPointType &rotCenter);
62 
63 protected:
65  SymmetryPlaneTransform(const MatrixType & matrix,
66  const OutputPointType & offset);
67  SymmetryPlaneTransform(unsigned int outputSpaceDims,
68  unsigned int paramsSpaceDims);
69 
70  virtual ~SymmetryPlaneTransform(){}
71 
72  void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE;
73 
74  void ComputeMatrix() ITK_OVERRIDE;
75 
76 private:
77  SymmetryPlaneTransform(const Self&); //purposely not implemented
78  void operator=(const Self&); //purposely not implemented
79 
80  // A symmetry plane is characterized by its spherical coordinates: theta, phi, r
81  ScalarType m_Theta;
82  ScalarType m_Phi;
83  ScalarType m_Distance;
84 
85  HomogeneousMatrixType m_CenterTransform, m_CenterTransformInv;
86 }; //class SymmetryPlaneTransform
87 
88 } // end of namespace anima
89 
Superclass::InverseMatrixType InverseMatrixType
itk::SmartPointer< const Self > ConstPointer
void SetRotationCenter(OutputPointType &rotCenter)
itk::MatrixOffsetTransformBase< TScalarType, 3 > Superclass
Superclass::OutputVectorType OutputVectorType
void PrintSelf(std::ostream &os, itk::Indent indent) const ITK_OVERRIDE
Superclass::InputCovariantVectorType InputCovariantVectorType
Superclass::InputPointType InputPointType
void SetParameters(const ParametersType &parameters) ITK_OVERRIDE
Superclass::OutputVnlVectorType OutputVnlVectorType
itk::Matrix< ScalarType, 4, 4 > HomogeneousMatrixType
Superclass::TranslationType TranslationType
static const unsigned int ParametersDimension
static const unsigned int SpaceDimension
Superclass::InputVectorType InputVectorType
Superclass::ParametersValueType ParametersValueType
const ParametersType & GetParameters() const ITK_OVERRIDE
Superclass::ParametersType ParametersType
static const unsigned int InputSpaceDimension
static const unsigned int OutputSpaceDimension
Superclass::OutputCovariantVectorType OutputCovariantVectorType
Superclass::OutputPointType OutputPointType
Superclass::InputVnlVectorType InputVnlVectorType