Medical Imaging Interaction Toolkit  2016.11.0
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,
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 
18 #ifndef mitkAlgorithmHelper_h
19 #define mitkAlgorithmHelper_h
20 
21 
22 //MatchPoint
23 #include "mapRegistrationAlgorithmBase.h"
24 #include "mapRegistrationBase.h"
25 
26 //MITK
27 #include <mitkImage.h>
28 #include <mitkPointSet.h>
29 
30 //MITK
33 
34 namespace mitk
35 {
42  {
43  public:
44 
45  MITKAlgorithmHelper(map::algorithm::RegistrationAlgorithmBase* algorithm = NULL);
46 
47  void SetData(const mitk::BaseData* moving, const mitk::BaseData* target);
48 
49  void SetAllowImageCasting(bool allowCasting);
50  bool GetAllowImageCasting() const;
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 
95 
96  bool m_AllowImageCasting;
97 
98  mutable CheckError::Type m_Error;
99  };
100 
103 
104 }
105 
106 #endif
107 
MITKAlgorithmHelper.
itk::SmartPointer< Self > Pointer
Base of all data objects.
Definition: mitkBaseData.h:39
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKMATCHPOINTREGISTRATION_EXPORT
mitk::MAPRegistrationWrapper::Pointer GenerateIdentityRegistration3D()