{"name":"napari-feature-visualization","display_name":"Napari Feature Visualization","visibility":"public","icon":"","categories":["Annotation"],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-feature-visualization.make_sample_data","title":"Load sample data from Napari Feature Visualization","python_name":"napari_feature_visualization._sample_data:make_sample_data","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-feature-visualization.feature_vis_widget","title":"Feature Visualization","python_name":"napari_feature_visualization._widget:FeatureVisWidget","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"napari-feature-visualization.feature_vis_widget","display_name":"Feature Visualization","autogenerate":false}],"sample_data":[{"command":"napari-feature-visualization.make_sample_data","key":"unique_id.1","display_name":"Napari Feature Visualization"}],"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"napari-feature-visualization","version":"0.1.0","dynamic":["license-file"],"platform":null,"supported_platform":null,"summary":"Visualizing feature measurements on label images in napari","description":"# napari-feature-visualization\n\n[![License BSD-3](https://img.shields.io/pypi/l/napari-feature-visualization.svg?color=green)](https://github.com/fractal-napari-plugins-collection/napari-feature-visualization/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-feature-visualization.svg?color=green)](https://pypi.org/project/napari-feature-visualization)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-feature-visualization.svg?color=green)](https://python.org)\n[![tests](https://github.com/fractal-napari-plugins-collection/napari-feature-visualization/workflows/tests/badge.svg)](https://github.com/fractal-napari-plugins-collection/napari-feature-visualization/actions)\n[![codecov](https://codecov.io/gh/fractal-napari-plugins-collection/napari-feature-visualization/branch/main/graph/badge.svg)](https://codecov.io/gh/fractal-napari-plugins-collection/napari-feature-visualization)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-feature-visualization)](https://napari-hub.org/plugins/napari-feature-visualization)\n\nVisualize per-label feature measurements on label images in napari. Color each\nlabel by any numeric or categorical feature column, with support for both\ncontinuous colormaps (with adjustable contrast limits) and qualitative\ncolormaps for categorical data.\n\n![feature_viz_demo](https://github.com/user-attachments/assets/4c7e2d37-2981-43bc-9bb6-1f59ac973dd1)\n\nFeature data can be loaded from a CSV file or read directly from\n`layer.features` — enabling visualization of measurements stored in OME-Zarrs\nvia plugins such as the [napari OME-Zarr navigator].\n\n---\n\n## Installation\n\n```\npip install napari-feature-visualization\n```\n\n---\n\n## Usage\n\nOpen the widget via **Plugins → Feature Visualization**.\n\n### 1. Select a data source\n\nThe widget has two modes, selected with the radio buttons at the top:\n\n- **Layer Properties** — reads feature columns directly from the active Labels\n  layer's `.features` DataFrame. No file is needed; the features travel with\n  the layer.\n- **CSV File** — loads a CSV from disk. Click **Browse…** to pick the file.\n  The CSV must have one row per label and at least one column whose values\n  match the label IDs in the image.\n\n<img width=\"1983\" height=\"1243\" alt=\"feature_viz_overview\" src=\"https://github.com/user-attachments/assets/56a41144-9c2c-460e-ad06-11fc5df6b6d8\" />\n\n### 2. Select a Labels layer\n\nClick a Labels layer in the napari layer list. The widget automatically tracks\nthe active layer — the layer name shown below the radio buttons updates as you\nswitch between layers. If the active layer is not a Labels layer or has no\nfeature columns the dropdowns will be empty.\n\n### 3. Configure columns\n\n| Dropdown | Purpose |\n|---|---|\n| **Feature** | The column to visualize (any numeric or string column) |\n| **Label column** | The column whose integer values match the label IDs in the image |\n\nThe **Label column** defaults to the first column named `label`, `Label`, or\n`index` if one exists.\n\n### 4. Choose a colormap\n\nFor **continuous** features all napari colormaps are available. The default is\n`viridis`.\n\nFor **categorical** (non-numeric) features only qualitative colormaps wide\nenough to cover the number of unique categories are shown. The default is\n`tab10` (up to 10 categories). When the number of categories exceeds all\navailable qualitative colormaps the napari `label_colormap` is used as\nfallback.\n\n<img width=\"1983\" height=\"1243\" alt=\"feature_viz_continuous\" src=\"https://github.com/user-attachments/assets/babef956-8439-43b8-962a-ca8427f4f555\" />\n\n<img width=\"1983\" height=\"1243\" alt=\"feature_viz_categorical\" src=\"https://github.com/user-attachments/assets/6a6deee3-6149-4217-a57b-d8dcebaabd7e\" />\n\n\n### 5. Adjust contrast limits (continuous features only)\n\nThe range slider sets the lower and upper contrast limits. Values below the\nlower limit map to the first colormap color; values above the upper limit map\nto the last. The limits default to the 1st and 99th percentiles of the feature\nvalues.\n\nThe **Show colorbar** checkbox renders a labeled gradient bar below the slider.\n\n<img width=\"578\" height=\"98\" alt=\"feature_viz_colorbar\" src=\"https://github.com/user-attachments/assets/15fdca4e-b26b-4265-952d-4b50b7510b23\" />\n\n\n### 6. Apply\n\n- Click **Apply Feature Colormap** to color the layer once.\n- Check **Live update** to automatically re-apply whenever you change the\n  feature, colormap, or contrast limits.\n\nLabels whose feature value is `NaN` / `None` are rendered transparent.\nBackground (label 0) is always black.\n\n---\n\n## Contributing\n\nContributions are welcome. The project uses [pixi] for environment management.\n\n```\ngit clone https://github.com/fractal-napari-plugins-collection/napari-feature-visualization\ncd napari-feature-visualization\npixi install\npixi run test      # run the test suite\npixi run napari    # launch napari with the plugin installed\n```\n\nLinting and formatting use [ruff]:\n\n```\npixi run lint      # check\npixi run format    # auto-format\npixi run check     # lint + test in one step\n```\n\nPlease ensure the test coverage does not decrease before opening a pull\nrequest.\n\n---\n\n## Releases\n\nReleases are driven by git tags. The version is managed automatically by\n[setuptools-scm] — there is no version number to edit manually.\n\n1. Make sure `main` is clean and all tests pass.\n2. Create and push a version tag:\n   ```\n   git tag v<major>.<minor>.<patch>\n   git push origin v<major>.<minor>.<patch>\n   ```\n3. The GitHub Actions workflow detects the tag and automatically:\n   - Builds the source distribution and wheel (`python -m build`)\n   - Uploads to PyPI via Twine (requires the `TWINE_API_KEY` secret to be set\n     in the repository settings)\n\nThere is no separate changelog file — use the GitHub Releases page to document\nwhat changed.\n\n---\n\n## License\n\nDistributed under the terms of the [BSD-3] license.\n\n## Issues\n\n[File an issue] on GitHub with a detailed description.\n\n[napari OME-Zarr navigator]: https://github.com/fractal-napari-plugins-collection/napari-ome-zarr-navigator\n[pixi]: https://pixi.sh\n[ruff]: https://docs.astral.sh/ruff/\n[setuptools-scm]: https://setuptools-scm.readthedocs.io/\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[File an issue]: https://github.com/fractal-napari-plugins-collection/napari-feature-visualization/issues\n","description_content_type":"text/markdown","keywords":null,"home_page":null,"download_url":null,"author":"Joel Luethi, Adrian Tschan","author_email":"joel.luethi@uzh.ch","maintainer":null,"maintainer_email":null,"license":"Copyright (c) 2024, Joel Luethi, Adrian Tschan\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of copyright holder nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: BSD License","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["numpy","qtpy","matplotlib","pandas","napari>=0.6","tox; extra == \"testing\"","pytest; extra == \"testing\"","pytest-cov; extra == \"testing\"","pytest-qt; extra == \"testing\"","napari; extra == \"testing\"","pyqt6; extra == \"testing\""],"requires_python":">=3.10","requires_external":null,"project_url":["Bug Tracker, https://github.com/fractal-napari-plugins-collection/napari-feature-visualization/issues","Documentation, https://github.com/fractal-napari-plugins-collection/napari-feature-visualization#README.md","Source Code, https://github.com/fractal-napari-plugins-collection/napari-feature-visualization","User Support, https://github.com/fractal-napari-plugins-collection/napari-feature-visualization/issues"],"provides_extra":["testing"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}