open_iA  2020.01
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
Public Types | Public Member Functions | Protected Member Functions | List of all members
iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage > Class Template Reference

This filter performs pixelwise voting among an arbitrary number of input images, where each of them represents a segmentation of the same scene (i.e., image). More...

#include <iAParametrizableLabelVotingImageFilter.h>

Inheritance diagram for iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >:
Collaboration diagram for iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >:

Public Types

typedef itk::ImageRegionConstIterator< DoubleImgConstDblIt
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::Image< double, 3 > DoubleImg
 
typedef InputImageType::ConstPointer InputImagePointer
 
typedef TInputImage InputImageType
 Typedefs. More...
 
typedef TInputImage::PixelType InputPixelType
 
typedef unsigned long LabelCountType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef Superclass::OutputImageRegionType OutputImageRegionType
 
typedef TOutputImage OutputImageType
 
typedef TOutputImage::PixelType OutputPixelType
 Extract some information from the image types. More...
 
typedef itk::SmartPointer< SelfPointer
 
typedef iAParametrizableLabelVotingImageFilter Self
 Standard class typedefs. More...
 
typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
 

Public Member Functions

OutputPixelType GetLabelForUndecidedPixels () const
 Get label value used for undecided pixels. More...
 
DoubleImg::Pointer GetNumbers (int mode)
 
double GetUndecided () const
 
 itkNewMacro (Self)
 Method for creation through the object factory. More...
 
 itkStaticConstMacro (ImageDimension, int, TOutputImage::ImageDimension)
 
 itkStaticConstMacro (InputImageDimension, int, TInputImage::ImageDimension)
 Extract some information from the image types. More...
 
 itkTypeMacro (iAParametrizableLabelVotingImageFilter, ImageToImageFilter)
 Run-time type information (and related methods) More...
 
void SetAbsoluteMinimumPercentage (double p)
 Sets the percentage that has to be achieved as a minimum for the majority vote to be accepted as majority. More...
 
void SetInputLabelVotersSet (std::set< std::pair< int, int > > inputLabelVotersSet)
 sets the data determining which input is considered for voting on which label At each pixel the label value is checked, and an input is only considered if this input is considered a suitable voter for this label (i.e., if the pair <label, input index> is contained in the set given here) More...
 
void SetInputLabelWeightMap (std::map< std::pair< int, int >, double > inputLabelWeightMap)
 set a weight for a pair of <label, input index> only used if WeightType LabelBased is used (see WeightType, SetWeightType) More...
 
void SetLabelForUndecidedPixels (const OutputPixelType l)
 Set label value for undecided pixels. More...
 
void SetMaxPixelEntropy (double e)
 set a maximum threshold for the pixel entropy More...
 
void SetMinimumDifferencePercentage (double p)
 set a minimum threshold for the percentage difference between first and second best guess More...
 
void SetMinimumRatio (double r)
 set a minimum threshold on the ratio between first and second best guess More...
 
void SetProbabilityImages (int inputIdx, std::vector< DoubleImg::Pointer > const &probImgs)
 set probabilities for each label for one input in order for probability-related functionality to work, this method needs to be called once with each input idx More...
 
void SetWeightType (WeightType weightType)
 determine the type of weight given each input in the voting process see WeightType for more details More...
 
void UnsetLabelForUndecidedPixels ()
 Unset label value for undecided pixels and turn on automatic selection. More...
 

Protected Member Functions

void BeforeThreadedGenerateData () override
 Determine maximum label value in all input images and initialize global data. More...
 
InputPixelType ComputeMaximumInputValue ()
 Determine maximum value among all input images' pixels. More...
 
 iAParametrizableLabelVotingImageFilter ()
 
void PrintSelf (std::ostream &, itk::Indent) const override
 
void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId) override
 
virtual ~iAParametrizableLabelVotingImageFilter ()
 

Detailed Description

template<typename TInputImage, typename TOutputImage = TInputImage>
class iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >

This filter performs pixelwise voting among an arbitrary number of input images, where each of them represents a segmentation of the same scene (i.e., image).

