Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
find_objects
for Dask Array
Provides an implementation of `find_objects` that determines bounding boxes for each label in the image. Currently requires the user to specify the number of labels they would like to inspect. Raises a `NotImplementedError` if the user wishes to collect all bounding boxes for labels. Works by selecting the 1-D positions that correspond to the label while ignoring all other points. Assumes that these positions along with an intermediate array of the same size comfortably fit in memory. Within a utility function, determines whether any positions were found for the corresponding label. If not, simply returns `None`. If positions were found, it manually unravels the positions and finds the maximum and minimum positions along each dimension. These are stored into `slice`s, which are packed into a `tuple` and returned. Makes sure to use in-place NumPy operations to avoid using additional memory.
- Loading branch information