If the input to cc3d.statistics is not an unsigned integer, it throws a TypeError: "Function call with ambiguous argument types"
# Works
labeled_data = cc3d.connected_components(np_data)
stats = cc3d.statistics(labeled_data.astype(np.uint16))
# Fails
labeled_data = cc3d.connected_components(np_data)
stats = cc3d.statistics(labeled_data.astype(np.float32))
# Also Fails
labeled_data = cc3d.connected_components(np_data)
stats = cc3d.statistics(labeled_data.astype(np.int16))
This is especially important when using cc3d.dust which returns a numpy array with dtype int16
# Fails, as labeled_data is `int16`
labeled_data = cc3d.dust(np_data)
stats = cc3d.statistics(labeled_data)
# Works
labeled_data = cc3d.dust(np_data)
stats = cc3d.statistics(labeled_data.astype(np.uint16))
If the input to cc3d.statistics is not an unsigned integer, it throws a TypeError: "Function call with ambiguous argument types"
This is especially important when using
cc3d.dustwhich returns a numpy array with dtypeint16