Label voting is a simple method of classifier combination applied to image segmentation. Typically, the accuracy of the combined segmentation exceeds the accuracy of any of the input segmentations. Voting is therefore commonly used as a way of boosting segmentation performance.

The use of label voting for combination of multiple segmentations is described in

T. Rohlfing and C. R. Maurer, Jr., "Multi-classifier framework for atlas-based image segmentation," Pattern Recognition Letters, 2005.

INPUTS
All input volumes to this filter must be segmentations of an image, that is, they must have discrete pixel values where each value represents a different segmented object.

Input volumes must all contain the same size RequestedRegions. Not all input images must contain all possible labels, but all label values must have the same meaning in all images.

OUTPUTS
The voting filter produces a single output volume. Each output pixel contains the label that occurred most often among the labels assigned to this pixel in all the input volumes, that is, the label that received the maximum number of "votes" from the input pixels.. If the maximum number of votes is not unique, i.e., if more than one label have a maximum number of votes, an "undecided" label is assigned to that output pixel.

By default, the label used for undecided pixels is the maximum label value used in the input images plus one. Since it is possible for an image with 8 bit pixel values to use all 256 possible label values, it is permissible to combine 8 bit (i.e., byte) images into a 16 bit (i.e., short) output image.

PARAMETERS
The label used for "undecided" labels can be set using SetLabelForUndecidedPixels. This functionality can be unset by calling UnsetLabelForUndecidedPixels.
Author
Torsten Rohlfing, SRI International, Neuroscience Program

Member Typedef Documentation

◆ ConstDblIt

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef itk::ImageRegionConstIterator<DoubleImg> iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::ConstDblIt

◆ ConstPointer

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef itk::SmartPointer< const Self > iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::ConstPointer

◆ DoubleImg

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef itk::Image<double, 3> iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::DoubleImg

◆ InputImagePointer

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef InputImageType::ConstPointer iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::InputImagePointer

◆ InputImageType

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef TInputImage iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::InputImageType

Typedefs.

◆ InputPixelType

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef TInputImage::PixelType iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::InputPixelType

◆ LabelCountType

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef unsigned long iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::LabelCountType

◆ OutputImagePointer

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef OutputImageType::Pointer iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::OutputImagePointer

◆ OutputImageRegionType

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef Superclass::OutputImageRegionType iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::OutputImageRegionType

◆ OutputImageType

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef TOutputImage iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::OutputImageType

◆ OutputPixelType

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef TOutputImage::PixelType iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::OutputPixelType

Extract some information from the image types.

Dimensionality of the two images is assumed to be the same.

◆ Pointer

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef itk::SmartPointer< Self > iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::Pointer

◆ Self

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef iAParametrizableLabelVotingImageFilter iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::Self

Standard class typedefs.

◆ Superclass

template<typename TInputImage, typename TOutputImage = TInputImage>
typedef itk::ImageToImageFilter< TInputImage, TOutputImage > iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::Superclass

Constructor & Destructor Documentation

◆ iAParametrizableLabelVotingImageFilter()

template<typename TInputImage , typename TOutputImage >
iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::iAParametrizableLabelVotingImageFilter ( )
protected

◆ ~iAParametrizableLabelVotingImageFilter()

template<typename TInputImage, typename TOutputImage = TInputImage>
virtual iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::~iAParametrizableLabelVotingImageFilter ( )
inlineprotectedvirtual

Member Function Documentation

◆ BeforeThreadedGenerateData()

template<typename TInputImage , typename TOutputImage >
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::BeforeThreadedGenerateData ( )
overrideprotected

Determine maximum label value in all input images and initialize global data.

◆ ComputeMaximumInputValue()

template<typename TInputImage , typename TOutputImage >
iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::InputPixelType iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::ComputeMaximumInputValue ( )
protected

Determine maximum value among all input images' pixels.

◆ GetLabelForUndecidedPixels()

template<typename TInputImage, typename TOutputImage = TInputImage>
OutputPixelType iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::GetLabelForUndecidedPixels ( ) const
inline

