ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkLabelStatisticsImageFilter.h>
Given an intensity image and a label map, compute min, max, variance and mean of the pixels associated with each label or segment.
LabelStatisticsImageFilter computes the minimum, maximum, sum, mean, median, variance and sigma of regions of an intensity image, where the regions are defined via a label map (a second input). The label image should be integral type. The filter needs all of its input image. It behaves as a filter with an input and output. Thus it can be inserted in a pipline with other filters and the statistics will only be recomputed if a downstream filter changes.
Optionally, the filter also computes intensity histograms on each object. If histograms are enabled, a median intensity value can also be computed, although its accuracy is limited to the bin width of the histogram. If histograms are not enabled, the median returns zero.
The filter passes its intensity input through unmodified. The filter is threaded.
Definition at line 59 of file itkLabelStatisticsImageFilter.h.
Classes | |
class | LabelStatistics |
Public Types | |
using | BoundingBoxType = std::vector< IndexValueType > |
using | ConstPointer = SmartPointer< const Self > |
using | DataObjectPointer = typename DataObject::Pointer |
using | HistogramPointer = typename HistogramType::Pointer |
using | HistogramType = itk::Statistics::Histogram< RealType > |
using | IndexType = typename TInputImage::IndexType |
using | InputImagePointer = typename TInputImage::Pointer |
using | LabelImagePointer = typename TLabelImage::Pointer |
using | LabelImageType = TLabelImage |
using | LabelIndexType = typename TLabelImage::IndexType |
using | LabelPixelType = typename TLabelImage::PixelType |
using | LabelRegionType = typename TLabelImage::RegionType |
using | LabelSizeType = typename TLabelImage::SizeType |
using | MapConstIterator = typename MapType::const_iterator |
using | MapIterator = typename MapType::iterator |
using | MapSizeType = IdentifierType |
using | MapType = std::unordered_map< LabelPixelType, LabelStatistics > |
using | PixelType = typename TInputImage::PixelType |
using | Pointer = SmartPointer< Self > |
using | RealObjectType = SimpleDataObjectDecorator< RealType > |
using | RealType = typename NumericTraits< PixelType >::RealType |
using | RegionType = typename TInputImage::RegionType |
using | Self = LabelStatisticsImageFilter |
using | SizeType = typename TInputImage::SizeType |
using | Superclass = ImageToImageFilter< TInputImage, TInputImage > |
using | ValidLabelValuesContainerType = std::vector< LabelPixelType > |
Public Types inherited from itk::ImageToImageFilter< TInputImage, TInputImage > | |
using | ConstPointer = SmartPointer< const Self > |
using | InputImageConstPointer = typename InputImageType::ConstPointer |
using | InputImagePixelType = typename InputImageType::PixelType |
using | InputImagePointer = typename InputImageType::Pointer |
using | InputImageRegionType = typename InputImageType::RegionType |
using | InputImageType = TInputImage |
using | OutputImagePixelType = typename Superclass::OutputImagePixelType |
using | OutputImageRegionType = typename Superclass::OutputImageRegionType |
using | Pointer = SmartPointer< Self > |
using | Self = ImageToImageFilter |
using | Superclass = ImageSource< TInputImage > |
Public Types inherited from itk::ImageSource< TInputImage > | |
using | ConstPointer = SmartPointer< const Self > |
using | DataObjectIdentifierType = Superclass::DataObjectIdentifierType |
using | DataObjectPointer = DataObject::Pointer |
using | DataObjectPointerArraySizeType = Superclass::DataObjectPointerArraySizeType |
using | OutputImagePixelType = typename OutputImageType::PixelType |
using | OutputImagePointer = typename OutputImageType::Pointer |
using | OutputImageRegionType = typename OutputImageType::RegionType |
using | OutputImageType = TInputImage |
using | Pointer = SmartPointer< Self > |
using | Self = ImageSource |
using | Superclass = ProcessObject |
Public Types inherited from itk::ProcessObject | |
using | ConstPointer = SmartPointer< const Self > |
using | DataObjectIdentifierType = DataObject::DataObjectIdentifierType |
using | DataObjectPointer = DataObject::Pointer |
using | DataObjectPointerArray = std::vector< DataObjectPointer > |
using | DataObjectPointerArraySizeType = DataObjectPointerArray::size_type |
using | MultiThreaderType = MultiThreaderBase |
using | NameArray = std::vector< DataObjectIdentifierType > |
using | Pointer = SmartPointer< Self > |
using | Self = ProcessObject |
using | Superclass = Object |
Public Types inherited from itk::Object | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = Object |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Static Public Attributes | |
static constexpr unsigned int | ImageDimension = TInputImage::ImageDimension |
Static Public Attributes inherited from itk::ImageToImageFilter< TInputImage, TInputImage > | |
static constexpr unsigned int | InputImageDimension |
static constexpr unsigned int | OutputImageDimension |
Static Public Attributes inherited from itk::ImageSource< TInputImage > | |
static constexpr unsigned int | OutputImageDimension |
Private Member Functions | |
void | MergeMap (MapType &, MapType &) const |
Private Attributes | |
MapType | m_LabelStatistics |
RealType | m_LowerBound |
std::mutex | m_Mutex |
HistogramType::SizeType | m_NumBins |
RealType | m_UpperBound |
bool | m_UseHistograms |
ValidLabelValuesContainerType | m_ValidLabelValues |
Additional Inherited Members | |
Protected Types inherited from itk::ImageToImageFilter< TInputImage, TInputImage > | |
using | InputToOutputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::OutputImageDimension, Self::InputImageDimension > |
using | OutputToInputRegionCopierType = ImageToImageFilterDetail::ImageRegionCopier< Self::InputImageDimension, Self::OutputImageDimension > |
Static Protected Member Functions inherited from itk::ImageSource< TInputImage > | |
static const ImageRegionSplitterBase * | GetGlobalDefaultSplitter () |
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION | ThreaderCallback (void *arg) |
Protected Attributes inherited from itk::ImageSource< TInputImage > | |
bool | m_DynamicMultiThreading |
Protected Attributes inherited from itk::ProcessObject | |
TimeStamp | m_OutputInformationMTime |
bool | m_Updating |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::BoundingBoxType = std::vector< IndexValueType > |
Bounding Box-related type alias
Definition at line 105 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::ConstPointer = SmartPointer< const Self > |
Definition at line 69 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::DataObjectPointer = typename DataObject::Pointer |
Smart Pointer type to a DataObject.
Definition at line 99 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::HistogramPointer = typename HistogramType::Pointer |
Definition at line 109 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::HistogramType = itk::Statistics::Histogram< RealType > |
Histogram-related type alias
Definition at line 108 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::IndexType = typename TInputImage::IndexType |
Definition at line 81 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::InputImagePointer = typename TInputImage::Pointer |
Image related type alias.
Definition at line 78 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelImagePointer = typename TLabelImage::Pointer |
Definition at line 86 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelImageType = TLabelImage |
Label image related type alias.
Definition at line 85 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelIndexType = typename TLabelImage::IndexType |
Definition at line 89 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelPixelType = typename TLabelImage::PixelType |
Definition at line 90 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelRegionType = typename TLabelImage::RegionType |
Definition at line 87 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::LabelSizeType = typename TLabelImage::SizeType |
Definition at line 88 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::MapConstIterator = typename MapType::const_iterator |
Definition at line 237 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::MapIterator = typename MapType::iterator |
Definition at line 236 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::MapSizeType = IdentifierType |
Definition at line 238 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::MapType = std::unordered_map< LabelPixelType, LabelStatistics > |
Type of the map used to store data per label
Definition at line 235 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::PixelType = typename TInputImage::PixelType |
Definition at line 82 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::Pointer = SmartPointer< Self > |
Definition at line 68 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::RealObjectType = SimpleDataObjectDecorator< RealType > |
Type of DataObjects used for scalar outputs
Definition at line 102 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::RealType = typename NumericTraits< PixelType >::RealType |
Type to use for computations.
Definition at line 96 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::RegionType = typename TInputImage::RegionType |
Definition at line 79 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::Self = LabelStatisticsImageFilter |
Standard Self type alias
Definition at line 66 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::SizeType = typename TInputImage::SizeType |
Definition at line 80 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::Superclass = ImageToImageFilter< TInputImage, TInputImage > |
Definition at line 67 of file itkLabelStatisticsImageFilter.h.
using itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::ValidLabelValuesContainerType = std::vector<LabelPixelType> |
Type of the container used to store valid label values
Definition at line 241 of file itkLabelStatisticsImageFilter.h.
|
protected |
|
overrideprotecteddefault |
|
overrideprotectedvirtual |
Do final mean and variance computation from data accumulated in threads.
Reimplemented from itk::ImageSource< TInputImage >.
|
overrideprotectedvirtual |
Pass the input through unmodified. Do this by Grafting in the AllocateOutputs method.
Reimplemented from itk::ImageSource< TInputImage >.
|
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::Object.
|
overrideprotected |
|
overrideprotectedvirtual |
Give the process object a chance to indictate that it will produce more output than it was requested to produce. For example, many imaging filters must compute the entire output at once or can only produce output in complete slices. Such filters cannot handle smaller requested regions. These filters must provide an implementation of this method, setting the output requested region to the size they will produce. By default, a process object does not modify the size of the output requested region.
Reimplemented from itk::ProcessObject.
BoundingBoxType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetBoundingBox | ( | LabelPixelType | label | ) | const |
Return the computed bounding box for a label. A vector of minIndex, maxIndex pairs for each axis. The intervals include the endpoints.
MapSizeType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetCount | ( | LabelPixelType | label | ) | const |
Return the number of pixels for a label.
HistogramPointer itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetHistogram | ( | LabelPixelType | label | ) | const |
Return the histogram for a label
|
inline |
Get the label image
Definition at line 262 of file itkLabelStatisticsImageFilter.h.
References itk::ProcessObject::GetInput().
RealType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetMaximum | ( | LabelPixelType | label | ) | const |
Return the computed Maximum for a label.
RealType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetMean | ( | LabelPixelType | label | ) | const |
Return the computed Mean for a label.
RealType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetMedian | ( | LabelPixelType | label | ) | const |
Return the computed Median for a label. Requires histograms to be enabled!
RealType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetMinimum | ( | LabelPixelType | label | ) | const |
Return the computed Minimum for a label.
|
virtual |
Runtime information support.
Reimplemented from itk::ImageToImageFilter< TInputImage, TInputImage >.
|
inline |
Definition at line 280 of file itkLabelStatisticsImageFilter.h.
|
inline |
Get the number of labels used
Definition at line 275 of file itkLabelStatisticsImageFilter.h.
RegionType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetRegion | ( | LabelPixelType | label | ) | const |
Return the computed region.
RealType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetSigma | ( | LabelPixelType | label | ) | const |
Return the computed Standard Deviation for a label.
RealType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetSum | ( | LabelPixelType | label | ) | const |
Return the compute Sum for a label.
|
virtual |
|
inlinevirtual |
Definition at line 249 of file itkLabelStatisticsImageFilter.h.
RealType itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::GetVariance | ( | LabelPixelType | label | ) | const |
Return the computed Variance for a label.
|
inline |
Does the specified label exist? Can only be called after a call a call to Update().
Definition at line 269 of file itkLabelStatisticsImageFilter.h.
|
private |
|
static |
Method for creation through the object factory.
|
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::ProcessObject.
void itk::LabelStatisticsImageFilter< TInputImage, TLabelImage >::SetHistogramParameters | ( | const int | numBins, |
RealType | lowerBound, | ||
RealType | upperBound | ||
) |
specify Histogram parameters
|
inline |
Set the label image
Definition at line 255 of file itkLabelStatisticsImageFilter.h.
|
virtual |
|
virtual |
|
virtual |
|
static |
Image related type alias.
Definition at line 93 of file itkLabelStatisticsImageFilter.h.
|
private |
Definition at line 354 of file itkLabelStatisticsImageFilter.h.
|
private |
Definition at line 361 of file itkLabelStatisticsImageFilter.h.
|
private |
Definition at line 364 of file itkLabelStatisticsImageFilter.h.
|
private |
Definition at line 359 of file itkLabelStatisticsImageFilter.h.
|
private |
Definition at line 362 of file itkLabelStatisticsImageFilter.h.
|
private |
Definition at line 357 of file itkLabelStatisticsImageFilter.h.
|
private |
Definition at line 355 of file itkLabelStatisticsImageFilter.h.