Skip to content

Commit

Permalink
Patch: Support for physical units
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoasua committed Feb 28, 2021
1 parent ae7374b commit 96385f8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion sashimi/gui/camera_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from sashimi.hardware.cameras.interface import CameraWarning
from sashimi.config import read_config
from enum import Enum
from multiprocessing import Queue
from multiprocessing import Queue, Event

conf = read_config()

Expand Down Expand Up @@ -164,6 +164,19 @@ def __init__(self, state: State, timer: QTimer, style: str):
self.reset_contrast
)

self.add_scale_bar_units(" um")

def add_scale_bar_units(self, units: str) -> None:

scale_bar = self.viewer.window.qt_viewer.scale_bar
old_on_zoom_change = scale_bar._on_zoom_change

def _on_zoom_change(event: Event):
old_on_zoom_change(event)
scale_bar.text_node.text += units

scale_bar._on_zoom_change = _on_zoom_change

def get_fullframe_size(self):
"""Maximum size of the image at current binning. As stated above, we assume square sensors."""
binning = int(self.state.camera_settings.binning)
Expand Down

0 comments on commit 96385f8

Please sign in to comment.