Get label value used for undecided pixels.

After updating the filter, this function returns the actual label value used for undecided pixels in the current output. Note that this value is overwritten when SetLabelForUndecidedPixels is called and the new value only becomes effective upon the next filter update.

◆ GetNumbers()

template<typename TInputImage, typename TOutputImage = TInputImage>
DoubleImg::Pointer iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::GetNumbers ( int  mode)
inline

◆ GetUndecided()

template<typename TInputImage, typename TOutputImage = TInputImage>
double iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::GetUndecided ( ) const
inline

◆ itkNewMacro()

template<typename TInputImage, typename TOutputImage = TInputImage>
iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::itkNewMacro ( Self  )

Method for creation through the object factory.

◆ itkStaticConstMacro() [1/2]

template<typename TInputImage, typename TOutputImage = TInputImage>
iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro ( ImageDimension  ,
int  ,
TOutputImage::ImageDimension   
)

◆ itkStaticConstMacro() [2/2]

template<typename TInputImage, typename TOutputImage = TInputImage>
iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::itkStaticConstMacro ( InputImageDimension  ,
int  ,
TInputImage::ImageDimension   
)

Extract some information from the image types.

Dimensionality of the two images is assumed to be the same.

◆ itkTypeMacro()

template<typename TInputImage, typename TOutputImage = TInputImage>
iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::itkTypeMacro ( iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >  ,
ImageToImageFilter   
)

Run-time type information (and related methods)

◆ PrintSelf()

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

◆ SetAbsoluteMinimumPercentage()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetAbsoluteMinimumPercentage ( double  p)
inline

Sets the percentage that has to be achieved as a minimum for the majority vote to be accepted as majority.

Parameters
pthe percentage (in the interval 0..1); 0 -> no minimum percentage 1 -> all images have to agree on a label

◆ SetInputLabelVotersSet()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetInputLabelVotersSet ( std::set< std::pair< int, int > >  inputLabelVotersSet)
inline

sets the data determining which input is considered for voting on which label At each pixel the label value is checked, and an input is only considered if this input is considered a suitable voter for this label (i.e., if the pair <label, input index> is contained in the set given here)

◆ SetInputLabelWeightMap()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetInputLabelWeightMap ( std::map< std::pair< int, int >, double >  inputLabelWeightMap)
inline

set a weight for a pair of <label, input index> only used if WeightType LabelBased is used (see WeightType, SetWeightType)

◆ SetLabelForUndecidedPixels()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetLabelForUndecidedPixels ( const OutputPixelType  l)
inline

Set label value for undecided pixels.

◆ SetMaxPixelEntropy()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetMaxPixelEntropy ( double  e)
inline

set a maximum threshold for the pixel entropy

◆ SetMinimumDifferencePercentage()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetMinimumDifferencePercentage ( double  p)
inline

set a minimum threshold for the percentage difference between first and second best guess

◆ SetMinimumRatio()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetMinimumRatio ( double  r)
inline

set a minimum threshold on the ratio between first and second best guess

◆ SetProbabilityImages()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetProbabilityImages ( int  inputIdx,
std::vector< DoubleImg::Pointer > const &  probImgs 
)
inline

set probabilities for each label for one input in order for probability-related functionality to work, this method needs to be called once with each input idx

◆ SetWeightType()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::SetWeightType ( WeightType  weightType)
inline

determine the type of weight given each input in the voting process see WeightType for more details

◆ ThreadedGenerateData()

template<typename TInputImage , typename TOutputImage >
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::ThreadedGenerateData ( const OutputImageRegionType outputRegionForThread,
itk::ThreadIdType  threadId 
)
overrideprotected

◆ UnsetLabelForUndecidedPixels()

template<typename TInputImage, typename TOutputImage = TInputImage>
void iAParametrizableLabelVotingImageFilter< TInputImage, TOutputImage >::UnsetLabelForUndecidedPixels ( )
inline

Unset label value for undecided pixels and turn on automatic selection.


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