public class RandError extends Metrics
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
originalLabels, proposedLabels, verbose
Constructor and Description |
---|
RandError(ij.ImagePlus originalLabels,
ij.ImagePlus proposedLabels)
Initialize Rand error metric
|
Modifier and Type | Method and Description |
---|---|
static double |
adaptedRandIndex3D(ij.ImagePlus originalLabels,
ij.ImagePlus proposedLabels)
Calculate the Rand index between to 3D clusters, as described by
William M.
|
static double |
adaptedRandIndexFScore3D(ij.ImagePlus originalLabels,
ij.ImagePlus proposedLabels)
Calculate the F-score of the Rand index between to 3D clusters, as described by
William M.
|
static ClassificationStatistics |
adaptedRandIndexStats3D(ij.ImagePlus originalLabels,
ij.ImagePlus proposedLabels)
Calculate the Rand index between to 3D clusters, as described by
William M.
|
static double[] |
adaptedRandIndexStats3DN2(ij.ImagePlus segA,
ij.ImagePlus segB)
Calculate the Rand index stats between to 3D clusters, as described by
William M.
|
double |
classicRandIndex(ij.process.ShortProcessor cluster1,
ij.process.ShortProcessor cluster2)
Calculate the Rand index between to clusters, as described by
William M.
|
double |
foregroundRestrictedRandError(ij.process.ImageProcessor label,
ij.process.ImageProcessor proposal,
double binaryThreshold)
Calculate the foreground-restricted Rand error between some 2D original
labels and the corresponding proposed labels.
|
double |
foregroundRestrictedRandIndex(ij.process.ShortProcessor cluster1,
ij.process.ShortProcessor cluster2)
Calculate the Rand index between to clusters, as described by
William M.
|
double[] |
getForegroundRestrictedGroundTruthDisagreements(ij.process.ShortProcessor cluster1,
ij.process.ShortProcessor cluster2)
Get foreground-restricted disagreements between prediction and
ground truth labels with N^2 normalization (mergers).
|
double |
getForegroundRestrictedMetricValue(double binaryThreshold)
Calculate the foreground-restricted Rand error in 2D between some
original labels and the corresponding proposed labels.
|
double[] |
getForegroundRestrictedPredictionDisagreements(ij.process.ShortProcessor cluster1,
ij.process.ShortProcessor cluster2)
Get foreground-restricted disagreements between ground truth and
prediction labels with N^2 normalization (splits).
|
ClassificationStatistics |
getForegroundRestrictedRandAfterThinningStats(double binaryThreshold,
boolean perSliceAverage)
Calculate the foreground-restricted Rand score (N^2 normalization) and
its derived statistics in 2D between some original labels and the
corresponding proposed labels after border thinning.
|
ArrayList<ClassificationStatistics> |
getForegroundRestrictedRandAfterThinningStats(double minThreshold,
double maxThreshold,
double stepThreshold,
boolean perSliceAverage)
Calculate the precision-recall values based on the foreground-restricted
Rand score between some 2D original labels and the corresponding
proposed labels (after border thinning).
|
Callable<ClassificationStatistics> |
getForegroundRestrictedRandAfterThinningStatsConcurrent(ij.process.ImageProcessor image1,
ij.process.ImageProcessor image2,
double binaryThreshold)
Get foreground-restricted Rand score value and derived statistics
between two images in a concurrent way (to be submitted to an Executor
Service).
|
ClassificationStatistics |
getForegroundRestrictedRandAfterThinningStatsN2(ij.process.ImageProcessor label,
ij.process.ImageProcessor proposal,
double binaryThreshold)
Calculate the foreground-restricted Rand precision and recall between
some 2D original labels and the corresponding proposed labels with N^2
normalization.
|
Callable<Double> |
getForegroundRestrictedRandErrorConcurrent(ij.process.ImageProcessor image1,
ij.process.ImageProcessor image2,
double binaryThreshold)
Get foreground-restricted Rand error between two images in a concurrent
way (to be submitted to an Executor Service).
|
double |
getForegroundRestrictedRandIndexMaximalFScore(double minThreshold,
double maxThreshold,
double stepThreshold)
Get the best F-score of the foreground-restricted Rand index over a set
of thresholds.
|
ClassificationStatistics |
getForegroundRestrictedRandIndexStats(double binaryThreshold)
Calculate the foreground-restricted Rand error (N^2 normalization) and
its derived statistics in 2D between some original labels and the
corresponding proposed labels.
|
ArrayList<ClassificationStatistics> |
getForegroundRestrictedRandIndexStats(double minThreshold,
double maxThreshold,
double stepThreshold)
Calculate the precision-recall values based on the foreground-restricted
Rand index between some 2D original labels and the corresponding
proposed labels.
|
Callable<ClassificationStatistics> |
getForegroundRestrictedRandIndexStatsConcurrent(ij.process.ImageProcessor image1,
ij.process.ImageProcessor image2,
double binaryThreshold)
Get foreground-restricted Rand index value and derived statistics
between two images in a concurrent way (to be submitted to an Executor
Service).
|
ClassificationStatistics |
getForegroundRestrictedRandIndexStatsN2(ij.process.ImageProcessor label,
ij.process.ImageProcessor proposal,
double binaryThreshold)
Calculate the foreground-restricted Rand precision and recall between
some 2D original labels and the corresponding proposed labels with N^2
normalization.
|
ClassificationStatistics |
getForegroundRestrictedRandIndexStatsN2(ij.process.ShortProcessor cluster1,
ij.process.ShortProcessor cluster2)
Get foreground-restricted Rand statistics (precision and recall) with
N^2 normalization.
|
ClassificationStatistics[] |
getForegroundRestrictedRandIndexStatsPerSlice(double binaryThreshold)
Calculate the foreground-restricted Rand index (N^2 normalization) and
its derived statistics in 2D between some original labels and the
corresponding proposed labels.
|
double |
getMaximalVRandAfterThinning(double minThreshold,
double maxThreshold,
double stepThreshold,
boolean perSliceAverage)
Get the best V_Rand after thinning over a set of thresholds.
|
double |
getMetricValue(double binaryThreshold)
Calculate the Rand error in 2D between some original labels
and the corresponding proposed labels.
|
Callable<Double> |
getRandErrorConcurrent(ij.process.ImageProcessor image1,
ij.process.ImageProcessor image2,
double binaryThreshold)
Get standard Rand error between two images in a concurrent way
(to be submitted to an Executor Service).
|
double |
getRandIndexMaximalFScore(double minThreshold,
double maxThreshold,
double stepThreshold)
Get the best F-score of the standard Rand index over a set of thresholds.
|
ClassificationStatistics |
getRandIndexStats(double binaryThreshold)
Calculate the standard Rand index and its derived statistics in 2D between
some original labels and the corresponding proposed labels.
|
ArrayList<ClassificationStatistics> |
getRandIndexStats(double minThreshold,
double maxThreshold,
double stepThreshold)
Calculate the precision-recall values based on standard Rand index
between some 2D original labels and the corresponding proposed labels.
|
ClassificationStatistics |
getRandIndexStats(ij.process.ShortProcessor cluster1,
ij.process.ShortProcessor cluster2)
Calculate the standard Rand index between to clusters, as described by
William M.
|
Callable<ClassificationStatistics> |
getRandIndexStatsConcurrent(ij.process.ImageProcessor image1,
ij.process.ImageProcessor image2,
double binaryThreshold)
Get standard Rand index value and derived statistics between two images
in a concurrent way (to be submitted to an Executor Service).
|
static void |
main(String[] args)
Main method for calculating the Rand error metrics
from the command line
|
double |
randError(ij.process.ImageProcessor label,
ij.process.ImageProcessor proposal,
double binaryThreshold)
Calculate the standard Rand error between some 2D original labels
and the corresponding proposed labels.
|
ClassificationStatistics |
randIndexStats(ij.process.ImageProcessor label,
ij.process.ImageProcessor proposal,
double binaryThreshold)
Calculate the standard Rand index between some 2D original labels
and the corresponding proposed labels.
|
void |
setVerboseMode(boolean verbose)
Set verbose mode
|
getMinimumMetricValue
public RandError(ij.ImagePlus originalLabels, ij.ImagePlus proposedLabels)
originalLabels
- original labels (single 2D image or stack)proposedLabels
- proposed new labels (single 2D image or stack of the same as as the original labels)public double getMetricValue(double binaryThreshold)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
getMetricValue
in class Metrics
binaryThreshold
- threshold value to binarize proposal (larger than 0 and smaller than 1)public double getForegroundRestrictedMetricValue(double binaryThreshold)
binaryThreshold
- threshold value to binarize proposal (larger than 0 and smaller than 1)public ClassificationStatistics getRandIndexStats(double binaryThreshold)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
binaryThreshold
- threshold value to binarize proposal (larger than 0 and smaller than 1)public ClassificationStatistics getForegroundRestrictedRandIndexStats(double binaryThreshold)
binaryThreshold
- threshold value to binarize proposal (larger than 0 and smaller than 1)public ClassificationStatistics getForegroundRestrictedRandAfterThinningStats(double binaryThreshold, boolean perSliceAverage)
binaryThreshold
- threshold value to binarize proposal (larger than 0 and smaller than 1)perSliceAverage
- flag to return F-score value averaged per slice (macro-averaged F-score)public ClassificationStatistics[] getForegroundRestrictedRandIndexStatsPerSlice(double binaryThreshold)
binaryThreshold
- threshold value to binarize proposal ([0 1])public ArrayList<ClassificationStatistics> getRandIndexStats(double minThreshold, double maxThreshold, double stepThreshold)
@article{Rand71,label author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
minThreshold
- minimum threshold value to binarize the input imagesmaxThreshold
- maximum threshold value to binarize the input imagesstepThreshold
- threshold step value to use during binarizationpublic ArrayList<ClassificationStatistics> getForegroundRestrictedRandIndexStats(double minThreshold, double maxThreshold, double stepThreshold)
minThreshold
- minimum threshold value to binarize the input imagesmaxThreshold
- maximum threshold value to binarize the input imagesstepThreshold
- threshold step value to use during binarizationpublic ArrayList<ClassificationStatistics> getForegroundRestrictedRandAfterThinningStats(double minThreshold, double maxThreshold, double stepThreshold, boolean perSliceAverage)
minThreshold
- minimum threshold value to binarize the input imagesmaxThreshold
- maximum threshold value to binarize the input imagesstepThreshold
- threshold step value to use during binarizationperSliceAverage
- flag to return values averaging per slice (macro-average)public Callable<Double> getRandErrorConcurrent(ij.process.ImageProcessor image1, ij.process.ImageProcessor image2, double binaryThreshold)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
image1
- first imageimage2
- second imagebinaryThreshold
- threshold to apply to both imagespublic Callable<Double> getForegroundRestrictedRandErrorConcurrent(ij.process.ImageProcessor image1, ij.process.ImageProcessor image2, double binaryThreshold)
image1
- ground truth 2D imageimage2
- proposal 2D imagebinaryThreshold
- threshold to apply to both imagespublic Callable<ClassificationStatistics> getRandIndexStatsConcurrent(ij.process.ImageProcessor image1, ij.process.ImageProcessor image2, double binaryThreshold)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
image1
- first imageimage2
- second imagebinaryThreshold
- threshold to apply to both imagespublic Callable<ClassificationStatistics> getForegroundRestrictedRandIndexStatsConcurrent(ij.process.ImageProcessor image1, ij.process.ImageProcessor image2, double binaryThreshold)
image1
- ground-truth imageimage2
- proposed labels imagebinaryThreshold
- threshold to apply to both imagespublic Callable<ClassificationStatistics> getForegroundRestrictedRandAfterThinningStatsConcurrent(ij.process.ImageProcessor image1, ij.process.ImageProcessor image2, double binaryThreshold)
image1
- ground-truth imageimage2
- proposed labels imagebinaryThreshold
- threshold to apply to both imagespublic double randError(ij.process.ImageProcessor label, ij.process.ImageProcessor proposal, double binaryThreshold)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
label
- 2D image with the original labelsproposal
- 2D image with the proposed labelsbinaryThreshold
- threshold value to binarize the input imagespublic double foregroundRestrictedRandError(ij.process.ImageProcessor label, ij.process.ImageProcessor proposal, double binaryThreshold)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
label
- 2D image with the original labelsproposal
- 2D image with the proposed labelsbinaryThreshold
- threshold value to binarize the input imagespublic ClassificationStatistics randIndexStats(ij.process.ImageProcessor label, ij.process.ImageProcessor proposal, double binaryThreshold)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
label
- 2D image with the original labelsproposal
- 2D image with the proposed labelsbinaryThreshold
- threshold value to binarize the input imagespublic ClassificationStatistics getForegroundRestrictedRandIndexStatsN2(ij.process.ImageProcessor label, ij.process.ImageProcessor proposal, double binaryThreshold)
label
- 2D image with the original (ground truth) binary labelsproposal
- 2D image with the proposed label probabilitiesbinaryThreshold
- threshold value to binarize the input imagespublic ClassificationStatistics getForegroundRestrictedRandAfterThinningStatsN2(ij.process.ImageProcessor label, ij.process.ImageProcessor proposal, double binaryThreshold)
label
- 2D image with the original (ground truth) binary labelsproposal
- 2D image with the proposed label probabilitiesbinaryThreshold
- threshold value to binarize the input imagespublic double classicRandIndex(ij.process.ShortProcessor cluster1, ij.process.ShortProcessor cluster2)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
cluster1
- 2D segmented image (objects are labeled with different numbers)cluster2
- 2D segmented image (objects are labeled with different numbers)public double foregroundRestrictedRandIndex(ij.process.ShortProcessor cluster1, ij.process.ShortProcessor cluster2)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
cluster1
- ground truth, 2D segmented image (objects are labeled with different numbers)cluster2
- prediction, 2D segmented image (objects are labeled with different numbers)public static double adaptedRandIndex3D(ij.ImagePlus originalLabels, ij.ImagePlus proposedLabels)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
originalLabels
- ground truth, 3D segmented image (objects are labeled with different numbers)proposedLabels
- prediction, 3D segmented image (objects are labeled with different numbers)public static ClassificationStatistics adaptedRandIndexStats3D(ij.ImagePlus originalLabels, ij.ImagePlus proposedLabels)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
originalLabels
- ground truth, 3D segmented image (objects are labeled with different numbers)proposedLabels
- prediction, 3D segmented image (objects are labeled with different numbers)public static double[] adaptedRandIndexStats3DN2(ij.ImagePlus segA, ij.ImagePlus segB)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
segA
- ground truth, 3D segmented image (objects are labeled with different numbers)segB
- prediction, 3D segmented image (objects are labeled with different numbers)public static double adaptedRandIndexFScore3D(ij.ImagePlus originalLabels, ij.ImagePlus proposedLabels)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
originalLabels
- ground truth, 3D segmented image (objects are labeled with different numbers)proposedLabels
- prediction, 3D segmented image (objects are labeled with different numbers)public ClassificationStatistics getRandIndexStats(ij.process.ShortProcessor cluster1, ij.process.ShortProcessor cluster2)
@article{Rand71, author = {William M. Rand}, title = {Objective criteria for the evaluation of clustering methods}, journal = {Journal of the American Statistical Association}, year = {1971}, volume = {66}, number = {336}, pages = {846--850}, doi = {10.2307/2284239) }
cluster1
- ground truth, 2D segmented image (objects are labeled with different numbers)cluster2
- prediction, 2D segmented image (objects are labeled with different numbers)public ClassificationStatistics getForegroundRestrictedRandIndexStatsN2(ij.process.ShortProcessor cluster1, ij.process.ShortProcessor cluster2)
cluster1
- ground truth clustercluster2
- proposed clusterpublic double[] getForegroundRestrictedGroundTruthDisagreements(ij.process.ShortProcessor cluster1, ij.process.ShortProcessor cluster2)
cluster1
- ground truth clustercluster2
- proposed clusterpublic double[] getForegroundRestrictedPredictionDisagreements(ij.process.ShortProcessor cluster1, ij.process.ShortProcessor cluster2)
cluster1
- ground truth clustercluster2
- proposed clusterpublic double getRandIndexMaximalFScore(double minThreshold, double maxThreshold, double stepThreshold)
minThreshold
- minimum threshold value to binarize the input imagesmaxThreshold
- maximum threshold value to binarize the input imagesstepThreshold
- threshold step value to use during binarizationpublic double getForegroundRestrictedRandIndexMaximalFScore(double minThreshold, double maxThreshold, double stepThreshold)
minThreshold
- minimum threshold value to binarize the input imagesmaxThreshold
- maximum threshold value to binarize the input imagesstepThreshold
- threshold step value to use during binarizationpublic double getMaximalVRandAfterThinning(double minThreshold, double maxThreshold, double stepThreshold, boolean perSliceAverage)
minThreshold
- minimum threshold value to binarize the input imagesmaxThreshold
- maximum threshold value to binarize the input imagesstepThreshold
- threshold step value to use during binarizationperSliceAverage
- flag to calculate macro- or micro-averaged Rand scorepublic static void main(String[] args)
args
- arguments to decide the actionpublic void setVerboseMode(boolean verbose)
setVerboseMode
in class Metrics
verbose
- true to display more information in the standard outputCopyright © 2015–2021 Fiji. All rights reserved.