1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-09 18:27:52 +01:00

fix(image_roi): position can be set from rpc

This commit is contained in:
2025-05-21 17:56:54 +02:00
committed by Jan Wyzula
parent 7a531c17d6
commit 41b7ca8e64
3 changed files with 58 additions and 0 deletions

View File

@@ -602,6 +602,16 @@ class BaseROI(RPCBase):
ndarray: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True.
"""
@rpc_call
def set_position(self, x: "float", y: "float"):
"""
Sets the position of the ROI.
Args:
x (float): The x-coordinate of the new position.
y (float): The y-coordinate of the new position.
"""
class CircularROI(RPCBase):
"""Circular Region of Interest with center/diameter tracking and auto-labeling."""
@@ -701,6 +711,16 @@ class CircularROI(RPCBase):
ndarray: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True.
"""
@rpc_call
def set_position(self, x: "float", y: "float"):
"""
Sets the position of the ROI.
Args:
x (float): The x-coordinate of the new position.
y (float): The y-coordinate of the new position.
"""
class Curve(RPCBase):
@rpc_call
@@ -2652,6 +2672,16 @@ class RectangularROI(RPCBase):
ndarray: Pixel data inside the ROI, or (data, coords) if *returnMappedCoords* is True.
"""
@rpc_call
def set_position(self, x: "float", y: "float"):
"""
Sets the position of the ROI.
Args:
x (float): The x-coordinate of the new position.
y (float): The y-coordinate of the new position.
"""
class ResetButton(RPCBase):
"""A button that resets the scan queue."""

View File

@@ -113,6 +113,7 @@ class BaseROI(BECConnector):
"line_width.setter",
"get_coordinates",
"get_data_from_image",
"set_position",
]
def __init__(
@@ -333,6 +334,16 @@ class BaseROI(BECConnector):
def add_scale_handle(self):
return
def set_position(self, x: float, y: float):
"""
Sets the position of the ROI.
Args:
x (float): The x-coordinate of the new position.
y (float): The y-coordinate of the new position.
"""
self.setPos(x, y)
def remove(self):
handles = self.handles
for i in range(len(handles)):