agora.utils.indexing.validate_association

validate_association(association, indices, match_column=None)[source]
Select rows from the first array that are present in both.

We use casting for fast multiindexing, generalising for lineage dynamics

Parameters
associationnp.ndarray

2-D array where columns are (trap, mother, daughter) or 3-D array where dimensions are (X,trap,2), containing tuples ((trap,mother), (trap,daughter)) across the 3rd dimension.

indicesnp.ndarray

2-D array where each column is a different level. This should not include mother_label.

match_column: int

int indicating a specific column is required to match (i.e. 0-1 for target-source when trying to merge tracklets or mother-bud for lineage) must be present in indices. If it is false one match suffices for the resultant indices vector to be True.

Returns
np.ndarray

1-D boolean array indicating valid merge events.

np.ndarray

1-D boolean array indicating indices with an association relationship.

[ True False False] [ True True False]

Return type

Tuple[ndarray, ndarray]