Medical Imaging Interaction Toolkit  2026.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 {
42  {
43  public:
44 
49  MaskedAlgorithmHelper(map::algorithm::RegistrationAlgorithmBase* algorithm);
50 
61  bool SetMasks(const mitk::Image* movingMask, const mitk::Image* targetMask);
62 
70  bool CheckSupport(const mitk::Image* movingMask, const mitk::Image* targetMask) const;
71 
77  static bool HasMaskedRegistrationAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase* algorithm);
78 
80 
81  private:
82  using MaskPixelType = unsigned char;
83 
84  MaskedAlgorithmHelper& operator = (const MaskedAlgorithmHelper&);
86 
88  template<unsigned int VImageDimension1, unsigned int VImageDimension2>
89  bool DoSetMasks(const mitk::Image* movingMask, const mitk::Image* targetMask);
90 
92  template<typename TPixelType, unsigned int VImageDimension>
93  void DoConvertMask(const itk::Image<TPixelType, VImageDimension>* mask);
95  template<unsigned int VImageDimension>
96  void DoConvertMask(const itk::Image<MaskPixelType, VImageDimension>* mask);
97 
99  template<unsigned int VImageDimension>
100  typename itk::SpatialObject<VImageDimension>::Pointer ConvertMaskSO(const itk::Image<MaskPixelType, VImageDimension>* mask) const;
101 
103  itk::DataObject::Pointer m_convertResult;
104 
105  map::algorithm::RegistrationAlgorithmBase::Pointer m_AlgorithmBase;
106  };
107 
108 }
109 
110 #endif
#define MITKMATCHPOINTREGISTRATION_EXPORT
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Helper class for setting MITK images as masks on MatchPoint registration algorithms.
static bool HasMaskedRegistrationAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase *algorithm)
Checks whether the given algorithm implements the MaskedRegistrationAlgorithm interface.
bool CheckSupport(const mitk::Image *movingMask, const mitk::Image *targetMask) const
Checks whether the algorithm supports masks of the given types.
bool SetMasks(const mitk::Image *movingMask, const mitk::Image *targetMask)
Sets one or both masks on the algorithm.
MaskedAlgorithmHelper(map::algorithm::RegistrationAlgorithmBase *algorithm)
Constructs a helper for the given registration algorithm.
Find image slices visible on a given plane.