Lookup class for histogram intensity matching. More...
#include <cmtkTypedArrayFunctionHistogramMatching.h>
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. |
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.
typedef Histogram<unsigned int> cmtk::TypedArrayFunctionHistogramMatching::HistogramType |
Histogram type.
Definition at line 79 of file cmtkTypedArrayFunctionHistogramMatching.h.
This class.
Definition at line 73 of file cmtkTypedArrayFunctionHistogramMatching.h.
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.
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.
const size_t cmtk::TypedArrayFunctionHistogramMatching::DefaultNumberOfHistogramBins = 1024 [static] |
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.
HistogramType::SmartPtr cmtk::TypedArrayFunctionHistogramMatching::m_VariableArrayHistogram [private] |
Variable array histogram.
Definition at line 95 of file cmtkTypedArrayFunctionHistogramMatching.h.
Referenced by TypedArrayFunctionHistogramMatching().