8.5.3.3. pymodaq_gui.managers.roi_manager module

class pymodaq_gui.managers.roi_manager.ROIManager(viewer_widget=None, ROI_type=DataDim.Data1D)[source]

Bases: QObject

Attributes:
ROIs

Methods

copy_ROI(roi)

Method to copy a ROI and add it to the parameter tree and to the viewer widget The method extracts the parameters of the copied ROI, create a new parameter, a new ROI and update it with the settings from the copied parameter :param roi: the ROI to be copied :type roi: ROI

make_ROI1D(index, pos[, compute])

Convenience function to make custom ROI_1D

make_ROI2D(descriptor, index, pos, size[, ...])

Convenience function to make custom ROI_2D

remove_ROI(roi)

Function to remove roi from dict and widget

update_use_channel(channels[, index])

Function to update the selected channels.

add_ROI

add_roi_programmatically

clear_ROI

color_signal

emit_colors

expand_roi_tree

get_ROI_indexes

get_parameter

get_roi

get_roi_from_index

load_ROI

make_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_pos

update_roi_tree

static roi_format(index)[source]
add_ROI(roi)[source]
add_roi_programmatically(descriptor: str = 'CircularROI')[source]
clear_ROI()[source]
copy_ROI(roi: ROI)[source]

Method to copy a ROI and add it to the parameter tree and to the viewer widget The method extracts the parameters of the copied ROI, create a new parameter, a new ROI and update it with the settings from the copied parameter :param roi: the ROI to be copied :type roi: ROI

emit_colors()[source]
expand_roi_tree(roi)[source]
get_ROI_indexes()[source]
get_parameter(roi)[source]
get_roi(roi_key)[source]
get_roi_from_index(index: int) ROI[source]
load_ROI(path=None, params=None)[source]
make_ROI(param: Parameter)[source]
make_ROI1D(index, pos, compute=True, **kwargs)[source]

Convenience function to make custom ROI_1D

Parameters:
  • index (int) – Current index of ROI

  • pos – Initial position of ROI

Returns:

LinearROI

Return type:

roi

make_ROI2D(descriptor: str, index, pos, size, compute=True, **kwargs)[source]

Convenience function to make custom ROI_2D

Parameters:
  • descriptor (str) – name of 2D ROI

  • index (int) – Current index of ROI

  • pos – Initial position of ROI

  • size – Initial size of ROI

Returns:

pg.ROI

Return type:

roi

remove_ROI(roi)[source]

Function to remove roi from dict and widget

Parameters:

roi (pg.ROI) – roi to be removed

remove_roi_programmatically(index: int)[source]
roi_tree_changed(param, changes)[source]
save_ROI()[source]
set_roi(roi_params, roi_params_new)[source]
setupUI()[source]
update_roi(roi: ROI, param: Parameter)[source]
update_roi_pos(pos, param)[source]
update_roi_tree(roi)[source]
update_use_channel(channels: List[str], index=None)[source]

Function to update the selected channels. If no index is given, the channels are applied to all ROIs.

Parameters:
  • channels (List[str]) – channels list from a viewer

  • index (int, optional) – ROI index. Defaults to None.

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.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=DataDim.Data1D, **opts)[source]

Bases: GroupParameter

Methods

addNew([typ])

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

makeChannelsParam

makeChild

makeDisplayParam

makeMathParam

make_ROIParam1D

make_ROIParam2D

static makeChannelsParam(dim=DataDim.Data2D)[source]
static makeDisplayParam(index)[source]
static makeMathParam(dim=DataDim.Data2D)[source]
static make_ROIParam1D(descriptor: str, index)[source]
static make_ROIParam2D(descriptor: str, index)[source]
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).

makeChild(index, descriptor: str)[source]
pymodaq_gui.managers.roi_manager.roi_format(index)[source]