hyperspyui.tools module

Created on Sun Dec 07 03:06:55 2014

@author: Vidar Tonaas Fauske

class hyperspyui.tools.FigureTool(windows=None)

Bases: Tool

static _iter_windows(windows)
_wire(canvas, local_key, mpl_key)

Connect an MPL event to an instance method, if the method is defined on the current instance. The local method is defined by ‘local_key’.

connect_windows(windows)

Connects the tool to the windows that are passed. This means that it connects to the appropriate MPL events of each window.

disconnect_windows(windows)
get_cursor(widget=None)

Get the cursor for the supplied widget. Is applied when a widget is connected to the Tool.

get_pixel_size(event)

Get the point size in data units

get_window(event)

Get the window for the event

make_cursor()

Initialize the cursor for this instance. Is called in constructor.

class hyperspyui.tools.GaussianTool(windows=None)

Bases: FigureTool

_unwire_wrapper(wrapper)
_wire_wrapper(wrapper)
connect_windows(windows)

Connects the tool to the windows that are passed. This means that it connects to the appropriate MPL events of each window.

disconnect_windows(windows)
get_category()
get_icon()
get_name()
is_selectable()
make_cursor()

Initialize the cursor for this instance. Is called in constructor.

on_mousedown(event)
on_mousemove(event)
on_pick(event)
on_spanselect(x0, x1)
class hyperspyui.tools.HomeTool(windows=None)

Bases: FigureTool

get_category()
get_icon()
get_name()
home(axes=None)
on_keyup(event)
single_action()
class hyperspyui.tools.LineTool(windows=None)

Bases: SignalFigureTool

Tool to select a ROI on a signal interactively. Simply click and drag in a figure to create an ROI, and then press enter to indicate that the selection is complete, or ESC to cancel. The selection can also be aborted by simply selecting a different tool.

_on_change(widget)
accept()
accepted

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

cancel()
cancelled

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

disconnect_windows(windows)
get_category()
get_name()
in_ax(ax)
is_on()
is_selectable()
make_cursor()

Initialize the cursor for this instance. Is called in constructor.

property ndim
on_keyup(event)
on_mousedown(event)
updated

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

property widget
class hyperspyui.tools.MultiSelectionTool(windows=None)

Bases: SignalFigureTool

Tool to select multiple ROIs on a signal interactively. Simply click and drag in a figure to create an ROI. This can be done multiple times. Right- click the ROI to remove it. Press enter to indicate that the selection is complete, or ESC to cancel. The selection can also be aborted by simply selecting a different tool.

_add_widget(signal)
_cancel(signal)
_default_validator(signal, axes)
_get_rois(signal)
_on_change(widget, signal=None)
_remove_widget(widget, signal=None)
accept(signal)
accepted

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

cancel(signal=None)
cancelled

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

disconnect_windows(windows)
get_category()
get_icon()
get_name()
have_selection(signal)
is_selectable()
make_cursor()

Initialize the cursor for this instance. Is called in constructor.

ndim(signal)
on_keyup(event)
on_mousedown(event)
on_mouseup(event)
updated

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 hyperspyui.tools.PointerTool(windows=None)

Bases: FigureTool

get_category()
get_icon()
get_name()
is_selectable()
class hyperspyui.tools.SelectionTool(windows=None, name=None, category=None, icon=None, description=None)

Bases: SignalFigureTool

Tool to select a ROI on a signal interactively. Simply click and drag in a figure to create an ROI, and then press enter to indicate that the selection is complete, or ESC to cancel. The selection can also be aborted by simply selecting a different tool.

accept()
accepted

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

cancel()
cancelled

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

disconnect_windows(windows)
get_category()
get_icon()
get_name()
in_ax(ax)
is_on()
is_selectable()
make_cursor()

Initialize the cursor for this instance. Is called in constructor.

property ndim
on_keyup(event)
on_mousedown(event)
updated

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

property widget
class hyperspyui.tools.SignalFigureTool(windows=None)

Bases: FigureTool

_get_axes(event)
_get_signal(figure)
_get_wrapper(figure)
_is_nav(event)
_is_sig(event)
class hyperspyui.tools.Tool

Bases: QObject

connect(targets=None)
disconnect(a0: QMetaObject.Connection) bool
disconnect(self) None
get_category()
get_description()
get_icon()
get_name()
is_selectable()
single_action()
class hyperspyui.tools.ZoomPanTool(windows=None)

Bases: FigureTool

connect_windows(windows)

Connects the tool to the windows that are passed. This means that it connects to the appropriate MPL events of each window.

disconnect_windows(windows)
get_category()
get_icon()
get_name()
is_selectable()
make_cursor()

Initialize the cursor for this instance. Is called in constructor.

on_mousedown(event)
on_mousemove(event)
on_mouseup(event)
on_scroll(event)