Medical Imaging Interaction Toolkit  2022.04.99-194dd5d8
Medical Imaging Interaction Toolkit
mitkItkMatrixHack.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD
14 #define ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD
15 
16 namespace mitk
17 {
18  //##Documentation
19  //## @brief Internal hack to set m_MatrixMTime of
20  //## itk::MatrixOffsetTransformBase correctly after changing
21  //## the matrix. For internal use only.
22  //##
23  //## Usage: static_cast object of type itk::MatrixOffsetTransformBase
24  //## (or derived from this) to this and call MatrixChanged().
25  //## itk::MatrixOffsetTransformBase::SetParameters does not set
26  //## m_MatrixMTime thus m_InverseMatrixMTime is the same
27  //## as m_MatrixMTime and the inverse is not recalculated.
28  //## @warning Use with care!
29  //## @ingroup Geometry
30  template <class TTransformType>
31  class ItkMatrixHack : public TTransformType
32  {
33  public:
34  void MatrixChanged() { this->SetVarMatrix(this->GetMatrix()); }
35  };
36 
37 } // namespace mitk
38 
39 #endif /* ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD */
Internal hack to set m_MatrixMTime of itk::MatrixOffsetTransformBase correctly after changing the mat...
DataCollection - Class to facilitate loading/accessing structured data.