public class LazyMultiMetrics extends Object
MultiMetrics over all images added by calling
addTimePoint. The images are expected to be
of dimension XYZ, where Z can be of depth 1.
The scores are calculated by accumulating the number of TP, FP, FN and the sum of the IoU for each image.
Each contribution is computed by adding images using addTimePoint. The final score can be queried by
computeScore().
Each image's contributions are calculated independently. Therefore, the same LazyMultiMetrics object can be called from multiple threads in order to speed up computation. For instance, if the total stack does not fit in memory, lazy loading and multithreading can be used to compute the metrics scores by splitting the XYZ images between threads and adding them one by one. The final scores can be calculated once all threads have finished.
The MultiMetrics scores are calculated at a certain threshold. This threshold is
the minimum IoU between a ground-truth and a prediction label at which two labels are considered
a potential match. The threshold can only be set at instantiation.
MultiMetrics| Constructor and Description |
|---|
LazyMultiMetrics()
Constructor with a default threshold of 0.5.
|
LazyMultiMetrics(double threshold)
Constructor that sets the threshold value.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPoint(MultiMetrics.MetricsSummary newResult)
Update the atomic aggregates with the values held by the
MultiMetrics.MetricsSummary. |
<T,I extends IntegerType<I>,U,J extends IntegerType<J>> |
addTimePoint(ImgLabeling<T,I> groundTruth,
ImgLabeling<U,J> prediction)
Add a new image pair and compute its contribution to the metrics scores.
|
<I extends IntegerType<I>,J extends IntegerType<J>> |
addTimePoint(RandomAccessibleInterval<I> groundTruth,
RandomAccessibleInterval<J> prediction)
Add a new image pair and compute its contribution to the metrics scores.
|
HashMap<MultiMetrics.Metrics,Double> |
computeScore()
Compute the total
MultiMetrics scores. |
public LazyMultiMetrics()
public LazyMultiMetrics(double threshold)
threshold - Thresholdpublic <T,I extends IntegerType<I>,U,J extends IntegerType<J>> void addTimePoint(ImgLabeling<T,I> groundTruth, ImgLabeling<U,J> prediction)
computeScore(). This method is not compatible with
ImgLabeling with intersecting labels.T - Label type associated to the ground-truthI - Ground-truth pixel typeU - Label type associated to the predictionJ - Prediction pixel typegroundTruth - Ground-truth imageprediction - Predicted imagepublic <I extends IntegerType<I>,J extends IntegerType<J>> void addTimePoint(RandomAccessibleInterval<I> groundTruth, RandomAccessibleInterval<J> prediction)
computeScore().I - Ground-truth pixel typeJ - Prediction pixel typegroundTruth - Ground-truth imageprediction - Predicted imagepublic HashMap<MultiMetrics.Metrics,Double> computeScore()
MultiMetrics scores. If no image was added, or all images were empty, then the metrics
scores are TP=FP=FN=0 and NaN for the others.protected void addPoint(MultiMetrics.MetricsSummary newResult)
MultiMetrics.MetricsSummary.newResult - Result to add to the aggregatesCopyright © 2009–2024 ImgLib2. All rights reserved.