Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::IgnorePixelMaskGenerator Class Reference

Generates a binary mask that excludes pixels with a specified intensity value. More...

#include <mitkIgnorePixelMaskGenerator.h>

Inheritance diagram for mitk::IgnorePixelMaskGenerator:
Collaboration diagram for mitk::IgnorePixelMaskGenerator:

Public Types

typedef IgnorePixelMaskGenerator Self
 
typedef MaskGenerator Superclass
 
typedef itk::SmartPointer< Self > Pointer
 
typedef itk::SmartPointer< const Self > ConstPointer
 
typedef double RealType
 Real-valued type used for the pixel value to ignore. More...
 

Public Member Functions

virtual const char * GetClassName () const
 
void SetIgnoredPixelValue (RealType pixelValue)
 Set the pixel value to be excluded from the mask. More...
 
unsigned int GetNumberOfMasks () const override
 Returns the number of masks this generator provides. More...
 
- Public Member Functions inherited from mitk::MaskGenerator
 mitkClassMacroItkParent (MaskGenerator, itk::Object)
 
mitk::Image::ConstPointer GetMask (unsigned int maskID)
 Get the generated mask image. More...
 
virtual mitk::Image::ConstPointer GetReferenceImage ()
 Get the reference image associated with this mask generator. More...
 
virtual void SetInputImage (const mitk::Image *_arg)
 Set the input image for the mask generator. More...
 
virtual void SetTimePoint (TimePointType _arg)
 Set the time point for which to generate the mask. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 IgnorePixelMaskGenerator ()
 
 ~IgnorePixelMaskGenerator ()=default
 
mitk::Image::ConstPointer DoGetMask (unsigned int maskID) override
 Must be overridden by derived classes to generate the requested mask. More...
 
template<typename TPixel , unsigned int VImageDimension>
void InternalCalculateMask (const itk::Image< TPixel, VImageDimension > *image)
 
- Protected Member Functions inherited from mitk::MaskGenerator
 MaskGenerator ()
 

Additional Inherited Members

- Protected Attributes inherited from mitk::MaskGenerator
TimePointType m_TimePoint
 
mitk::Image::ConstPointer m_InputImage
 

Detailed Description

Generates a binary mask that excludes pixels with a specified intensity value.

This mask generator creates a mask where every pixel is 1 except for those pixels in the input image whose value matches the ignored pixel value, which are set to 0. This is commonly used to exclude background or zero-valued voxels from statistics calculations.

Precondition
An input image must be set via SetInputImage() before calling GetMask().
See also
MaskGenerator
ImageStatisticsCalculator

Definition at line 38 of file mitkIgnorePixelMaskGenerator.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ RealType

Real-valued type used for the pixel value to ignore.

Definition at line 47 of file mitkIgnorePixelMaskGenerator.h.

◆ Self

Standard Self typedef

Definition at line 42 of file mitkIgnorePixelMaskGenerator.h.

◆ Superclass

Constructor & Destructor Documentation

◆ IgnorePixelMaskGenerator()

mitk::IgnorePixelMaskGenerator::IgnorePixelMaskGenerator ( )
inlineprotected

Definition at line 70 of file mitkIgnorePixelMaskGenerator.h.

◆ ~IgnorePixelMaskGenerator()

mitk::IgnorePixelMaskGenerator::~IgnorePixelMaskGenerator ( )
protecteddefault

Member Function Documentation

◆ DoGetMask()

mitk::Image::ConstPointer mitk::IgnorePixelMaskGenerator::DoGetMask ( unsigned int  maskID)
overrideprotectedvirtual

Must be overridden by derived classes to generate the requested mask.

Parameters
[in]maskIDParameter indicating which mask should be returned.
Returns
The generated mask image.

Implements mitk::MaskGenerator.

◆ GetClassName()

virtual const char* mitk::IgnorePixelMaskGenerator::GetClassName ( ) const
virtual

Runtime information support.

◆ GetNumberOfMasks()

unsigned int mitk::IgnorePixelMaskGenerator::GetNumberOfMasks ( ) const
overridevirtual

Returns the number of masks this generator provides.

Returns
Always returns 1.

Implements mitk::MaskGenerator.

◆ InternalCalculateMask()

template<typename TPixel , unsigned int VImageDimension>
void mitk::IgnorePixelMaskGenerator::InternalCalculateMask ( const itk::Image< TPixel, VImageDimension > *  image)
protected

◆ New()

static Pointer mitk::IgnorePixelMaskGenerator::New ( )
static

Method for creation through the object factory.

◆ SetIgnoredPixelValue()

void mitk::IgnorePixelMaskGenerator::SetIgnoredPixelValue ( RealType  pixelValue)

Set the pixel value to be excluded from the mask.

Pixels in the input image with this value will be set to 0 in the generated mask; all other pixels will be set to 1.

Parameters
[in]pixelValueThe intensity value to ignore.

The documentation for this class was generated from the following file: