Medical Imaging Interaction Toolkit  2018.4.99-6aa36ba9
Medical Imaging Interaction Toolkit
mitkAlgorithmHelper.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 
14 #ifndef mitkAlgorithmHelper_h
15 #define mitkAlgorithmHelper_h
16 
17 
18 //MatchPoint
19 #include "mapRegistrationAlgorithmBase.h"
20 #include "mapRegistrationBase.h"
21 
22 //MITK
23 #include <mitkImage.h>
24 #include <mitkPointSet.h>
25 
26 //MITK
29 
30 namespace mitk
31 {
38  {
39  public:
40 
41  MITKAlgorithmHelper(map::algorithm::RegistrationAlgorithmBase* algorithm);
42 
43  void SetData(const mitk::BaseData* moving, const mitk::BaseData* target);
44 
45  void SetAllowImageCasting(bool allowCasting);
46  bool GetAllowImageCasting() const;
47 
48  static bool HasImageAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase* algorithm);
49  static bool HasPointSetAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase* algorithm);
50 
51 
52  struct CheckError
53  {
54  enum Type
55  {
56  none = 0,
57  onlyByCasting = 1,
58  wrongDimension = 2,
59  unsupportedDataType = 3
60  };
61  };
62 
63  bool CheckData(const mitk::BaseData* moving, const mitk::BaseData* target,
64  CheckError::Type& error) const;
65 
66  map::core::RegistrationBase::Pointer GetRegistration() const;
67 
68  mitk::MAPRegistrationWrapper::Pointer GetMITKRegistrationWrapper() const;
69 
71 
72  private:
73 
74  MITKAlgorithmHelper& operator = (const MITKAlgorithmHelper&);
76 
79  template<typename TInImageType, typename TOutImageType>
80  typename TOutImageType::Pointer CastImage(const TInImageType* input) const;
81 
83  template<typename TPixelType1, unsigned int VImageDimension1,
84  typename TPixelType2, unsigned int VImageDimension2>
85  void DoSetImages(const itk::Image<TPixelType1, VImageDimension1>* moving,
86  const itk::Image<TPixelType2, VImageDimension2>* target);
87 
89  template<typename TPixelType1, unsigned int VImageDimension1,
90  typename TPixelType2, unsigned int VImageDimension2>
91  void DoCheckImages(const itk::Image<TPixelType1, VImageDimension1>* moving,
92  const itk::Image<TPixelType2, VImageDimension2>* target) const;
93 
94  map::algorithm::RegistrationAlgorithmBase::Pointer m_AlgorithmBase;
95 
96  bool m_AllowImageCasting;
97 
98  mutable CheckError::Type m_Error;
99  };
100 
103 
104 }
105 
106 #endif
107 
MITKAlgorithmHelper.
Base of all data objects.
Definition: mitkBaseData.h:37
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKMATCHPOINTREGISTRATION_EXPORT
mitk::MAPRegistrationWrapper::Pointer GenerateIdentityRegistration3D()