Class LabelStatisticsImageFilter


public class LabelStatisticsImageFilter extends ImageFilter
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 pipeline 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. This filter is automatically multi-threaded and can stream its input when NumberOfStreamDivisions is set to more than Statistics are independently computed for each streamed and threaded region then merged. See: itk::LabelStatisticsImageFilter for the Doxygen on the original ITK class. C++ includes: sitkLabelStatisticsImageFilter.h
  • Constructor Details

    • LabelStatisticsImageFilter

      protected LabelStatisticsImageFilter(long cPtr, boolean cMemoryOwn)
    • LabelStatisticsImageFilter

      public LabelStatisticsImageFilter()
      itk::simple::LabelStatisticsImageFilter::LabelStatisticsImageFilter() Default Constructor that takes no arguments and initializes default parameters
  • Method Details

    • getCPtr

      protected static long getCPtr(LabelStatisticsImageFilter obj)
    • swigRelease

      protected static long swigRelease(LabelStatisticsImageFilter obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class ImageFilter
    • delete

      public void delete()
      virtual itk::simple::LabelStatisticsImageFilter::~LabelStatisticsImageFilter() Destructor
      Overrides:
      delete in class ImageFilter
    • setUseHistograms

      public void setUseHistograms(boolean UseHistograms)
      Self& itk::simple::LabelStatisticsImageFilter::SetUseHistograms(bool UseHistograms)
    • useHistogramsOn

      public void useHistogramsOn()
      Self& itk::simple::LabelStatisticsImageFilter::UseHistogramsOn() Set the value of UseHistograms to true or false respectfully.
    • useHistogramsOff

      public void useHistogramsOff()
      Self& itk::simple::LabelStatisticsImageFilter::UseHistogramsOff()
    • getUseHistograms

      public boolean getUseHistograms()
      bool itk::simple::LabelStatisticsImageFilter::GetUseHistograms() const
    • getMinimum

      public double getMinimum(int label)
      double itk::simple::LabelStatisticsImageFilter::GetMinimum(int64_t label) const Return the computed Minimum for a label. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getMaximum

      public double getMaximum(int label)
      double itk::simple::LabelStatisticsImageFilter::GetMaximum(int64_t label) const Return the computed Maximum for a label. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getMean

      public double getMean(int label)
      double itk::simple::LabelStatisticsImageFilter::GetMean(int64_t label) const Return the computed Mean for a label. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getMedian

      public double getMedian(int label)
      double itk::simple::LabelStatisticsImageFilter::GetMedian(int64_t label) const Return the computed Median for a label. Requires histograms to be enabled! This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getSigma

      public double getSigma(int label)
      double itk::simple::LabelStatisticsImageFilter::GetSigma(int64_t label) const Return the computed Standard Deviation for a label. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getVariance

      public double getVariance(int label)
      double itk::simple::LabelStatisticsImageFilter::GetVariance(int64_t label) const Return the computed Variance for a label. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getSum

      public double getSum(int label)
      double itk::simple::LabelStatisticsImageFilter::GetSum(int64_t label) const Return the compute Sum for a label. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getCount

      public long getCount(int label)
      uint64_t itk::simple::LabelStatisticsImageFilter::GetCount(int64_t label) const Return the number of pixels for a label. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getBoundingBox

      public VectorInt32 getBoundingBox(int label)
      std::vector<int> itk::simple::LabelStatisticsImageFilter::GetBoundingBox(int64_t label) const Return the computed bounding box for a label. A vector of minIndex, maxIndex pairs for each axis. The intervals include the endpoints. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getRegion

      public VectorUInt32 getRegion(int label)
      std::vector<unsigned int> itk::simple::LabelStatisticsImageFilter::GetRegion(int64_t label) const Return the computed region. This is an active measurement. It may be accessed while the filter is being executing in command call-backs and can be accessed after execution.
    • getLabels

      public VectorInt64 getLabels()
      std::vector<int64_t> itk::simple::LabelStatisticsImageFilter::GetLabels() const This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.
    • getName

      public String getName()
      std::string itk::simple::LabelStatisticsImageFilter::GetName() const Name of this class
      Overrides:
      getName in class ProcessObject
    • toString

      public String toString()
      std::string itk::simple::LabelStatisticsImageFilter::ToString() const Print ourselves out
      Overrides:
      toString in class ProcessObject
    • execute

      public void execute(Image image, Image labelImage)
      void itk::simple::LabelStatisticsImageFilter::Execute(const Image &image, const Image &labelImage) Execute the filter on the input image
    • hasLabel

      public boolean hasLabel(int label)
      bool itk::simple::LabelStatisticsImageFilter::HasLabel(int64_t label) Does the specified label exist? Can only be called after a call a call to Update().
    • getNumberOfLabels

      public long getNumberOfLabels()
      uint64_t itk::simple::LabelStatisticsImageFilter::GetNumberOfLabels() Return the number of labels after execution .