Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkIgnorePixelMaskGenerator.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 mitkIgnorePixelMaskGenerator_h
14 #define mitkIgnorePixelMaskGenerator_h
15 
16 #include <mitkImage.h>
18 #include <mitkMaskGenerator.h>
19 #include <limits>
20 #include <itkImage.h>
21 
22 
23 namespace mitk
24 {
39 {
40 public:
47  typedef double RealType;
48 
50  itkNewMacro(Self);
52 
61  void SetIgnoredPixelValue(RealType pixelValue);
62 
67  unsigned int GetNumberOfMasks() const override;
68 
69 protected:
71  m_IgnoredPixelValue(std::numeric_limits<RealType>::min()), m_InternalMaskUpdateTime(0)
72  {
73  }
74 
76 
77  mitk::Image::ConstPointer DoGetMask(unsigned int maskID) override;
78 
79  template <typename TPixel, unsigned int VImageDimension>
80  void InternalCalculateMask(const itk::Image<TPixel, VImageDimension>* image);
81 
82 private:
83  bool IsUpdateRequired() const;
84 
85  mitk::Image::Pointer m_InternalMask;
86  RealType m_IgnoredPixelValue;
87  unsigned long m_InternalMaskUpdateTime;
88 
89 
90 };
91 
92 }
93 
94 #endif
#define MITKIMAGESTATISTICS_EXPORT
Generates a binary mask that excludes pixels with a specified intensity value.
unsigned int GetNumberOfMasks() const override
Returns the number of masks this generator provides.
mitk::Image::ConstPointer DoGetMask(unsigned int maskID) override
Must be overridden by derived classes to generate the requested mask.
itk::SmartPointer< const Self > ConstPointer
double RealType
Real-valued type used for the pixel value to ignore.
void InternalCalculateMask(const itk::Image< TPixel, VImageDimension > *image)
void SetIgnoredPixelValue(RealType pixelValue)
Set the pixel value to be excluded from the mask.
Abstract base class for all mask generators used in image statistics.
Find image slices visible on a given plane.