Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes

cmtk::TypedArrayFunctionHistogramMatching Class Reference
[cmtkBase Library]

Lookup class for histogram intensity matching. More...

#include <cmtkTypedArrayFunctionHistogramMatching.h>

Inheritance diagram for cmtk::TypedArrayFunctionHistogramMatching:
Inheritance graph
[legend]
Collaboration diagram for cmtk::TypedArrayFunctionHistogramMatching:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
TypedArrayFunctionHistogramMatching 
Self
 This class.
typedef Histogram< unsigned int > HistogramType
 Histogram type.

Public Member Functions

 TypedArrayFunctionHistogramMatching (const TypedArray &variableArray, const TypedArray &fixedArray, const size_t numberOfHistogramBins=Self::DefaultNumberOfHistogramBins)
 Constructor: build lookup from two data arrays.
 TypedArrayFunctionHistogramMatching (const Self::HistogramType &variableHistogram, const Self::HistogramType &fixedHistogram)
 Constructor: build lookup from two histograms.
virtual Types::DataItem operator() (const Types::DataItem valueIn) const
 Map a single value from the variable array to its new value.

Static Public Attributes

static const size_t DefaultNumberOfHistogramBins = 1024
 Default number of histogram bins.

Private Member Functions

void CreateLookup ()
 Create lookup from histograms.

Private Attributes

HistogramType::SmartPtr m_FixedArrayHistogram
 Fixed array histogram.
HistogramType::SmartPtr m_VariableArrayHistogram
 Variable array histogram.
std::vector< unsigned int > m_Lookup
 Lookup table that translates between the two histograms.

Detailed Description

Lookup class for histogram intensity matching.

This class provides a lookup table that is computed from the histograms of two cmtk::TypedArray objects. The lookup can then be applied to the "variable" array so that its distribution afterwards matches, as closely as possible, the distribution of the "fixed" array.

To apply histogram matching to "variableArray" based on the distribution of "fixedArray", use the following:

  variableArray->ApplyFunction( cmtk::TypedArrayFunctionHistogramMatching( variableArray, fixedArray ) );
 *

The variable array for setting up the matching function need not be the same as the array that the function is applied to:

  variableArray->ApplyFunction( cmtk::TypedArrayFunctionHistogramMatching( testArray, fixedArray ) );
 *

Inherit from base class.

Definition at line 66 of file cmtkTypedArrayFunctionHistogramMatching.h.


Member Typedef Documentation

Histogram type.

Definition at line 79 of file cmtkTypedArrayFunctionHistogramMatching.h.

This class.

Definition at line 73 of file cmtkTypedArrayFunctionHistogramMatching.h.


Constructor & Destructor Documentation

cmtk::TypedArrayFunctionHistogramMatching::TypedArrayFunctionHistogramMatching ( const TypedArray variableArray,
const TypedArray fixedArray,
const size_t  numberOfHistogramBins = Self::DefaultNumberOfHistogramBins 
)

Constructor: build lookup from two data arrays.

Definition at line 39 of file cmtkTypedArrayFunctionHistogramMatching.cxx.

References cmtk::Histogram< T >::ConvertToCumulative(), and cmtk::TypedArray::GetHistogram().

cmtk::TypedArrayFunctionHistogramMatching::TypedArrayFunctionHistogramMatching ( const Self::HistogramType variableHistogram,
const Self::HistogramType fixedHistogram 
)

Constructor: build lookup from two histograms.

Definition at line 52 of file cmtkTypedArrayFunctionHistogramMatching.cxx.

References cmtk::Histogram< T >::Clone(), CreateLookup(), m_FixedArrayHistogram, and m_VariableArrayHistogram.


Member Function Documentation

void cmtk::TypedArrayFunctionHistogramMatching::CreateLookup (  ) [private]

Create lookup from histograms.

Definition at line 66 of file cmtkTypedArrayFunctionHistogramMatching.cxx.

Referenced by TypedArrayFunctionHistogramMatching().

cmtk::Types::DataItem cmtk::TypedArrayFunctionHistogramMatching::operator() ( const Types::DataItem  valueIn ) const [virtual]

Map a single value from the variable array to its new value.

Implements cmtk::TypedArrayFunction.

Definition at line 95 of file cmtkTypedArrayFunctionHistogramMatching.cxx.


Member Data Documentation

Default number of histogram bins.

Definition at line 76 of file cmtkTypedArrayFunctionHistogramMatching.h.

Fixed array histogram.

Definition at line 92 of file cmtkTypedArrayFunctionHistogramMatching.h.

Referenced by TypedArrayFunctionHistogramMatching().

std::vector<unsigned int> cmtk::TypedArrayFunctionHistogramMatching::m_Lookup [private]

Lookup table that translates between the two histograms.

Definition at line 98 of file cmtkTypedArrayFunctionHistogramMatching.h.

Variable array histogram.

Definition at line 95 of file cmtkTypedArrayFunctionHistogramMatching.h.

Referenced by TypedArrayFunctionHistogramMatching().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines