9 template <
class TScalarType>
14 m_Angle = m_TranslationY = m_TranslationZ = itk::NumericTraits<ScalarType>::Zero;
15 m_ReferencePlane.SetIdentity();
16 m_InverseReferencePlane.SetIdentity();
18 this->ComputeMatrix();
22 template <
class TScalarType>
25 unsigned int parametersDimension):
26 Superclass(spaceDimension, parametersDimension)
28 m_Angle = m_TranslationY = m_TranslationZ = itk::NumericTraits<ScalarType>::Zero;
29 m_ReferencePlane.SetIdentity();
30 m_InverseReferencePlane.SetIdentity();
32 this->ComputeMatrix();
36 template <
class TScalarType>
41 m_Angle = parameters[0];
42 m_TranslationY = parameters[1];
43 m_TranslationZ = parameters[2];
45 this->ComputeMatrix();
53 template <
class TScalarType>
58 this->m_Parameters[0] = m_Angle;
59 this->m_Parameters[1] = m_TranslationY;
60 this->m_Parameters[2] = m_TranslationZ;
62 return this->m_Parameters;
66 template <
class TScalarType>
71 Superclass::SetIdentity();
72 m_Angle = m_TranslationY = m_TranslationZ = itk::NumericTraits<ScalarType>::Zero;
74 this->ComputeMatrix();
78 template <
class TScalarType>
85 cosa = std::cos(m_Angle);
86 sina = std::sin(m_Angle);
89 insideMatrix.SetIdentity();
91 insideMatrix[1][1] = cosa;
92 insideMatrix[1][2] = -sina;
94 insideMatrix[2][1] = sina;
95 insideMatrix[2][2] = cosa;
97 insideMatrix[1][3] = m_TranslationY;
98 insideMatrix[2][3] = m_TranslationZ;
100 resultMatrix = m_InverseReferencePlane * insideMatrix * m_ReferencePlane;
105 for (
unsigned int i = 0;i < 3;++i)
107 off[i] = resultMatrix(i,3) + this->GetCenter()[i];
108 for (
unsigned int j = 0;j < 3;++j)
110 off[i] -= resultMatrix(i,j) * this->GetCenter()[j];
111 linearMatrix(i,j) = resultMatrix(i,j);
115 this->SetMatrix(linearMatrix);
116 this->SetOffset(off);
119 template<
class TScalarType>
130 for (
unsigned int i = 0;i < 3;++i)
131 for (
unsigned int j = 0;j < 3;++j)
132 m_ReferencePlane(i,j) = rotationMatrix(i,j);
134 m_InverseReferencePlane = m_ReferencePlane.GetInverse();
138 template<
class TScalarType>
143 Superclass::PrintSelf(os,indent);
145 os << indent <<
"Symmetry plane parameters: Angle=" << m_Angle
146 <<
" TranslationY=" << m_TranslationY
147 <<
" TranslationZ=" << m_TranslationZ
itk::Matrix< double, 3, 3 > GetRotationMatrixFromVectors(const VectorType &first_direction, const VectorType &second_direction, const unsigned int dimension)