Skip to main content

napari-affinities

License PyPI Python Version tests codecov napari hub

A plugin for creating, visualizing, and processing affinities


This napari plugin was generated with Cookiecutter using @napari's cookiecutter-napari-plugin template.

Installation

You will need a conda environment for everything to run smoothly. Supported python versions are 3.7, 3.8, 3.9.

pip

You can install napari-affinities via pip:

`pip install napari-affinities`

To install latest development version :

`pip install git+https://github.com/pattonw/napari-affinities.git`

Install torch according to your system (follow the instructions here). For example with cuda 10.2 available, run:

conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

Install conda requirements:

conda install -c conda-forge affogato

conda

If you install via conda, there are fewer steps since affogato and pytorch will be installed for you.

You can install napari-affinities via [conda]:

`conda install -c conda-forge napari-affinities`

Download example model:

2D:

epithelial example model Place the model zip file wherever you want. You can open it in the plugin with the "load from file" button.

3D

lightsheet example model Unpack the tar file into test data (lightsheet_nuclei_test_data (an hdf5 file)) and model (LightsheetNucleusSegmentation.zip (a bioimageio model)). Move the data into sample_data which will enable you to load the "Lightsheet Sample" data in napari. Place the model zip file anywhere you want. You can open it in the plugin with the "load from file" button.

Workarounds to be fixed:
  1. you need to update the rdf.yaml in the LightsheetNucleusSegmentation.zip with the following:
    • "shape" for "input0" should be updated with a larger minimum input size and "output0" should be updated with a larger halo. If not fixed, there will be significant tiling artifacts.
    • (Optional) "output0" should be renamed to affinities. The plugin supports multiple outputs and relies on names for figuring out which one is which. If unrecognized names are provided we assume the outputs are ordered (affinities, fgbg, lsds) but this is less reliable than explicit names.
  2. This model also generates foreground in the same array as affinities, i.e. a 10 channel output (fgbg, [-1, 0, 0], [0, -1, 0], [0, 0, -1], [-2, 0, 0], ...). Although predictions will work, post processing such as mutex watershed will break unless you manually separate the first channel.

Use

Requirements for the model:

  1. Bioimageio packaged pytorch model
  2. Outputs with names "affinities", "fgbg"(optional) or "lsds"(optional)
    • if these names are not used, it will be assumed that the outputs are affinities, fgbg, then lsds in that order

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 MIT license, "napari-affinities" 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-affinities 0.1.3

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-affinities 0.1.3
File Size Uploaded Provenance Actions
napari-affinities-0.1.3.tar.gz 2.9 MB Without provenance Details for napari-affinities-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for napari-affinities 0.1.3
File Interpreter ABI Platform Actions
napari_affinities-0.1.3-py3-none-any.whl Python 3 none any Details for napari_affinities-0.1.3-py3-none-any.whl

Total release size: 5.7 MB

Release files / napari-affinities-0.1.3.tar.gz

Download URL napari-affinities-0.1.3.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
0031575f74f5d866b15d21368f7e3ee7dc921c362d79103bcc9caa73593f9eca
BLAKE2b-256 checksum
How to use checksums
0e71da0e1e1f7eb4d7bfc4a1b3bd684cf73bf0c14272ce2161e69ad13df3e5e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / napari_affinities-0.1.3-py3-none-any.whl

Download URL napari_affinities-0.1.3-py3-none-any.whl
Size 2.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0df8697adde5ae173f697e9a6f060b1f1b7f0e508f350ad42a439ac70e8890fd
BLAKE2b-256 checksum
How to use checksums
cdfe36af2fe73a3a1eca5dd7a2884bfa04a9f75e37fe0acf67eb698a8a9effd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Security for napari-affinities 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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