Medical Imaging Interaction Toolkit  2024.06.00
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
mitkImage.h
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::MaskedAlgorithmHelper::~MaskedAlgorithmHelper
~MaskedAlgorithmHelper()
Definition: mitkMaskedAlgorithmHelper.h:54
MitkMatchPointRegistrationExports.h
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::MaskedAlgorithmHelper
MaskedAlgorithmHelper Helper class as an easy bridge to set mitk images as masks for registration alg...
Definition: mitkMaskedAlgorithmHelper.h:37
MITKMATCHPOINTREGISTRATION_EXPORT
#define MITKMATCHPOINTREGISTRATION_EXPORT
Definition: MitkMatchPointRegistrationExports.h:15