From c5fb0b704d1df4c6d7e56a354c1eb3188f22ec8d Mon Sep 17 00:00:00 2001 From: holler Date: Wed, 5 Nov 2025 13:11:54 +0100 Subject: [PATCH] updated gui section --- csaxs_bec/devices/ids_cameras/ids_camera.py | 30 ++++++++++++--------- docs/user/ptychography/flomni.md | 14 ++++++++++ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/csaxs_bec/devices/ids_cameras/ids_camera.py b/csaxs_bec/devices/ids_cameras/ids_camera.py index 3111d61..5fecb90 100644 --- a/csaxs_bec/devices/ids_cameras/ids_camera.py +++ b/csaxs_bec/devices/ids_cameras/ids_camera.py @@ -19,7 +19,6 @@ if TYPE_CHECKING: from bec_lib.devicemanager import ScanInfo from pydantic import ValidationInfo - logger = bec_logger.logger @@ -30,7 +29,8 @@ class IDSCamera(PSIDeviceBase): to interact with the IDS camera using the pyueye library. """ - image = Cpt(PreviewSignal, name="image", ndim=2, doc="Preview signal for the camera.") + image = Cpt(PreviewSignal, name="image", ndim=2, doc="Preview signal for the camera.", num_rotation_90=0, + transpose=False) roi_signal = Cpt( AsyncSignal, name="roi_signal", @@ -43,16 +43,18 @@ class IDSCamera(PSIDeviceBase): USER_ACCESS = ["live_mode", "mask", "set_rect_roi", "get_last_image"] def __init__( - self, - *, - name: str, - camera_id: int, - prefix: str = "", - scan_info: ScanInfo | None = None, - m_n_colormode: Literal[0, 1, 2, 3] = 1, - bits_per_pixel: Literal[8, 24] = 24, - live_mode: bool = False, - **kwargs, + self, + *, + name: str, + camera_id: int, + prefix: str = "", + scan_info: ScanInfo | None = None, + m_n_colormode: Literal[0, 1, 2, 3] = 1, + bits_per_pixel: Literal[8, 24] = 24, + live_mode: bool = False, + num_rotation_90: int = 0, + transpose: bool = False, + **kwargs, ): """Initialize the IDS Camera. @@ -77,6 +79,8 @@ class IDSCamera(PSIDeviceBase): self._live_mode = False self._inputs = {"live_mode": live_mode} self._mask = np.zeros((1, 1), dtype=np.uint8) + self.image.num_rotation_90 = num_rotation_90 + self.image.transpose = transpose ############## Live Mode Methods ############## @@ -127,7 +131,7 @@ class IDSCamera(PSIDeviceBase): if x + width > img_shape[1] or y + height > img_shape[0]: raise ValueError("ROI exceeds camera dimensions.") mask = np.zeros(img_shape, dtype=np.uint8) - mask[y : y + height, x : x + width] = 1 + mask[y: y + height, x: x + width] = 1 self.mask = mask def _start_live(self): diff --git a/docs/user/ptychography/flomni.md b/docs/user/ptychography/flomni.md index 560abd0..232af8f 100644 --- a/docs/user/ptychography/flomni.md +++ b/docs/user/ptychography/flomni.md @@ -88,6 +88,14 @@ Depending on the tomo mode following parameters can be given to the `flomni.tomo | Golden ratio tomography (sorted in bunches) | projection_number=None | | Equally spaced with golden starting angle | projection_number=None | +### GUI tools + +During operation the BEC GUI will show the relevant cameras or progress information. To manually switch view TAB completion on 'flomni.flomnigui_' will show all options to control the GUI. Most useful +'flomni.flomnigui_show_cameras()' will show the cameras for sample transfer and interior overview +'flomni.flomnigui_show_progress()' will show the measurement progress GUI +'flomnigui_show_xeyealign()' will show the XrayEye alignment GUI + + ## How to setup flOMNI (software) This part of the manual is intended for beamline staff and expert users @@ -218,9 +226,15 @@ Update the values by, example for feyex and in position, To refresh the frame of the xray eye windows software `flomni.xrayeye_update_frame()` +This command can also be called to keep the shutter open and live view active +`flomni.xrayeye_update_frame(keep_shutter_open=True)` + To start the xray eye alignment (and clear any previous alignment) `flomni.xrayeye_alignment_start()` +This command can also be called to keep the shutter open and live view active. Warning: The dose to the sample will be significantly higher. +`flomni.xrayeye_update_frame(keep_shutter_open=True)` + To load the fit parameters from directory _dir_path_ computed by _SPEC_ptycho_align.m_ in Matlab run `flomni.read_alignment_offset(dir_path='')` The loading routine uses default values for the vertical alignment. This behavior can be changed (e.g. for getting new default values) by the parameter `use_vertical_default_values=False`. -- 2.49.1