Skip to main content

A napari plugin to analyse local orientation in images

Project description

napari-orientation

License BSD-3 PyPI Python package index download statistics Python Version tests codecov napari hub npe2 Copier

A napari plugin to analyse local orientation in images.

Installation

You can install the plugin from the napari GUI interface by going to Plugins/Install\Uninstall Plugins and selecting napari-orientation. Alternatively, you can install the plugin from the napari conda environment via pip:

pip install napari-orientation

Usage

You can access all the functionalities of the plugin from the menu Plugins\Orientation Analysis.

All the analyses work only on single-channel 2D images and on single-channel 2D time series. In this last case the analysis can be restricted to single frames.

The only parameter available is the sigma smoothing, in pixels, which controls the strength of the gaussian filter applied to the gradient of the image before computing the orientation vector pixelwise.

Currently two widgets are available: Compute orientation metrics and Generate vector-coded images

Compute orientation metrics

This GUI gives access to most of the functionalities. You can compute several metrics and display them as images.

Definitions:

  • Orientation vector: unitary vector describing the average orientation of the gradient of the intensity around a point in the image. Computationally this is obtained by determining the first eigenvector (i.e. largest eigenvalue) of the structure tensor matrix.
  • Orientation field: mapping of the orientation vectors at each point in the image.
  • Angle field: mapping of the orientation angle at each point in the image
  • Energy: sum of the tensor eigenvalues.
  • Coherence: ratio between the difference and the sum of the maximum and minimum tensor eigenvalues.
  • Curvature: rate of change in the local orientation in the direction perpendicular to that orientation.
  • Correlation length: distance where the radial autocorrelation of the angle field drops below 0.5

Display Colored Orientation

It computes an image where each pixel is colored differently according to the orientation angle estimated at that position.

Example colored orientation

Display Coherence

It computes an image where the value of each pixel represents the coherence estimated at that position.

Example coherence

Display Curvature

It computes an image where the value of each pixel represents the curvature estimated at that position.

Example coherence

Display Angle

It computes an image where the value of each pixel represents the angle, in degrees, estimated at that position.

Example coherence

Compute statistics

Estimate the average value for the following metrics: Energy, Coherence, Correlation length, Curvature.

The average curvature is estimated as the half life of the exponential decay function modeling the distribution of curvature values in the image.

Note that Correlation length and Curvature metrics are both provided in physical units, and therefore their determination relies on the accuracy of the pixel size provided for the image. Using the napari-bioformats to open the images should guarantee that the pixel size stored in the file metadata is properly read by the plugin. In any case it always possible to adjust the pixel size from the interface.

Example statistics

Generate vector-coded images

It generates a vector layer displaying the orientation field estimated locally, over a grid with spacing defined by the user.

Example vectors

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-orientation" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This napari plugin was generated with copier using the napari-plugin-template (None).

This work was inspired by the plugin OrientationJ for ImageJ, that was partially converted by the same developers into a plugin for napari.

napari-orientation focuses on the computation of several metrics, some of them proposed in this article

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

napari_orientation-0.1.5.tar.gz (12.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_orientation-0.1.5-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file napari_orientation-0.1.5.tar.gz.

File metadata

  • Download URL: napari_orientation-0.1.5.tar.gz
  • Upload date:
  • Size: 12.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for napari_orientation-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c73c8fe4159d5e403ddd60a2399f470e7f2a1f9f319419f18cc6222936926e97
MD5 0f5e71beaff1fcfd6151499be3762d44
BLAKE2b-256 6b5164f6420e06598f98f237abe996ab43c7e0e162e25c2ad8a96bbb3bb9480c

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_orientation-0.1.5.tar.gz:

Publisher: test_and_deploy.yml on giocard/napari-orientation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file napari_orientation-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_orientation-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 268d46669157e16e2a81a43074500ae260721cb39ce39fcdc219b3ac61fd4914
MD5 f7148191df09b6242310881de9ef3bfb
BLAKE2b-256 d2b99c10116df6a19051ad739e434de2456bb2c252b22831703dff685f9eebb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_orientation-0.1.5-py3-none-any.whl:

Publisher: test_and_deploy.yml on giocard/napari-orientation

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page