skimage2.metrics.contingency_table#
- skimage2.metrics.contingency_table(im_true, im_test, *, ignore_labels=None, normalize=False, sparse_type='matrix')[source]#
Return the contingency table for all regions in matched segmentations.
- Parameters:
- im_truendarray of int
Ground-truth label image, same shape as im_test.
- im_testndarray of int
Test image.
- ignore_labelssequence of int, optional
Labels to ignore. Any part of the true image labeled with any of these values will not be counted in the score.
- normalizebool
Determines if the contingency table is normalized by pixel count.
- sparse_type{“matrix”, “array”}, optional
The return type of
cont, eitherscipy.sparse.csr_arrayorscipy.sparse.csr_matrix(default).
- Returns:
- contscipy.sparse.csr_matrix or scipy.sparse.csr_array
A contingency table.
cont[i, j]will equal the number of voxels labelediinim_trueandjinim_test. Depending onsparse_type, this can be returned as ascipy.sparse.csr_array.