A Napari SAM plugin to segment everything in your image (not just some things)
Project description
napari-segment-everything
A Napari SAM plugin to segment everything in your image (not just some things)
This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.
Instructions
0. Select recipe (implementation)
Use the 'select recipe' combo box to choose the implementation. Currently 'Mobile SAM v2', 'Mobile SAM finetuned' and 'SAM Automatic Mask Generator' are available. Not that the sub-options will change slightly depending on which recipe you choose. 'Mobile SAM v2' and 'Mobile SAM finetuned' (finetuned using Cellpose training data) first use a bounding box detector to locate objects then feed the bounding boxes to SAM. 'SAM Automatic Mask Generator' uses a grid of points as the prompt for SAM. Our experiments indicate that the 'Mobile SAM' recipes work well in most cases. 'SAM Automatic Mask Generator' may be useful for cases where bounding box detection was sub-optimal.
1. Generate 3D labels
In the first step adjust SAM settings and generate a 3D representation of your labels. The 3D view is needed to represent overlapping labels (labels that overlap in xy can be represented at different z). After tweaking settings press 'Generate 3D labels'. Be patient. SAM with permissive settings can potentially find thousands of labels in a complicated image. At least 6G of GPU memory is recommended to run SAM and to render to 3D label map (which can be large).
2. Filter 3D labels
In the next step select a stat (solidity, hue, IOE, stability and other stats are available) then use the sliders and number boxes to filter out labels that do not represent structure of interest. If you double click on a label a popup will appear containing the stats for that label. Inpect stats for labels you want to keep, and labels you want to eliminate to help determine the filter settings.
3. Generate 2D labels
In this step the 3D labels are projected to a 2D label map, use the dropdown to choose between projecting big labels in front or small labels in front.
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the BSD-3 license, "napari-segment-everything" is free and open source software
Issues
If you encounter any problems, please [file an issue] along with a detailed description.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file napari_segment_everything-0.1.6.tar.gz
.
File metadata
- Download URL: napari_segment_everything-0.1.6.tar.gz
- Upload date:
- Size: 15.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5779f13be9b38f1892072159f758e1d5fc83b9673aca950bad6bbdcb80507d29 |
|
MD5 | dbe1c3c3f3341b8d593e984d0fe1c041 |
|
BLAKE2b-256 | 07bb03d8efd0bef1ca68e6f70c15c8dcbb8be2716cf24b6880ae8d6d6a2ed03e |
File details
Details for the file napari_segment_everything-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: napari_segment_everything-0.1.6-py3-none-any.whl
- Upload date:
- Size: 15.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6d9608480619cd2f63facdc3233c31bf8bbe506b2d7df1a2249b7a49b33a579 |
|
MD5 | 12279712cdde230579eb572f8bd287ca |
|
BLAKE2b-256 | 4ae604bef2782457a1b63fd5b632ce3c03c02bed31bc51828f4599b1c1201d87 |