NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage > Class Template Reference

Computes the threshold required to separate an object or patient in the foreground of an image from a dark background. More...

Inheritance diagram for itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >:
Inheritance graph
[legend]
Collaboration diagram for itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >:
Collaboration graph
[legend]

Public Types

typedef
ForegroundFromBackgroundImageThresholdCalculator 
Self
 
typedef Object Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef TInputImage ImageType
 
typedef TInputImage::Pointer ImagePointer
 
typedef TInputImage::ConstPointer ImageConstPointer
 
typedef TInputImage::PixelType PixelType
 
typedef TInputImage::IndexType IndexType
 
typedef TInputImage::RegionType RegionType
 
typedef
itk::Statistics::ImageToHistogramFilter
< TInputImage > 
ImageToHistogramFilterType
 
typedef
ImageToHistogramFilterType::HistogramType 
HistogramType
 
typedef itk::Array< double > ArrayType
 

Public Member Functions

virtual const char * GetClassName () const
 
virtual void SetImage (const ImageType *_arg)
 
void Compute (void) throw (ExceptionObject)
 
virtual PixelType GetThreshold () const
 
void SetRegion (const RegionType &region)
 
void SetVerbose (bool flag)
 
void SetVerboseOn (void)
 
void SetVerboseOff (void)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ForegroundFromBackgroundImageThresholdCalculator ()
 
virtual ~ForegroundFromBackgroundImageThresholdCalculator ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void WriteHistogramToTextFile (std::string fileName, HistogramType *histogram)
 
void WriteDataToTextFile (std::string fileName, itk::Array< double > *x, itk::Array< double > *y)
 
void Normalise (itk::Array< double > *y)
 
void ComputeVariances (int iStart, int iInc, unsigned int nIntensities, PixelType firstIntensity)
 

Protected Attributes

bool m_FlgVerbose
 
PixelType m_Threshold
 
ImageConstPointer m_Image
 
RegionType m_Region
 
bool m_RegionSetByUser
 

Detailed Description

template<class TInputImage>
class itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >

Computes the threshold required to separate an object or patient in the foreground of an image from a dark background.

This calculator computes a threshold to separate an object (i.e. the patient) from the background using the following criteria:

  1. Intensities below this threshold have a lower variance than intensities above it.
  2. The backgound is dark therefore the threshold will be close to zero.
  3. The number of voxels below this threshold is large compared to the number of voxels at intensity levels in the foreground.

The threshold is therefore equal to:

( MaxIntensity - t )*( CDF( t ) - Variance( t )/Max_Variance )

where:

CDF( t ) is the cummulative distribution of intensities below t

Variance( t ) is the variance of intensities below t.

Member Typedef Documentation

template<class TInputImage >
typedef itk::Array< double > itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::ArrayType

Type definition for the arrays used

template<class TInputImage >
typedef SmartPointer< const Self > itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::ConstPointer
template<class TInputImage >
typedef ImageToHistogramFilterType::HistogramType itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::HistogramType

Type definition for the image histogram.

template<class TInputImage >
typedef TInputImage::ConstPointer itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::ImageConstPointer

Const Pointer type for the image.

template<class TInputImage >
typedef TInputImage::Pointer itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::ImagePointer

Pointer type for the image.

template<class TInputImage >
typedef itk::Statistics::ImageToHistogramFilter< TInputImage > itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::ImageToHistogramFilterType

Type definition for the image histogram.

template<class TInputImage >
typedef TInputImage itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::ImageType

Type definition for the input image.

template<class TInputImage >
typedef TInputImage::IndexType itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::IndexType

Type definition for the input image index type.

template<class TInputImage >
typedef TInputImage::PixelType itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::PixelType

Type definition for the input image pixel type.

template<class TInputImage >
typedef SmartPointer< Self > itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::Pointer
template<class TInputImage >
typedef TInputImage::RegionType itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::RegionType

Type definition for the input image region type.

Standard class typedefs.

template<class TInputImage >
typedef Object itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::Superclass

Constructor & Destructor Documentation

template<class TInputImage >
virtual itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::~ForegroundFromBackgroundImageThresholdCalculator ( )
inlineprotectedvirtual

Member Function Documentation

template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::Compute ( void  )
throw (ExceptionObject
)

Compute the threshold to separate the forground from the background.

template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::ComputeVariances ( int  iStart,
int  iInc,
unsigned int  nIntensities,
PixelType  firstIntensity 
)
protected
template<class TInputImage >
virtual const char* itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

template<class TInputImage >
virtual PixelType itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::GetThreshold ( ) const
virtual

Return the threshold intensity value.

template<class TInputImage >
static Pointer itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::New ( )
static

Method for creation through the object factory.

template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::Normalise ( itk::Array< double > *  y)
protected
template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotected
template<class TInputImage >
virtual void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::SetImage ( const ImageType _arg)
virtual

Set the input image.

template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::SetRegion ( const RegionType region)

Set the region over which the values will be computed

template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::SetVerbose ( bool  flag)
inline
template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::SetVerboseOff ( void  )
inline
template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::SetVerboseOn ( void  )
inline
template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::WriteDataToTextFile ( std::string  fileName,
itk::Array< double > *  x,
itk::Array< double > *  y 
)
protected
template<class TInputImage >
void itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::WriteHistogramToTextFile ( std::string  fileName,
HistogramType histogram 
)
protected

Member Data Documentation

template<class TInputImage >
bool itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::m_FlgVerbose
protected
template<class TInputImage >
ImageConstPointer itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::m_Image
protected
template<class TInputImage >
RegionType itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::m_Region
protected
template<class TInputImage >
bool itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::m_RegionSetByUser
protected
template<class TInputImage >
PixelType itk::ForegroundFromBackgroundImageThresholdCalculator< TInputImage >::m_Threshold
protected

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