# Napari Layer Statistics

`napari-layer-statistics` is a compact layer inspector for napari: fast statistics, editable geometry/camera fields, and clipboard-friendly summaries in one widget.

Features:
- Computations in background processes to keep napari viewer responsive
- metadata panel for selected layer (`Name`, `Type`, `Dtype`)
- geometry panel for selected layer (`Array Shape`) with editable fields for `Spacing`, `Origin` and `Direction`
- camera panel with editable `NDisplay`, `Displayed axis`, `Zoom`, `Center`, `Angle`, and `Canvas (w, h)`
- `Image` statistics (grayscale/RGB/RGBA) with optional heavy-compute toggle
- `Labels` statistics with class overview (`Number Classes`, `Classes present`) and per-class voxel percentages
- class color picker in labels table (currently supported for cyclic label colormaps)
- copy/paste camera settings from clipboard
- copy/paste class colors from clipboard
- `Copy stats` for a global metadata/geometry/statistics report (camera/colors intentionally excluded)

## Install

```bash
pip install napari-layer-statistics
```

or with napari included:

```bash
pip install "napari-layer-statistics[all]"
```

## Use

<img src="https://github.com/MIC-DKFZ/napari-layer-statistics/raw/main/imgs/GUI.png"  width="1200">

Open the widget in napari:

```text
Plugins > napari-layer-statistics > Layer Statistics
```

## License

Apache-2.0

# Acknowledgments

<p align="left">
  <img src="https://github.com/MIC-DKFZ/napari-layer-statistics/raw/main/imgs/Logos/HI_Logo.png" width="150"> &nbsp;&nbsp;&nbsp;&nbsp;
  <img src="https://github.com/MIC-DKFZ/napari-layer-statistics/raw/main/imgs/Logos/DKFZ_Logo.png" width="500">
</p>

This repository is developed and maintained by the Applied Computer Vision Lab (ACVL)
of [Helmholtz Imaging](https://www.helmholtz-imaging.de/) and the
[Division of Medical Image Computing](https://www.dkfz.de/en/medical-image-computing) at DKFZ.

This repository was generated with [copier] using the [napari-plugin-template].

[copier]: https://copier.readthedocs.io/en/stable/
[napari-plugin-template]: https://github.com/napari/napari-plugin-template
