SimpleITK  
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
itk::simple::LabelVotingImageFilter Class 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 <sitkLabelVotingImageFilter.h>

+ Inheritance diagram for itk::simple::LabelVotingImageFilter:
+ Collaboration diagram for itk::simple::LabelVotingImageFilter:

Detailed Description

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
See also
itk::simple::LabelVoting for the procedural interface

Definition at line 65 of file sitkLabelVotingImageFilter.h.

Public Types

using PixelIDTypeList = typelist2::typelist< BasicPixelID< uint8_t >, BasicPixelID< uint16_t >, BasicPixelID< uint32_t >, BasicPixelID< uint64_t > >
 
using Self = LabelVotingImageFilter
 
- Public Types inherited from itk::simple::ImageFilter
using Self = ImageFilter
 
- Public Types inherited from itk::simple::ProcessObject
using Self = ProcessObject
 

Public Member Functions

Image Execute (const Image &image1)
 
Image Execute (const Image &image1, const Image &image2)
 
Image Execute (const Image &image1, const Image &image2, const Image &image3)
 
Image Execute (const Image &image1, const Image &image2, const Image &image3, const Image &image4)
 
Image Execute (const Image &image1, const Image &image2, const Image &image3, const Image &image4, const Image &image5)
 
Image Execute (const std::vector< Image > &images)
 
uint64_t GetLabelForUndecidedPixels () const
 
std::string GetName () const
 
 LabelVotingImageFilter ()
 
SelfSetLabelForUndecidedPixels (uint64_t LabelForUndecidedPixels)
 
std::string ToString () const
 
virtual ~LabelVotingImageFilter ()
 
- Public Member Functions inherited from itk::simple::ImageFilter
 ImageFilter ()
 
virtual ~ImageFilter ()=0
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
virtual int AddCommand (itk::simple::EventEnum event, const std::function< void()> &func)
 Directly add a callback to observe an event. More...
 
virtual int AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd)
 Add a Command Object to observer the event. More...
 
virtual float GetProgress () const
 An Active Measurement of the progress of execution. More...
 
virtual bool HasCommand (itk::simple::EventEnum event) const
 Query of this object has any registered commands for event. More...
 
 ProcessObject ()
 
virtual void RemoveAllCommands ()
 Remove all registered commands. More...
 
virtual ~ProcessObject ()
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
virtual bool GetDebug () const
 
virtual void SetDebug (bool debugFlag)
 
virtual void SetNumberOfThreads (unsigned int n)
 
virtual unsigned int GetNumberOfThreads () const
 
virtual void SetNumberOfWorkUnits (unsigned int n)
 
virtual unsigned int GetNumberOfWorkUnits () const
 

Private Types

using MemberFunctionType = Image(Self::*)(const std::vector< Image > &)
 

Private Member Functions

template<class TImageType >
Image ExecuteInternal (const std::vector< Image > &images)
 

Private Attributes

uint64_t m_LabelForUndecidedPixels {std::numeric_limits<uint64_t>::max()}
 
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 

Friends

struct detail::MemberFunctionAddressor< MemberFunctionType >
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::simple::ProcessObject
static bool GetGlobalDefaultDebug ()
 
static void GlobalDefaultDebugOff ()
 
static void GlobalDefaultDebugOn ()
 
static void SetGlobalDefaultDebug (bool debugFlag)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static void SetGlobalWarningDisplay (bool flag)
 
static bool GetGlobalWarningDisplay ()
 
static double GetGlobalDefaultCoordinateTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultCoordinateTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static double GetGlobalDefaultDirectionTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultDirectionTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static bool SetGlobalDefaultThreader (const std::string &threader)
 Set/Get the default threader used for process objects. More...
 
static std::string GetGlobalDefaultThreader ()
 Set/Get the default threader used for process objects. More...
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 Set/Get the default threader used for process objects. More...
 
- Protected Member Functions inherited from itk::simple::ImageFilter
void CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name)
 
- Protected Member Functions inherited from itk::simple::ProcessObject
virtual unsigned long AddITKObserver (const itk::EventObject &, itk::Command *)
 
virtual itk::ProcessObjectGetActiveProcess ()
 
virtual void OnActiveProcessDelete ()
 
