From 9af947a48e572865e0c3229f1f26212180a4389b Mon Sep 17 00:00:00 2001 From: Lorenzo Gaifas Date: Wed, 1 Oct 2025 12:10:45 +0200 Subject: [PATCH 1/2] add overlays to docs --- docs/guides/layers.md | 10 +++++++++- docs/tutorials/fundamentals/viewer.md | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/guides/layers.md b/docs/guides/layers.md index cb7ab06c0..c9cf55828 100644 --- a/docs/guides/layers.md +++ b/docs/guides/layers.md @@ -108,7 +108,15 @@ For example, the image below shows an image with the blending set to `additive`. ![napari viewer with an image of a cell. Layer controls are open in the left sidebar with the blending set to additive.](../_static/images/blending.png) -## 3D rendering of images +(layer-overlays)= +## Layer overlays + +Following the same pattern as [viewer overlays](viewer-overlays), layers offer some extra visualisations as overlays: + +- Bounding box (scene overlay, accessible via `layer.bounding_box`): displays a bounding box around the data +- Color bar (canvas overlay, accessible via `layer.colorbar` on layers with a `colormap` attribute): displays a colorbar legend with tickmarks, automatically synced with contrast limits + +## 3D rendering All our layers can be rendered in both 2D and 3D mode, and one of our viewer buttons can toggle between each mode. The number of dimensions sliders will be 2 diff --git a/docs/tutorials/fundamentals/viewer.md b/docs/tutorials/fundamentals/viewer.md index d9a8c9751..1fde187c3 100644 --- a/docs/tutorials/fundamentals/viewer.md +++ b/docs/tutorials/fundamentals/viewer.md @@ -553,6 +553,20 @@ On the left side of the status bar there is a message about the position of the The right side of the status bar contains some helpful tips depending on which layer and tools are currently selected. +(viewer-overlays)= +## Viewer overlays + +Overlays provide additional information about the render state and the data, displayed on the canvas itself. +In napari there are two main types: canvas overlays - which are locked in position on the screen and hover over the rendered canvas - and scene overlays - which are located somewhere in world coordinates and follow the camera and dims just like layers. Canvas overlays can be positioned in various locations on the canvas (e.g: `top_left`, `bottom_center`), and will automatically tile if multiple are present at the same location. + +The viewer gives access to a few such overlays: + +- Scale bar (canvas overlay, accessible via `viewer.scale_bar`): you may set its unit, length, and other parameters. +- Axes (scene overlay, accessible via `viewer.axes`): displays basis axes at the origin. +- Text Overlay (canvas overlay, accessible via `viewer.text_overlay`): displays arbitrary text on the canvas. + +Similarly to the viewer, layers [also have some overlays](layer-overlays) that can be used to display layer-specific information. + ## Right-click menu A context-sensitive menu is available when you right-click on any of the layers. The type of layer determines which options are available. Note that if you have multiple layers selected, the menu actions will affect all of the selected layers. The options that are not available for a layer are greyed out. The following options are available depending on which layer type you have selected: From 179a06018435f8342bca766e1b22eecd99fd380c Mon Sep 17 00:00:00 2001 From: Lorenzo Gaifas Date: Wed, 1 Oct 2025 12:17:50 +0200 Subject: [PATCH 2/2] add info about gui --- docs/guides/layers.md | 2 ++ docs/tutorials/fundamentals/viewer.md | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/guides/layers.md b/docs/guides/layers.md index c9cf55828..c5c646877 100644 --- a/docs/guides/layers.md +++ b/docs/guides/layers.md @@ -116,6 +116,8 @@ Following the same pattern as [viewer overlays](viewer-overlays), layers offer s - Bounding box (scene overlay, accessible via `layer.bounding_box`): displays a bounding box around the data - Color bar (canvas overlay, accessible via `layer.colorbar` on layers with a `colormap` attribute): displays a colorbar legend with tickmarks, automatically synced with contrast limits +These overlays can be also toggled from the graphical interface by right-clicking on selected layers in the layerlist, and clicking their respective menu entry under **Visualisation**. + ## 3D rendering All our layers can be rendered in both 2D and 3D mode, and one of our viewer diff --git a/docs/tutorials/fundamentals/viewer.md b/docs/tutorials/fundamentals/viewer.md index 1fde187c3..f33df5f4e 100644 --- a/docs/tutorials/fundamentals/viewer.md +++ b/docs/tutorials/fundamentals/viewer.md @@ -565,7 +565,11 @@ The viewer gives access to a few such overlays: - Axes (scene overlay, accessible via `viewer.axes`): displays basis axes at the origin. - Text Overlay (canvas overlay, accessible via `viewer.text_overlay`): displays arbitrary text on the canvas. -Similarly to the viewer, layers [also have some overlays](layer-overlays) that can be used to display layer-specific information. +These overlays can also be accessed via graphical interface through the **View** menu and their respective submenus. + +:::{tip} +Similarly to the viewer, layers [also have some overlays](layer-overlays) that can be used to display layer-specific information! +::: ## Right-click menu