Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage > Class Template Reference

Performs a morphological closing on a binary image, selectively filling only those holes whose surface-to-volume ratio exceeds a given threshold. More...

#include <itkIntelligentBinaryClosingFilter.h>

Inheritance diagram for itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >:
Collaboration diagram for itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >:

Public Types

typedef IntelligentBinaryClosingFilter Self
 
typedef TInputImage InputImageType
 
typedef TOutputImage OutputImageType
 
typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass
 
typedef SmartPointer< Self > Pointer
 

Public Member Functions

 itkStaticConstMacro (ImageDimension, unsigned int, TInputImage::ImageDimension)
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
void GenerateData () override
 Execute the intelligent binary closing algorithm. More...
 
void SetInput (const InputImageType *input) override
 Set the input binary image. More...
 
void SetInput (unsigned int i, const TInputImage *image) override
 Set the input at a given index. Only index 0 is supported. More...
 
virtual float GetClosingRadius ()
 Get the radius used for the morphological closing structuring element. More...
 
virtual void SetClosingRadius (float _arg)
 Set the radius of the structuring element for morphological closing. More...
 
virtual float GetSurfaceRatio ()
 Get the surface-to-volume ratio threshold. More...
 
virtual void SetSurfaceRatio (float _arg)
 Set the surface-to-volume ratio threshold. More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 IntelligentBinaryClosingFilter ()
 
 ~IntelligentBinaryClosingFilter () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 

Detailed Description

template<class TInputImage, class TOutputImage>
class itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >

Performs a morphological closing on a binary image, selectively filling only those holes whose surface-to-volume ratio exceeds a given threshold.

Unlike a standard binary closing, this filter analyzes connected components in the closed region (the difference between dilated and eroded images) and only fills components that meet the surface ratio criterion. This prevents the closing operation from filling large cavities that should be preserved.

The filter internally uses a mini-pipeline consisting of dilation, erosion, subtraction, connected component analysis, and relabeling filters.

Template Parameters
TInputImageThe input image type (binary image).
TOutputImageThe output image type (typically a labeled or binary image).
See also
itk::BinaryDilateImageFilter
itk::BinaryErodeImageFilter
itk::ConnectedComponentImageFilter

Definition at line 49 of file itkIntelligentBinaryClosingFilter.h.

Member Typedef Documentation

◆ InputImageType

template<class TInputImage , class TOutputImage >
typedef TInputImage itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::InputImageType

The type of input image.

Definition at line 56 of file itkIntelligentBinaryClosingFilter.h.

◆ OutputImageType

template<class TInputImage , class TOutputImage >
typedef TOutputImage itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::OutputImageType

The type of output image.

Definition at line 62 of file itkIntelligentBinaryClosingFilter.h.

◆ Pointer

template<class TInputImage , class TOutputImage >
typedef SmartPointer<Self> itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::Pointer

Smart pointer typedef support

Definition at line 68 of file itkIntelligentBinaryClosingFilter.h.

◆ Self

template<class TInputImage , class TOutputImage >
typedef IntelligentBinaryClosingFilter itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::Self

Standard "Self" typedef.

Definition at line 53 of file itkIntelligentBinaryClosingFilter.h.

◆ Superclass

template<class TInputImage , class TOutputImage >
typedef ImageToImageFilter<InputImageType, OutputImageType> itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::Superclass

Standard super class typedef support.

Definition at line 65 of file itkIntelligentBinaryClosingFilter.h.

Constructor & Destructor Documentation

◆ IntelligentBinaryClosingFilter()

template<class TInputImage , class TOutputImage >
itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::IntelligentBinaryClosingFilter ( )
protected

◆ ~IntelligentBinaryClosingFilter()

template<class TInputImage , class TOutputImage >
itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::~IntelligentBinaryClosingFilter ( )
inlineoverrideprotected

Definition at line 149 of file itkIntelligentBinaryClosingFilter.h.

Member Function Documentation

◆ Clone()

template<class TInputImage , class TOutputImage >
Pointer itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::Clone ( ) const

◆ GenerateData()

template<class TInputImage , class TOutputImage >
void itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::GenerateData ( )
override

Execute the intelligent binary closing algorithm.

This method is not multithreaded. It runs the internal mini-pipeline (dilate, erode, subtract, connected component analysis) and selectively fills holes based on the surface ratio.

◆ GetClassName()

template<class TInputImage , class TOutputImage >
virtual const char* itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::GetClassName ( ) const
virtual

Run-time type information (and related methods)

◆ GetClosingRadius()

template<class TInputImage , class TOutputImage >
virtual float itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::GetClosingRadius ( )
virtual

Get the radius used for the morphological closing structuring element.

Returns
The closing radius in pixels.

◆ GetSurfaceRatio()

template<class TInputImage , class TOutputImage >
virtual float itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::GetSurfaceRatio ( )
virtual

Get the surface-to-volume ratio threshold.

Returns
The surface ratio threshold.

◆ itkStaticConstMacro()

template<class TInputImage , class TOutputImage >
itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::itkStaticConstMacro ( ImageDimension  ,
unsigned int  ,
TInputImage::ImageDimension   
)

Dimension of the input and output images.

◆ New()

template<class TInputImage , class TOutputImage >
static Pointer itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

template<class TInputImage , class TOutputImage >
void itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotected

◆ SetClosingRadius()

template<class TInputImage , class TOutputImage >
virtual void itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::SetClosingRadius ( float  _arg)
virtual

Set the radius of the structuring element for morphological closing.

Parameters
[in]_argThe closing radius in pixels.

◆ SetInput() [1/2]

template<class TInputImage , class TOutputImage >
void itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::SetInput ( const InputImageType *  input)
inlineoverride

Set the input binary image.

Overloaded to also connect the input to the internal dilation filter.

Parameters
[in]inputThe input binary image.

Definition at line 93 of file itkIntelligentBinaryClosingFilter.h.

◆ SetInput() [2/2]

template<class TInputImage , class TOutputImage >
void itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::SetInput ( unsigned int  i,
const TInputImage *  image 
)
inlineoverride

Set the input at a given index. Only index 0 is supported.

Parameters
[in]iInput index (must be 0).
[in]imageThe input binary image.
Exceptions
itk::ExceptionObjectif i is not 0.

Definition at line 107 of file itkIntelligentBinaryClosingFilter.h.

◆ SetSurfaceRatio()

template<class TInputImage , class TOutputImage >
virtual void itk::IntelligentBinaryClosingFilter< TInputImage, TOutputImage >::SetSurfaceRatio ( float  _arg)
virtual

Set the surface-to-volume ratio threshold.

Connected components in the difference image whose surface ratio exceeds this value will be filled in the output.

Parameters
[in]_argThe surface ratio threshold.

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