Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitkMaskUtilities.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 #ifndef mitkMaskUtilities_h
14 #define mitkMaskUtilities_h
15 
17 #include <mitkImage.h>
19 #include <itkImage.h>
20 
21 namespace mitk
22 {
27 template <class TPixel, unsigned int VImageDimension>
28 class MaskUtilities: public itk::Object
29  {
30  public:
33  typedef itk::Object Superclass;
36 
38  itkNewMacro(Self);
39  itkTypeMacro(MaskUtilities, itk::Object);
40 
41  typedef itk::Image<TPixel, VImageDimension> ImageType;
42  typedef itk::Image<unsigned short, VImageDimension> MaskType;
43 
47  void SetImage(const ImageType* image);
48 
52  void SetMask(const MaskType* mask);
53 
58  bool CheckMaskSanity();
59 
63  typename ImageType::ConstPointer ExtractMaskImageRegion();
64 
65  protected:
66  MaskUtilities(): m_Image(nullptr), m_Mask(nullptr){}
67 
68  ~MaskUtilities() override{}
69 
70  private:
71  const ImageType* m_Image;
72  const MaskType* m_Mask;
73  };
74 
81 
82 }
83 
84 #ifndef ITK_MANUAL_INSTANTIATION
85 #include <mitkMaskUtilities.tpp>
86 #endif
87 
88 #endif
mitk::MASK_SUITABILITY_TOLERANCE_COORDINATE
constexpr double MASK_SUITABILITY_TOLERANCE_COORDINATE
Definition: mitkMaskUtilities.h:77
mitk::MaskUtilities::MaskUtilities
MaskUtilities()
Definition: mitkMaskUtilities.h:66
mitk::MaskUtilities::SetMask
void SetMask(const MaskType *mask)
Set mask.
mitkImage.h
mitk::MaskUtilities::MaskType
itk::Image< unsigned short, VImageDimension > MaskType
Definition: mitkMaskUtilities.h:42
mitk::MaskUtilities::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: mitkMaskUtilities.h:35
mitk::MaskUtilities::ImageType
itk::Image< TPixel, VImageDimension > ImageType
Definition: mitkMaskUtilities.h:39
mitk::MaskUtilities::SetImage
void SetImage(const ImageType *image)
Set image.
mitk::MaskUtilities::~MaskUtilities
~MaskUtilities() override
Definition: mitkMaskUtilities.h:68
itk::SmartPointer< Self >
mitk::NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION
constexpr double NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION
Definition: mitkNodePredicateGeometry.h:103
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::MaskUtilities::ExtractMaskImageRegion
ImageType::ConstPointer ExtractMaskImageRegion()
Crops the image to the LargestPossibleRegion of the mask.
mitk::MaskUtilities
Utility class for mask operations. It checks whether an image and a mask are compatible (spacing,...
Definition: mitkMaskUtilities.h:28
mitkNodePredicateGeometry.h
mitk::NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION
constexpr double NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION
Definition: mitkNodePredicateGeometry.h:97
mitk::MaskUtilities::Superclass
itk::Object Superclass
Definition: mitkMaskUtilities.h:33
mitk::MaskUtilities::CheckMaskSanity
bool CheckMaskSanity()
Checks whether mask and image are compatible for joint access (as via iterators). Spacing and directi...
mitk::MASK_SUITABILITY_TOLERANCE_DIRECTION
constexpr double MASK_SUITABILITY_TOLERANCE_DIRECTION
Definition: mitkMaskUtilities.h:80
MitkImageStatisticsExports.h
mitk::MaskUtilities::Self
MaskUtilities Self
Definition: mitkMaskUtilities.h:32
mitk::MaskUtilities::Pointer
itk::SmartPointer< Self > Pointer
Definition: mitkMaskUtilities.h:34