| 73 | */ |
| 74 | template <class TTransformType> |
| 75 | void TransferItkTransformToVtkMatrix(const TTransformType *itkTransform, vtkMatrix4x4 *vtkmatrix) |
| 76 | { |
| 77 | int i, j; |
| 78 | for (i = 0; i < 3; ++i) |
| 79 | for (j = 0; j < 3; ++j) |
| 80 | vtkmatrix->SetElement(i, j, itkTransform->GetMatrix().GetVnlMatrix().get(i, j)); |
| 81 | for (i = 0; i < 3; ++i) |
| 82 | vtkmatrix->SetElement(i, 3, itkTransform->GetOffset()[i]); |
| 83 | for (i = 0; i < 3; ++i) |
| 84 | vtkmatrix->SetElement(3, i, 0.0); |
| 85 | vtkmatrix->SetElement(3, 3, 1); |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * \brief Convert between two ITK transform types by copying matrix and offset. |