virtual void onCommandDelete (const itk::simple::Command *cmd) noexcept
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
- Static Protected Member Functions inherited from itk::simple::ImageFilter
template<class TImageType >
static void FixNonZeroIndex (TImageType *img)
 
- Static Protected Member Functions inherited from itk::simple::ProcessObject
template<class TImageType >
static TImageType::ConstPointer CastImageToITK (const Image &img)
 
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img)
 
template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img)
 
template<class TImageType >
static Image CastITKToImage (TImageType *img)
 
static const itk::EventObjectGetITKEventObject (EventEnum e)
 
template<typename T >
static std::ostream & ToStringHelper (std::ostream &os, const T &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const signed char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const unsigned char &v)
 

Member Typedef Documentation

◆ MemberFunctionType

using itk::simple::LabelVotingImageFilter::MemberFunctionType = Image (Self::*)( const std::vector<Image> & )
private

Setup for member function dispatching

Definition at line 116 of file sitkLabelVotingImageFilter.h.

◆ PixelIDTypeList

using itk::simple::LabelVotingImageFilter::PixelIDTypeList = typelist2::typelist< BasicPixelID<uint8_t>, BasicPixelID<uint16_t>, BasicPixelID<uint32_t>, BasicPixelID<uint64_t> >

Define the pixels types supported by this filter

Definition at line 80 of file sitkLabelVotingImageFilter.h.

◆ Self

Definition at line 69 of file sitkLabelVotingImageFilter.h.

Constructor & Destructor Documentation

◆ ~LabelVotingImageFilter()

virtual itk::simple::LabelVotingImageFilter::~LabelVotingImageFilter ( )
virtual

Destructor

◆ LabelVotingImageFilter()

itk::simple::LabelVotingImageFilter::LabelVotingImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

◆ Execute() [1/6]

Image itk::simple::LabelVotingImageFilter::Execute ( const Image image1)

◆ Execute() [2/6]

Image itk::simple::LabelVotingImageFilter::Execute ( const Image image1,
const Image image2 
)

◆ Execute() [3/6]

Image itk::simple::LabelVotingImageFilter::Execute ( const Image image1,
const Image image2,
const Image image3 
)

◆ Execute() [4/6]

Image itk::simple::LabelVotingImageFilter::Execute ( const Image image1,
const Image image2,
const Image image3,
const Image image4 
)

◆ Execute() [5/6]

Image itk::simple::LabelVotingImageFilter::Execute ( const Image image1,
const Image image2,
const Image image3,
const Image image4,
const Image image5 
)

◆ Execute() [6/6]

Image itk::simple::LabelVotingImageFilter::Execute ( const std::vector< Image > &  images)

Execute the filter on the input images

◆ ExecuteInternal()

template<class TImageType >
Image itk::simple::LabelVotingImageFilter::ExecuteInternal ( const std::vector< Image > &  images)
private

◆ GetLabelForUndecidedPixels()

uint64_t itk::simple::LabelVotingImageFilter::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.

Definition at line 93 of file sitkLabelVotingImageFilter.h.

◆ GetName()

std::string itk::simple::LabelVotingImageFilter::GetName ( ) const
inlinevirtual

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 96 of file sitkLabelVotingImageFilter.h.

◆ SetLabelForUndecidedPixels()

Self& itk::simple::LabelVotingImageFilter::SetLabelForUndecidedPixels ( uint64_t  LabelForUndecidedPixels)
inline

Set label value for undecided pixels.

Definition at line 88 of file sitkLabelVotingImageFilter.h.

◆ ToString()

std::string itk::simple::LabelVotingImageFilter::ToString ( ) const
virtual

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Definition at line 121 of file sitkLabelVotingImageFilter.h.

Member Data Documentation

◆ m_LabelForUndecidedPixels

uint64_t itk::simple::LabelVotingImageFilter::m_LabelForUndecidedPixels {std::numeric_limits<uint64_t>::max()}
private

Definition at line 126 of file sitkLabelVotingImageFilter.h.

◆ m_MemberFactory

std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > itk::simple::LabelVotingImageFilter::m_MemberFactory
private

Definition at line 123 of file sitkLabelVotingImageFilter.h.


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