Skip to content

Commit

Permalink
improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrofelder committed Aug 31, 2023
1 parent bf94aec commit 9301da5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion brainrender_napari/napari_atlas_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 9301da5

Please sign in to comment.