Region of Interest Fields

class pumpia.module_handling.fields.roi_fields.BaseROIField(name: str | None = None, *, default_type: Literal['Angle', 'ROI point', 'ROI circle', 'ROI ellipse', 'ROI square', 'ROI rectangle', 'ROI line'] = 'ROI ellipse', allow_manual_draw: bool = True, button_style: str | None = None)

Base class for ROI Fields.

Parameters:
  • name (str, optional) – The name of the ROI(default is None).

  • default_type (ManualROIType) – The default ROI type to draw (default is “ROI ellipse”).

  • show_button (bool, optional) – Whether to show the button to select the ROI as active(default is True).

  • button_style (str, optional) – The style of the show_button (default is None).

name
Type:

str | None

roi
Type:

BaseROI | None

default_type
Type:

ManualROIType

self.viewer

This must be set for manual drawing to work. Modules will set this to their main viewer by default, this behaviour can be overridden.

Type:

BaseViewer | None

post_register_command

Command called after ROI is registered. This should accept an ROI and a boolean indicating if it was a manual draw.

Type:

Callable[[BaseROIField, bool|None], Any]

label_var
Type:

tk.StringVar

select_button
Type:

ttk.Button

draw_button
Type:

ttk.Button

register_roi(roi: ROI)

Registers an ROI.

set_parent(parent: tk.Misc)

Sets the parent of the ROI.

set_manager(manager: Manager)

Sets the manager of the ROI.

set_as_active()

Sets the ROI as the active ROI.

class pumpia.module_handling.fields.roi_fields.GeneralROIField(name: str | None = None, *, default_type: Literal['Angle', 'ROI point', 'ROI circle', 'ROI ellipse', 'ROI square', 'ROI rectangle', 'ROI line'] = 'ROI ellipse', allow_manual_draw: bool = True, button_style: str | None = None)

Represents a general ROI input. Has the same attributes and methods as BaseROIField unless stated below.

class pumpia.module_handling.fields.roi_fields.RectangleROIField(name: str | None = None, *, allow_manual_draw: bool = True, button_style: str | None = None)

Represents a RectangleROI input. Has the same attributes and methods as BaseROIField unless stated below.

class pumpia.module_handling.fields.roi_fields.EllipseROIField(name: str | None = None, *, allow_manual_draw: bool = True, button_style: str | None = None)

Represents an EllipseROI input. Has the same attributes and methods as BaseROIField unless stated below.

class pumpia.module_handling.fields.roi_fields.LineROIField(name: str | None = None, *, allow_manual_draw: bool = True, button_style: str | None = None)

Represents a LineROI input. Has the same attributes and methods as BaseROIField unless stated below.

class pumpia.module_handling.fields.roi_fields.AngleROIField(name: str | None = None, *, allow_manual_draw: bool = True, button_style: str | None = None)

Represents an Angle ROI input. Has the same attributes and methods as BaseROIField unless stated below.

class pumpia.module_handling.fields.roi_fields.PointROIField(name: str | None = None, *, allow_manual_draw: bool = True, button_style: str | None = None)

Represents a PointROI input. Has the same attributes and methods as BaseROIField unless stated below.