Medical Imaging Interaction Toolkit  2018.4.99-07c45cb1
Medical Imaging Interaction Toolkit
mitkMaskedAlgorithmHelper.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 mitkMaskedAlgorithmHelper_h
15 #define mitkMaskedAlgorithmHelper_h
16 
17 #include "itkSpatialObject.h"
18 
19 //MatchPoint
20 #include "mapRegistrationAlgorithmBase.h"
21 
22 //MITK
23 #include <mitkImage.h>
24 
25 //MITK
27 
28 namespace mitk
29 {
38  {
39  public:
40 
41  MaskedAlgorithmHelper(map::algorithm::RegistrationAlgorithmBase* algorithm);
42 
47  bool SetMasks(const mitk::Image* movingMask, const mitk::Image* targetMask);
48 
50  bool CheckSupport(const mitk::Image* movingMask, const mitk::Image* targetMask) const;
51 
52  static bool HasMaskedRegistrationAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase* algorithm);
53 
55 
56  private:
57  using MaskPixelType = unsigned char;
58 
59  MaskedAlgorithmHelper& operator = (const MaskedAlgorithmHelper&);
61 
63  template<unsigned int VImageDimension1, unsigned int VImageDimension2>
64  bool DoSetMasks(const mitk::Image* movingMask, const mitk::Image* targetMask);
65 
67  template<typename TPixelType, unsigned int VImageDimension>
68  void DoConvertMask(const itk::Image<TPixelType, VImageDimension>* mask);
70  template<unsigned int VImageDimension>
71  void DoConvertMask(const itk::Image<MaskPixelType, VImageDimension>* mask);
72 
74  template<unsigned int VImageDimension>
75  typename itk::SpatialObject<VImageDimension>::Pointer ConvertMaskSO(const itk::Image<MaskPixelType, VImageDimension>* mask) const;
76 
78  itk::DataObject::Pointer m_convertResult;
79 
80  map::algorithm::RegistrationAlgorithmBase::Pointer m_AlgorithmBase;
81  };
82 
83 }
84 
85 #endif
86 
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKMATCHPOINTREGISTRATION_EXPORT
Image class for storing images.
Definition: mitkImage.h:72
MaskedAlgorithmHelper Helper class as an easy bridge to set mitk images as masks for registration alg...
mitk::Image::Pointer mask