Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD
18 #define ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD
19 
20 namespace mitk
21 {
22  //##Documentation
23  //## @brief Internal hack to set m_MatrixMTime of
24  //## itk::MatrixOffsetTransformBase correctly after changing
25  //## the matrix. For internal use only.
26  //##
27  //## Usage: static_cast object of type itk::MatrixOffsetTransformBase
28  //## (or derived from this) to this and call MatrixChanged().
29  //## itk::MatrixOffsetTransformBase::SetParameters does not set
30  //## m_MatrixMTime thus m_InverseMatrixMTime is the same
31  //## as m_MatrixMTime and the inverse is not recalculated.
32  //## @warning Use with care!
33  //## @ingroup Geometry
34  template <class TTransformType>
35  class ItkMatrixHack : public TTransformType
36  {
37  public:
38  void MatrixChanged() { this->SetVarMatrix(this->GetMatrix()); }
39  };
40 
41 } // namespace mitk
42 
43 #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.