Class VoxelStatisticsFromHistogram

Object
VoxelStatisticsFromHistogram
All Implemented Interfaces:
VoxelStatistics

public class VoxelStatisticsFromHistogram extends Object implements VoxelStatistics
Calculates statistics from a Histogram of voxel intensities.
Author:
Owen Feehan
  • Constructor Details

    • VoxelStatisticsFromHistogram

      public VoxelStatisticsFromHistogram(Histogram histogram)
      Creates a new VoxelStatisticsFromHistogram instance.
      Parameters:
      histogram - The histogram to calculate statistics from.
  • Method Details

    • size

      public long size()
      Description copied from interface: VoxelStatistics
      The total count.
      Specified by:
      size in interface VoxelStatistics
      Returns:
      the total number of voxels.
    • sum

      public long sum()
      Description copied from interface: VoxelStatistics
      The sum of all voxel values.
      Specified by:
      sum in interface VoxelStatistics
      Returns:
      the sum.
    • sumOfSquares

      public long sumOfSquares()
      Description copied from interface: VoxelStatistics
      The sum of the square of all voxel values.
      Specified by:
      sumOfSquares in interface VoxelStatistics
      Returns:
      the sum-of-squares.
    • threshold

      public VoxelStatistics threshold(RelationToThreshold relationToThreshold)
      Description copied from interface: VoxelStatistics
      Derives statistics only of the voxels that satisfy a condition, relative to a threshold.
      Specified by:
      threshold in interface VoxelStatistics
      Parameters:
      relationToThreshold - the condition that must be satisfied for voxels to be included in the statistics.
      Returns:
      a new VoxelStatistics pertaining only to the voxels that satisfy the condition.
    • countThreshold

      public long countThreshold(RelationToThreshold relationToThreshold)
      Description copied from interface: VoxelStatistics
      Counts the number of voxels that exist, relative to a threshold.

      This methods conveniently avoids overhead with assigning new memory when counting.

      Specified by:
      countThreshold in interface VoxelStatistics
      Parameters:
      relationToThreshold - defines the relation to a threshold e.g. above a number, or below a number.
      Returns:
      the total number of voxels that fulfill relationToThreshold.
    • quantile

      public double quantile(double quantile) throws OperationFailedException
      Description copied from interface: VoxelStatistics
      The voxel value corresponding to a particular quantile.
      Specified by:
      quantile in interface VoxelStatistics
      Parameters:
      quantile - the quantile, which should always be >= 0 and <= 1.
      Returns:
      the voxel value corresponding to the quantile.
      Throws:
      OperationFailedException - if quantile is out-of-range.
    • histogram

      public Histogram histogram()
      Description copied from interface: VoxelStatistics
      A Histogram of all voxel values.
      Specified by:
      histogram in interface VoxelStatistics
      Returns:
      a histogram.