7.5.3.3. pymodaq_gui.managers.roi_manager module

class pymodaq_gui.managers.roi_manager.CircularROI(index=0, pos=[0, 0], size=[10, 10], **kwargs)[source]

Bases: EllipseROI

class pymodaq_gui.managers.roi_manager.EllipseROI(index=0, pos=[0, 0], size=[10, 10], **kwargs)[source]

Bases: ROI

Elliptical ROI subclass with one scale handle and one rotation handle.

Arguments

pos

(length-2 sequence) The position of the ROI’s origin.

size

(length-2 sequence) The size of the ROI’s bounding rectangle.

**args

All extra keyword arguments are passed to ROI()

Methods

getArrayRegion(arr[, img, axes])

Return the result of ROI.getArrayRegion() masked by the elliptical shape of the ROI.

paint(self, painter, option[, widget])

shape(self)

getArrayRegion(arr, img=None, axes=(0, 1), **kwds)[source]

Return the result of ROI.getArrayRegion() masked by the elliptical shape of the ROI. Regions outside the ellipse are set to 0.

paint(self, painter: QPainter | None, option: QStyleOptionGraphicsItem | None, widget: QWidget | None = None)[source]
shape(self) QPainterPath[source]
class pymodaq_gui.managers.roi_manager.LinearROI(index=0, pos=[0, 10], name='roi', **kwargs)[source]

Bases: LinearRegionItem

Attributes:
color

Methods

contextMenuEvent(self, event)

pos(self)

setPos(setPos)

center

copy_clipboard

emit_index_signal

index_signal

setPen

center() float[source]
contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent | None)[source]
copy_clipboard()[source]
emit_index_signal()[source]
pos(self) QPointF[source]
setPen(color)[source]
setPos(self, pos: Union[QPointF, QPoint]) setPos(self, ax: float, ay: float)[source]
setPos(self, ax: float, ay: float) None
property color
index_signal

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

class pymodaq_gui.managers.roi_manager.ROI(*args, index=0, name='roi', **kwargs)[source]

Bases: ROI

Attributes:
color

Methods

center()

Get the center position of the ROI

contextMenuEvent(self, event)

copy_clipboard

emit_index_signal

height

index_signal

set_center

set_positions

width

center() QPointF[source]

Get the center position of the ROI

contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent | None)[source]
copy_clipboard()[source]
emit_index_signal()[source]
height() float[source]
set_center(center: QPointF | Tuple[float, float])[source]
set_positions()[source]
width() float[source]
property color
index_signal

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

class pymodaq_gui.managers.roi_manager.ROIBrushable(brush=None, *args, **kwargs)[source]

Bases: ROI

Methods

paint(self, painter, option[, widget])

setBrush(*br, **kargs)

Set the brush that fills the region.

paint(self, painter: QPainter | None, option: QStyleOptionGraphicsItem | None, widget: QWidget | None = None)[source]
setBrush(*br, **kargs)[source]

Set the brush that fills the region. Can have any arguments that are valid for mkBrush.

class pymodaq_gui.managers.roi_manager.ROIManager(viewer_widget=None, ROI_type='1D')[source]

Bases: QObject

Attributes:
ROIs

Methods

add_roi_programmatically

clear_ROI

color_signal

emit_colors

get_roi

get_roi_from_index

load_ROI

new_ROI_signal

remove_ROI_signal

remove_roi_programmatically

roi_changed

roi_format

roi_tree_changed

roi_update_children

roi_value_changed

save_ROI

set_roi

setupUI

update_roi

update_roi_tree

update_use_channel

add_roi_programmatically(roitype='RectROI')[source]
clear_ROI()[source]
emit_colors()[source]
get_roi(roi_key)[source]
get_roi_from_index(index: int) ROI[source]
load_ROI(path=None, params=None)[source]
remove_roi_programmatically(index: int)[source]
static roi_format(index)[source]
roi_tree_changed(param, changes)[source]
save_ROI()[source]
set_roi(roi_params, roi_params_new)[source]
setupUI()[source]
update_roi(roi_key, param)[source]
update_roi_tree(index)[source]
update_use_channel(channels: List[str])[source]
property ROIs
color_list = array([[255, 255, 255],        [255,   0,   0],        [  0, 255,   0],        [  0,   0, 255],        [ 14, 207, 189],        [207,  14, 166],        [207, 204,  14]])
color_signal

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

new_ROI_signal

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

remove_ROI_signal

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

roi_changed

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

roi_update_children

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

roi_value_changed

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

class pymodaq_gui.managers.roi_manager.ROIPositionMapper(roi_pos, roi_size)[source]

Bases: QWidget

Widget presenting a Tree structure representing a ROI positions.

Methods

show_dialog

show_dialog()[source]
class pymodaq_gui.managers.roi_manager.ROISaver(msgbox=False, det_modules=[])[source]

Bases: object

Methods

set_file_roi

set_new_roi

show_rois

set_file_roi(filename, show=True)[source]
set_new_roi(file=None)[source]
show_rois()[source]
class pymodaq_gui.managers.roi_manager.ROIScalableGroup(roi_type='1D', **opts)[source]

Bases: GroupParameter

Methods

addNew([typ])

This method is called when the user has requested to add a new item to the group.

addNew(typ='')[source]

This method is called when the user has requested to add a new item to the group. By default, it emits sigAddNew(self, typ).

class pymodaq_gui.managers.roi_manager.RectROI(index=0, pos=[0, 0], size=[10, 10], **kwargs)[source]

Bases: ROI

class pymodaq_gui.managers.roi_manager.SimpleRectROI(pos=[0, 0], size=[10, 10], centered=False, sideScalers=False, **args)[source]

Bases: ROI

Rectangular ROI subclass with a single scale handle at the top-right corner.