biapol_utilities.label.match_labels_stack¶
- biapol_utilities.label.match_labels_stack(label_stack, metric_method=<function intersection_over_union_matrix>, filter_method=<function suppressed_similarity>, matching_method=<function match_gale_shapley>)¶
Match labels from subsequent slices with specified method.
- Parameters
label_stack (3D-array, int) – Stack of 2D label images to be stitched with axis order ZYX
metric_method (callable, optional) – Method to be used to generate a metric of similarity between labels in subsequent slices. Must return a matrix with shape=(max(n, m), max(n, m)), where n and m are the present labels in two subsequent slices z and z+1. The values in the matrix must be normalized to a range of [0, 1], where 0 and signify minimal or maximal similarity between two labels. Default is intersection_over_union_matrix
filter_method (callable, optional) – Method to be used to filter values from the similarity matrix. This can help to speed up the matching process if, fo instance, entries in the similarity matrix below a defined threshold are set to zero. Default is suppressed_similarity(similiarity_matrix, threshold=0.3)
matching_method (callable, optional) – Method to be used for matching the labels. This function is supposed to return a binary matrix with shape=(n+1, m+1) corresponding to match=1, no_match=0 of the n labels in a given slice and m labels in the following slice. The default is match_max_similarity.
- Returns
Stack of stitched labels
- Return type
3D-array, int