00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD 00020 #define ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD 00021 00022 namespace mitk { 00023 00024 //##Documentation 00025 //## @brief Internal hack to set m_MatrixMTime of 00026 //## itk::MatrixOffsetTransformBase correctly after changing 00027 //## the matrix. For internal use only. 00028 //## 00029 //## Usage: static_cast object of type itk::MatrixOffsetTransformBase 00030 //## (or derived from this) to this and call MatrixChanged(). 00031 //## itk::MatrixOffsetTransformBase::SetParameters does not set 00032 //## m_MatrixMTime thus m_InverseMatrixMTime is the same 00033 //## as m_MatrixMTime and the inverse is not recalculated. 00034 //## @warning Use with care! 00035 //## @ingroup Geometry 00036 template <class TTransformType> 00037 class ItkMatrixHack : public TTransformType 00038 { 00039 public: 00040 void MatrixChanged() 00041 { 00042 this->SetVarMatrix(this->GetMatrix()); 00043 } 00044 }; 00045 00046 } // namespace mitk 00047 00048 #endif /* ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD */