From 9301da52a50749bdf4da8abc85b2121cd0ef1cb7 Mon Sep 17 00:00:00 2001 From: alessandrofelder Date: Thu, 31 Aug 2023 11:39:56 +0100 Subject: [PATCH] improve docstrings --- brainrender_napari/napari_atlas_representation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/brainrender_napari/napari_atlas_representation.py b/brainrender_napari/napari_atlas_representation.py index 7efb18d..bf7d574 100644 --- a/brainrender_napari/napari_atlas_representation.py +++ b/brainrender_napari/napari_atlas_representation.py @@ -19,6 +19,7 @@ class NapariAtlasRepresentation: mesh_blending: str = "translucent_no_depth" def __post_init__(self) -> None: + """Setup a custom QLabel tooltip and enable napari layer tooltips""" self._tooltip = QLabel(self.viewer.window.qt_viewer.parent()) self._tooltip.setWindowFlags( Qt.Window | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint @@ -32,7 +33,7 @@ def __post_init__(self) -> None: def add_to_viewer(self): """Adds the reference and annotation images as layers to the viewer. - The layers are connected to self._tooltip + The layers are connected to the mouse move callback to set tooltip. The reference image's visibility is off, the annotation's is on. """ reference = self.viewer.add_image( @@ -86,6 +87,9 @@ def _add_mesh(self, mesh: Mesh, name: str, color=None): self.viewer.add_surface((points, cells), **viewer_kwargs) def add_additional_reference(self, additional_reference_key: str): + """Adds a given additional reference as a layer to the viewer. + and connects it to the mouse move callback to set tooltip. + """ additional_reference = self.viewer.add_image( self.bg_atlas.additional_references[additional_reference_key], scale=self.bg_atlas.resolution,