mad_gui.plugins.example.StationaryMomentsDetector#

class mad_gui.plugins.example.StationaryMomentsDetector(parent=None)[source]#

Bases: BaseAlgorithm

An exemplary algorithm, which uses the data to create annotations.

Note: a label inherited from BaseRegionLabel with the name `Activity must have been passed to start_gui() in order for this algorithm to create annotations.

Methods

name()

Return a name, which is used to represent this Algorithm in a dropdown in the GUI.

process_data(plot_data)

Get labels from the data using an algorithm.

get_annotations

get_annotations(data: DataFrame)[source]#
classmethod name()[source]#

Return a name, which is used to represent this Algorithm in a dropdown in the GUI.

process_data(plot_data: Dict[str, PlotData])[source]#

Get labels from the data using an algorithm.

This method applies an algorithm to the passed data. For example it could be a peak detection algorithm, which then for example creates one mad_gui.plot_tools.labels.BaseRegionLabel between to consecutive peaks. This method can be accessed by the user by clicking the Use algorithm button in the GUI's sidebar. For more information and an example, see the part of Implement an algorithm in our online documentation.

Parameters:
plot_data

A dictionary, where keys are the names of the plots in the GUI and the values are instances of mad_gui.models.local.PlotData. These in turn keep the plotted sensor data, its sampling frequency, and the plotted annotations.

Returns
plot_data

The adapted dictionary, where you have for example changed the data or annotations.