Class VoxelStatisticsCombined
Object
org.anchoranalysis.image.voxel.statistics.VoxelStatisticsCombined
- All Implemented Interfaces:
VoxelStatistics
public class VoxelStatisticsCombined extends Object implements VoxelStatistics
Aggregates statistics of a list of
VoxelStatistics as if they were one.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description VoxelStatisticsCombined() -
Method Summary
Modifier and Type Method Description voidadd(VoxelStatistics element)Adds an element.longcountThreshold(RelationToThreshold relationToThreshold)Counts the number of voxels that exist, relative to a threshold.Histogramhistogram()AHistogramof all voxel values.doublequantile(double quantile)The voxel value corresponding to a particular quantile.longsize()The total count.longsum()The sum of all voxel values.longsumOfSquares()The sum of the square of all voxel values.VoxelStatisticsthreshold(RelationToThreshold relationToThreshold)Derives statistics only of the voxels that satisfy a condition, relative to a threshold.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.anchoranalysis.image.voxel.statistics.VoxelStatistics
mean, stdDev, variance
-
Constructor Details
-
VoxelStatisticsCombined
public VoxelStatisticsCombined()
-
-
Method Details
-
add
Adds an element.- Parameters:
element- an element to add.
-
size
public long size()Description copied from interface:VoxelStatisticsThe total count.- Specified by:
sizein interfaceVoxelStatistics- Returns:
- the total number of voxels.
-
sum
public long sum()Description copied from interface:VoxelStatisticsThe sum of all voxel values.- Specified by:
sumin interfaceVoxelStatistics- Returns:
- the sum.
-
sumOfSquares
public long sumOfSquares()Description copied from interface:VoxelStatisticsThe sum of the square of all voxel values.- Specified by:
sumOfSquaresin interfaceVoxelStatistics- Returns:
- the sum-of-squares.
-
threshold
Description copied from interface:VoxelStatisticsDerives statistics only of the voxels that satisfy a condition, relative to a threshold.- Specified by:
thresholdin interfaceVoxelStatistics- Parameters:
relationToThreshold- the condition that must be satisfied for voxels to be included in the statistics.- Returns:
- a new
VoxelStatisticspertaining only to the voxels that satisfy the condition.
-
countThreshold
Description copied from interface:VoxelStatisticsCounts the number of voxels that exist, relative to a threshold.This methods conveniently avoids overhead with assigning new memory when counting.
- Specified by:
countThresholdin interfaceVoxelStatistics- 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)Description copied from interface:VoxelStatisticsThe voxel value corresponding to a particular quantile.- Specified by:
quantilein interfaceVoxelStatistics- Parameters:
quantile- the quantile, which should always be>= 0and<= 1.- Returns:
- the voxel value corresponding to the quantile.
-
histogram
Description copied from interface:VoxelStatisticsAHistogramof all voxel values.- Specified by:
histogramin interfaceVoxelStatistics- Returns:
- a histogram.
- Throws:
OperationFailedException- if a histogram cannot be created.
-