#include <itkHistogramToTextureFeaturesFilter.h>
This class computes texture feature coefficients from a grey level co-occurrence matrix.
This class computes features that summarize image texture, given a grey level co-occurrence matrix (generated by a ScalarImageToCooccurrenceMatrixFilter or related class).
The features calculated are as follows (where \( g(i, j) \) is the element in cell i, j of a normalized GLCM):
"Energy" \( = f_1 = \sum_{i,j}g(i, j)^2 \)
"Entropy" \( = f_2 = -\sum_{i,j}g(i, j) \log_2 g(i, j)\), or 0 if \(g(i, j) = 0\)
"Correlation" \( = f_3 = \sum_{i,j}\frac{(i - \mu)(j - \mu)g(i, j)}{\sigma^2} \)
"Difference Moment" \(= f_4 = \sum_{i,j}\frac{1}{1 + (i - j)^2}g(i, j) \)
"Inertia" \( = f_5 = \sum_{i,j}(i - j)^2g(i, j) \) (sometimes called "contrast.")
"Cluster Shade" \( = f_6 = \sum_{i,j}((i - \mu) + (j - \mu))^3 g(i, j) \)
"Cluster Prominence" \( = f_7 = \sum_{i,j}((i - \mu) + (j - \mu))^4 g(i, j) \)
"Haralick's Correlation" \( = f_8 = \frac{\sum_{i,j}(i, j) g(i, j) -\mu_t^2}{\sigma_t^2} \) where \(\mu_t\) and \(\sigma_t\) are the mean and standard deviation of the row (or column, due to symmetry) sums.
Above, \( \mu = \) (weighted pixel average) \( = \sum_{i,j}i \cdot g(i, j) = \sum_{i,j}j \cdot g(i, j) \) (due to matrix symmetry), and
\( \sigma = \) (weighted pixel variance) \( = \sum_{i,j}(i - \mu)^2 \cdot g(i, j) = \sum_{i,j}(j - \mu)^2 \cdot g(i, j) \) (due to matrix symmetry)
A good texture feature set to use is the Conners, Trivedi and Harlow set: features 1, 2, 4, 5, 6, and 7. There is some correlation between the various features, so using all of them at the same time is not necessarily a good idea.
NOTA BENE: The input histogram will be forcibly normalized! This algorithm takes three passes through the input histogram if the histogram was already normalized, and four if not.
Web references:
http://www.cssip.uq.edu.au/meastex/www/algs/algs/algs.html https://www.ucalgary.ca/~mhallbey/texture/texture_tutorial.html
For algorithmic details see [47], [48], [26] and [27].
Author: Zachary Pincus
Definition at line 119 of file itkHistogramToTextureFeaturesFilter.h.
Static Public Member Functions | |
static Pointer | New () |
![]() | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool val) |
![]() | |
static void | BreakOnError () |
static Pointer | New () |
Protected Types | |
using | DataObjectPointerArraySizeType = ProcessObject::DataObjectPointerArraySizeType |
Private Member Functions | |
void | ComputeMeansAndVariances (double &pixelMean, double &marginalMean, double &marginalDevSquared, double &pixelVariance) |
Private Attributes | |
RelativeFrequencyContainerType | m_RelativeFrequencyContainer {} |
Additional Inherited Members | |
![]() | |
template<typename TSourceObject> | |
static void | MakeRequiredOutputs (TSourceObject &sourceObject, const DataObjectPointerArraySizeType numberOfRequiredOutputs) |
static constexpr float | progressFixedToFloat (uint32_t fixed) |
static uint32_t | progressFloatToFixed (float f) |
![]() | |
TimeStamp | m_OutputInformationMTime {} |
bool | m_Updating {} |
![]() | |
std::atomic< int > | m_ReferenceCount {} |
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::AbsoluteFrequencyType = typename HistogramType::AbsoluteFrequencyType |
Definition at line 142 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::ConstPointer = SmartPointer<const Self> |
Definition at line 128 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::DataObjectPointer = DataObject::Pointer |
Smart Pointer type to a DataObject.
Definition at line 161 of file itkHistogramToTextureFeaturesFilter.h.
|
protected |
Make a DataObject to be used for output output.
Definition at line 247 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::HistogramConstPointer = typename HistogramType::ConstPointer |
Definition at line 138 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::HistogramPointer = typename HistogramType::Pointer |
Definition at line 137 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::HistogramType = THistogram |
Definition at line 136 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::IndexType = typename HistogramType::IndexType |
Definition at line 141 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::MeasurementObjectType = SimpleDataObjectDecorator<MeasurementType> |
Type of DataObjects used for scalar outputs
Definition at line 164 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::MeasurementType = typename HistogramType::MeasurementType |
Definition at line 139 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::MeasurementVectorType = typename HistogramType::MeasurementVectorType |
Definition at line 140 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::Pointer = SmartPointer<Self> |
Definition at line 127 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::RelativeFrequencyContainerType = std::vector<RelativeFrequencyType> |
Container to hold relative frequencies of the histogram
Definition at line 150 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::RelativeFrequencyType = typename HistogramType::RelativeFrequencyType |
Definition at line 143 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::Self = HistogramToTextureFeaturesFilter |
Standard type alias
Definition at line 125 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::Superclass = ProcessObject |
Definition at line 126 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::TextureFeatureEnum = HistogramToTextureFeaturesFilterEnums::TextureFeature |
Definition at line 222 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::TotalAbsoluteFrequencyType = typename HistogramType::TotalAbsoluteFrequencyType |
Definition at line 145 of file itkHistogramToTextureFeaturesFilter.h.
using itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::TotalRelativeFrequencyType = typename HistogramType::TotalRelativeFrequencyType |
Definition at line 147 of file itkHistogramToTextureFeaturesFilter.h.
|
protected |
|
overrideprotecteddefault |
|
private |
|
virtual |
Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.
Reimplemented from itk::LightObject.
|
overrideprotectedvirtual |
This method causes the filter to generate its output.
Reimplemented from itk::ProcessObject.
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetClusterProminence | ( | ) | const |
Return cluster prominence texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetClusterProminenceOutput | ( | ) | const |
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetClusterShade | ( | ) | const |
Return cluster shade texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetClusterShadeOutput | ( | ) | const |
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetCorrelation | ( | ) | const |
return correlation texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetCorrelationOutput | ( | ) | const |
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetEnergy | ( | ) | const |
Return energy texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetEnergyOutput | ( | ) | const |
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetEntropy | ( | ) | const |
Return entropy texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetEntropyOutput | ( | ) | const |
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetFeature | ( | TextureFeatureEnum | feature | ) |
convenience method to access the texture values
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetHaralickCorrelation | ( | ) | const |
Return Haralick correlation texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetHaralickCorrelationOutput | ( | ) | const |
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetInertia | ( | ) | const |
Return inertia texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetInertiaOutput | ( | ) | const |
const HistogramType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetInput | ( | ) | const |
MeasurementType itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetInverseDifferenceMoment | ( | ) | const |
Return inverse difference moment texture value.
const MeasurementObjectType * itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::GetInverseDifferenceMomentOutput | ( | ) | const |
|
overridevirtual |
Reimplemented from itk::LightObject.
|
protectedvirtual |
Make a DataObject of the correct type to used as the specified output.
Every ProcessObject subclass must be able to create a DataObject that can be used as a specified output. This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. So DataObject::DisconnectPipeline eventually calls ProcessObject::MakeOutput. Note that MakeOutput always returns a itkSmartPointer to a DataObject. ImageSource and MeshSource override this method to create the correct type of image and mesh respectively. If a filter has multiple outputs of different types, then that filter must provide an implementation of MakeOutput().
Reimplemented from itk::ProcessObject.
|
overrideprotectedvirtual |
Make a DataObject of the correct type to used as the specified output.
Every ProcessObject subclass must be able to create a DataObject that can be used as a specified output. This method is automatically called when DataObject::DisconnectPipeline() is called. DataObject::DisconnectPipeline, disconnects a data object from being an output of its current source. When the data object is disconnected, the ProcessObject needs to construct a replacement output data object so that the ProcessObject is in a valid state. So DataObject::DisconnectPipeline eventually calls ProcessObject::MakeOutput. Note that MakeOutput always returns a itkSmartPointer to a DataObject. ImageSource and MeshSource override this method to create the correct type of image and mesh respectively. If a filter has multiple outputs of different types, then that filter must provide an implementation of MakeOutput().
Reimplemented from itk::ProcessObject.
|
static |
standard New() method support
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::LightObject.
|
virtual |
Method to Set/Get the input Histogram
Reimplemented from itk::ProcessObject.
void itk::Statistics::HistogramToTextureFeaturesFilter< THistogram >::SetInput | ( | const HistogramType * | histogram | ) |
|
private |
Definition at line 261 of file itkHistogramToTextureFeaturesFilter.h.