Metric measures (medpy.metric)#

This package provides a number of metric measures that e.g. can be used for testing and/or evaluation purposes on two binary masks (i.e. measuring their similarity) or distance between histograms.

Binary metrics (medpy.metric.binary)#

Metrics to compare binary objects and classification results.

Compare two binary objects#

dc(result, reference)

Dice coefficient

jc(result, reference)

Jaccard coefficient

hd(result, reference[, voxelspacing, ...])

Hausdorff Distance.

asd(result, reference[, voxelspacing, ...])

Average surface distance metric.

assd(result, reference[, voxelspacing, ...])

Average symmetric surface distance.

precision(result, reference)

Precison.

recall(result, reference)

Recall.

sensitivity(result, reference)

Sensitivity.

specificity(result, reference)

Specificity.

true_positive_rate(result, reference)

True positive rate.

true_negative_rate(result, reference)

True negative rate.

positive_predictive_value(result, reference)

Positive predictive value.

ravd(result, reference)

Relative absolute volume difference.

Compare two sets of binary objects#

obj_tpr(result, reference[, connectivity])

The true positive rate of distinct binary object detection.

obj_fpr(result, reference[, connectivity])

The false positive rate of distinct binary object detection.

obj_asd(result, reference[, voxelspacing, ...])

Average surface distance between objects.

obj_assd(result, reference[, voxelspacing, ...])

Average symmetric surface distance.

Compare to sequences of binary objects#

volume_correlation(results, references)

Volume correlation.

volume_change_correlation(results, references)

Volume change correlation.

Image metrics (medpy.metric.image)#

Some more image metrics (e.g. sls and ssd) can be found in medpy.filter.image.

mutual_information(i1, i2[, bins])

Computes the mutual information (MI) (a measure of entropy) between two images.

Histogram metrics (medpy.metric.histogram)#

chebyshev(h1, h2)

Chebyshev distance.

chebyshev_neg(h1, h2)

Chebyshev negative distance.

chi_square(h1, h2)

Chi-square distance.

correlate(h1, h2)

Correlation between two histograms.

correlate_1(h1, h2)

Correlation distance.

cosine(h1, h2)

Cosine simmilarity.

cosine_1(h1, h2)

Cosine simmilarity.

cosine_2(h1, h2)

Cosine simmilarity.

cosine_alt(h1, h2)

Alternative implementation of the cosine distance measure.

euclidean(h1, h2)

Equal to Minowski distance with \(p=2\).

fidelity_based(h1, h2)

Fidelity based distance.

histogram_intersection(h1, h2)

Calculate the common part of two histograms.

histogram_intersection_1(h1, h2)

Turns the histogram intersection similarity into a distance measure for normalized, positive histograms.

jensen_shannon(h1, h2)

Jensen-Shannon divergence.

kullback_leibler(h1, h2)

Kullback-Leibler divergence.

manhattan(h1, h2)

Equal to Minowski distance with \(p=1\).

minowski(h1, h2[, p])

Minowski distance.

noelle_1(h1, h2)

Extension of fidelity_based proposed by [R0007bcd883ab-1].

noelle_2(h1, h2)

Extension of fidelity_based proposed by [R256fa0dd8776-1].

noelle_3(h1, h2)

Extension of fidelity_based proposed by [Rd5b1e2c5cbe2-1].

noelle_4(h1, h2)

Extension of fidelity_based proposed by [Rcc5be5568670-1].

noelle_5(h1, h2)

Extension of fidelity_based proposed by [R3c080ba261ce-1].

quadratic_forms(h1, h2)

Quadrativ forms metric.

relative_bin_deviation(h1, h2)

Calculate the bin-wise deviation between two histograms.

relative_deviation(h1, h2)

Calculate the deviation between two histograms.