Package qupath.lib.analysis.stats
Class StatisticsHelper
java.lang.Object
qupath.lib.analysis.stats.StatisticsHelper
Static methods for computing statistics from images, with or without a corresponding labeled image.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic RunningStatisticscomputeRunningStatistics(double[] values) Create a RunningStatistics object using all the values from a specified array.static RunningStatisticsCompute running statistics using all pixels from a SimpleImage.static voidcomputeRunningStatistics(SimpleImage img, SimpleImage imgLabels, List<RunningStatistics> statsList) Calculate RunningStatistics for each label > 0 in an image, up to a maximum ofstatsList.size().static List<RunningStatistics> createRunningStatisticsList(int n) Create a list of n (empty) RunningStatistics objects.static double[]getQuartiles(double[] scores) Determine thresholds for dividing an array of double values into quartiles.static double[]getTertiles(double[] scores) Determine thresholds for dividing an array of double values into tertiles.static voidupdateRunningStatistics(RunningStatistics stats, SimpleImage img) Add all pixels from a SimpleImage to an existing RunningStatistics object.
- 
Constructor Details- 
StatisticsHelperpublic StatisticsHelper()
 
- 
- 
Method Details- 
computeRunningStatisticsCompute running statistics using all pixels from a SimpleImage.- Parameters:
- img-
- Returns:
 
- 
updateRunningStatisticsAdd all pixels from a SimpleImage to an existing RunningStatistics object.- Parameters:
- stats-
- img-
 
- 
createRunningStatisticsListCreate a list of n (empty) RunningStatistics objects.- Parameters:
- n-
- Returns:
 
- 
computeRunningStatisticsCreate a RunningStatistics object using all the values from a specified array.- Parameters:
- values-
- Returns:
 
- 
computeRunningStatisticspublic static void computeRunningStatistics(SimpleImage img, SimpleImage imgLabels, List<RunningStatistics> statsList) Calculate RunningStatistics for each label > 0 in an image, up to a maximum ofstatsList.size().The statistics for pixels in imgcorresponding to integer valuelabelinimgLabelsare stored withinstatsList.get(label-1).- Parameters:
- img-
- imgLabels-
- statsList-
 
- 
getQuartilespublic static double[] getQuartiles(double[] scores) Determine thresholds for dividing an array of double values into quartiles.NaNs are effectively removed first, however the input array is left unchanged so there is no need to duplicate it first (i.e. it is duplicated within this method anyway). Depending upon the number of non-NaN values in the input array, linear interpolation may be used to obtain the split points. - Parameters:
- scores-
- Returns:
- Array containing three values, corresponding to the split points.
 
- 
getTertilespublic static double[] getTertiles(double[] scores) Determine thresholds for dividing an array of double values into tertiles.NaNs are effectively removed first, however the input array is left unchanged so there is no need to duplicate it in advance (i.e. it is duplicated within this method anyway). Depending upon the number of non-NaN values in the input array, linear interpolation may be used to obtain the split points. - Parameters:
- scores-
- Returns:
- Array containing two values, corresponding to the split points.
 
 
-