Skip to main content

napari-segment-everything

License BSD-3 PyPI Python Version tests codecov napari hub

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.

https://github.com/True-North-Intelligent-Algorithms/napari-segment-everything/assets/4366342/1f451e4a-bf66-4b77-a91d-4fa283270160

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.

Metadata

Release files for napari-segment-everything 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-segment-everything 0.1.7
File Size Uploaded
napari_segment_everything-0.1.7.tar.gz 15.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-segment-everything 0.1.7
File Interpreter ABI Platform
napari_segment_everything-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 MB

Release files / napari_segment_everything-0.1.7.tar.gz

Download URL napari_segment_everything-0.1.7.tar.gz
Size 15.4 MB
Tags Source
SHA-256 checksum
How to use checksums
cf58e351393ead87f3ac81f56a434db67bbfa9c494dab9438318d064e0c6b729
BLAKE2b-256 checksum
How to use checksums
cdddf08111982a8dfbd8a2591a221055735e9fc2876389f4f3428981ebab9509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / napari_segment_everything-0.1.7-py3-none-any.whl

Download URL napari_segment_everything-0.1.7-py3-none-any.whl
Size 15.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
a8e5ee83240754ea4fa4dd67286ba63b1eaa0aa6ecdbafa589136ed75caf5234
BLAKE2b-256 checksum
How to use checksums
396d76130397635d6723224f775a650028e10eb599e1ffc1a8a32aed9a1dcaa0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page