-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to SegmentationMaskCollection #1497
Labels
Comments
Filters (ex. ImageStack max_proj) may make more sense as it's own pipeline component |
See: https://scikit-image.org/docs/dev/api/skimage.measure.html#skimage.measure.regionprops |
ttung
pushed a commit
that referenced
this issue
Oct 10, 2019
Maps from cell id to mask. Part of #1497
ttung
pushed a commit
that referenced
this issue
Oct 17, 2019
regionprops are useful to characterize and filter segmented cells. This PR changes what we store for mask data to be a tuple of binary mask and regionprops. If we construct a mask collection from a labeled image, we retain the region props that are automatically calculated as a part of this conversion process. If we construct a mask collection from what's stored on disk, we will calculate the regionprops when requested. Test plan: Save to disk a mask collection generated from a labeled image, and after loading it from disk, verify that the region props of the two mask collections match. Part of #1497
ttung
pushed a commit
that referenced
this issue
Oct 28, 2019
ttung
pushed a commit
that referenced
this issue
Nov 13, 2019
LabelImage requires all the pixel coordinate and physical coordinate values along each axis, so to facilitate the easy conversion to and from BinaryMaskCollection and LabelImage, we need to change the data model for BinaryMaskCollection. Previously, BinaryMaskCollection stored a series of xarrays for each of the masks. This does not guarantee that the pixel/physical coordinates for every position along each axis. Furthermore, it duplicates a lot of data. This new approach stores the coordinates as independent arrays, and then stores each mask as a naked np.ndarray with offsets. Conversions to and from LabelImage is pretty straightforward. Returning each mask as an xarray (to maintain compatibility with the existing API) requires generating an xarray on the fly, but is not terribly expensive. Writing to disk is now through a versioned interface similar to what was done for slicedimage. Test plan: Updated tests to reflect the API changes. Part of #1497 Depends on #1619, #1622
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Objective
SegmentationMaskCollection should contain operations that manipulate regions and can be improved to be more usable by making it a dict-like object. We should be able to query for masks matching cell ids, obtain properties of stored cell regions, and filter on those properties.
The text was updated successfully, but these errors were encountered: