Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitkMAPAlgorithmHelper.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 mitkMAPAlgorithmHelper_h
15 #define mitkMAPAlgorithmHelper_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  MAPAlgorithmHelper(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  MAPAlgorithmHelper& operator = (const MAPAlgorithmHelper&);
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
mitkImage.h
itk::SmartPointer< Self >
MitkMatchPointRegistrationExports.h
mitk::MAPAlgorithmHelper
MAPAlgorithmHelper.
Definition: mitkMAPAlgorithmHelper.h:37
mitkPointSet.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::GenerateIdentityRegistration3D
mitk::MAPRegistrationWrapper::Pointer MITKMATCHPOINTREGISTRATION_EXPORT GenerateIdentityRegistration3D()
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitk::MAPAlgorithmHelper::CheckError
Definition: mitkMAPAlgorithmHelper.h:52
mitk::MAPAlgorithmHelper::CheckError::Type
Type
Definition: mitkMAPAlgorithmHelper.h:54
MITKMATCHPOINTREGISTRATION_EXPORT
#define MITKMATCHPOINTREGISTRATION_EXPORT
Definition: MitkMatchPointRegistrationExports.h:15
mitk::MAPAlgorithmHelper::~MAPAlgorithmHelper
~MAPAlgorithmHelper()
Definition: mitkMAPAlgorithmHelper.h:70
mitkMAPRegistrationWrapper.h