mad_gui.windows.MainWindow#
- class mad_gui.windows.MainWindow(parent=None, data_dir=None, settings=<class 'mad_gui.config.settings.BaseSettings'>, theme=<class 'mad_gui.config.theme.BaseTheme'>, plugins=None, labels=None, events=None)[source]#
This class implements the functionalities of the buttons in the GUI. Furthermore, it serves as an interface to Input-Output files, which are different for each data source, see our General Information part of the docs, section Adding support for other systems.
Methods
export
()Called when clicking the Export data button.
Start dialog to import data.
load_data_from_pickle
(file)Load data from a .mad_gui file.
Saves the displayed sensor data, sampling rate and displayed activity and stride labels into a pickle file.
Applies an algorithm to the plotted IMU data.
check_arguments
is_data_plotted
load_video
on_main_buttons_clicked
- __init__(parent=None, data_dir=None, settings=<class 'mad_gui.config.settings.BaseSettings'>, theme=<class 'mad_gui.config.theme.BaseTheme'>, plugins=None, labels=None, events=None)[source]#
- export()[source]#
Called when clicking the Export data button.
This button should be used to calculate features from the annotations. For example to calculate a mean length of certain activities or strides. To do so, it a
mad_gui.ExportResultsWindow
, which basically just is used to select one of the exporters inmad_gui.plugins
.
- import_data()[source]#
Start dialog to import data.
This will open a
mad_gui.LoadDataWindow
. In there, the user can select data to be loaded:sensor data
annotations
video
Additionally, the user can select the system that was used to record the sensor data and annotations. Depending on this selection, the path of the data to be loaded will be passed to the regarding importer in
mad_gui.plugins
.
- load_data_from_pickle(file: str)[source]#
Load data from a .mad_gui file.
- Parameters:
- file
Full path to to a file that ends with .mad_gui. This file was previously created using
save_data_gui_format()
and contains sensor data, activity labels and stride labels. However, the user might previously have selected that not all of those should be loaded. Which parts should be loaded is stored in self.data_types.
- save_data_gui_format()[source]#
Saves the displayed sensor data, sampling rate and displayed activity and stride labels into a pickle file.
The file ending will be .mad_gui to make clear it can be loaded again by this GUI. The data can be re-loaded into the GUI using the Load Data GUI format button. If you want to load this data in an other application / script you can so by using
pandas.read_pickle()
.
- use_algorithm()[source]#
Applies an algorithm to the plotted IMU data.
This will basically call
mad_gui.plugins.BaseImporter.annotation_from_data()
. Instead of the BaseImporter a different importer specified in themad_gui.LoadDataWindow
(dropdown menu) might be used.The activity and/or stride labels that will be generated by that method will then be passed to the plots, which will subsequently plot the labels, see
mad_gui.plot_tools.SensorPlot.set_activity_labels()
andmad_gui.plot_tools.SensorPlot._set_stride_labels()
.