8.5.5.2.4. pymodaq_gui.plotting.items.roi module
- class pymodaq_gui.plotting.items.roi.CircularROI(index=0, pos=[0, 0], size=[10, 10], **kwargs)[source]
Bases:
EllipseROI
- class pymodaq_gui.plotting.items.roi.DataDim(*values)[source]
Bases:
StrEnum- Data1D = 'Data1D'
- Data2D = 'Data2D'
- class pymodaq_gui.plotting.items.roi.EllipseROI(index=0, pos=[0, 0], size=[10, 10], **kwargs)[source]
Bases:
ROIElliptical 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.
- class pymodaq_gui.plotting.items.roi.LinearROI(index=0, pos=[0, 10], name='roi', compute=True, **kwargs)[source]
Bases:
LinearRegionItem,ROIMixin,ROIBase- Attributes:
- color
Methods
contextMenuEvent(self, event)pos(self)setPos(setPos)center
contextMenuEnabled
copy_clipboard
getMenu
mouseClickEvent
raiseContextMenu
setPen
sigCopyRequested
sigDoubleClicked
sigRemoveRequested
- setPos(self, pos: QPointF) setPos(self, ax: float, ay: float)[source]
- setPos(self, ax: float, ay: float) None
- property color
- sigCopyRequested
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
- sigDoubleClicked
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
- sigRemoveRequested
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.plotting.items.roi.ROI(*args, index=0, name='roi', compute=True, **kwargs)[source]
-
Base class for all 2D ROI
- Attributes:
- color
Methods
center()Get the center position of the ROI
contextMenuEvent(self, event)set_center(center)Set the center position of the ROI
contextMenuEnabled
copy_clipboard
getMenu
height
mouseClickEvent
raiseContextMenu
sigCopyRequested
sigDoubleClicked
sigRemoveRequested
width
- property color
- sigCopyRequested
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
- sigDoubleClicked
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
- sigRemoveRequested
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.plotting.items.roi.ROIBase[source]
Bases:
objectBase class to be inherited for ROI to be created by the factory
- class pymodaq_gui.plotting.items.roi.ROIBrushable(brush=None, *args, **kwargs)[source]
Bases:
ROIMethods
paint(self, painter, option[, widget])setBrush(*br, **kargs)Set the brush that fills the region.
- class pymodaq_gui.plotting.items.roi.ROIFactory[source]
Bases:
objectThe factory class for creating ROI
Methods
create(dimensionality, descriptor, *args, ...)Factory command to create the ROI object.
Returns a list of ROi descriptors for a given dimensionality
Returns a list of registered dimensionality
register()Class decorator method to register ROI class to the internal registry.
- classmethod create(dimensionality: DataDim, descriptor: str, *args, **kwargs) ROIBase[source]
Factory command to create the ROI object. This method gets the appropriate ROI class from the registry and instantiates it. :param dimensionality: the dimensionality of the ROI :type dimensionality: DataDim :param descriptor: the roi descriptor string :type descriptor: str
- Return type:
an instance of the ROI created
- classmethod get_descriptors_from_dimensionality(dim: DataDim)[source]
Returns a list of ROi descriptors for a given dimensionality
- classmethod register() Callable[source]
Class decorator method to register ROI class to the internal registry. Must be used as decorator above the definition of a ROI class.
- registry = {DataDim.Data1D: {'LinearROI': <class 'pymodaq_gui.plotting.items.roi.LinearROI'>}, DataDim.Data2D: {'CircularROI': <class 'pymodaq_gui.plotting.items.roi.CircularROI'>, 'EllipseROI': <class 'pymodaq_gui.plotting.items.roi.EllipseROI'>, 'RectROI': <class 'pymodaq_gui.plotting.items.roi.RectROI'>}}
- class pymodaq_gui.plotting.items.roi.ROIMixin(index=0, name='roi', compute=True)[source]
Bases:
QObject- Attributes:
- compute
Methods
center
color
copy_clipboard
doShow
emit_index_signal
getMenu
height
index_signal
key
mouseClickEvent
mouseDoubleClickEvent
type
width
- property compute
- 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.plotting.items.roi.ROIPositionMapper(roi_pos, roi_size)[source]
Bases:
QWidgetWidget presenting a Tree structure representing a ROI positions.
Methods
show_dialog
- class pymodaq_gui.plotting.items.roi.RectROI(index=0, pos=[0, 0], size=[10, 10], **kwargs)[source]
Bases:
ROI