| 120 | */ |
| 121 | template <class TMatrixType> |
| 122 | void GetRotation(const mitk::BaseGeometry *geometry, TMatrixType &itkmatrix) |
| 123 | { |
| 124 | const mitk::Vector3D &spacing = geometry->GetSpacing(); |
| 125 | auto &geometryVnlMatrix = geometry->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix(); |
| 126 | |
| 127 | typename TMatrixType::InternalMatrixType &outputVnlMatrix = |
| 128 | itkmatrix.GetVnlMatrix(); |
| 129 | |
| 130 | for (int i = 0; i < 3; ++i) |
| 131 | for (int j = 0; j < 3; ++j) |
| 132 | outputVnlMatrix[i][j] = geometryVnlMatrix[i][j] / spacing[j]; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * \brief Compute the world-to-ITK-physical-space transform from a geometry. |