RecordingInterfaceTemplate#
- class myogestic.gui.widgets.templates.RecordingInterfaceTemplate(*args, **kwargs)[source]#
Base class for the recording interface of a visual interface.
This class contains the logic and the UI elements of the recording interface of a visual interface.
- Parameters:
- _main_window#
The _main_window widget of the visual interface.
- Type:
Optional[QObject]
- incoming_message_signal#
The incoming message signal of the visual interface.
- Type:
PySide6.QtCore.SignalInstance
- ground_truth__nr_of_recording_values#
The number of recording values the visual interface sends to MyoGestic.
- Type:
- ground_truth__task_map#
The task map. The keys are the task names and the values are the task indices.
Methods
__init__(main_window[, name, ui, ...])_set_progress_bar(progress_bar, value, total)Set the value of a progress bar.
Check if this VI's recording is complete and notify the protocol.
close_event(event)Close the interface and stop necessary processes.
disable()Disable all UI elements.
enable()Enable all UI elements.
Get ground truth data collected during recording.
Initialize the logic of the UI elements.
save_recording(biosignal, biosignal_timings, ...)Save the recording.
save_recording_cursor(biosignal, ...)Save the recording for the cursor.
Validate state and prepare for recording.
Append incoming ground truth data and update the progress bar.
- check_recording_completion()[source]#
Check if this VI’s recording is complete and notify the protocol.
Called after each buffer update to determine whether enough samples have been collected.
- Return type:
None
- abstractmethod close_event(event)[source]#
Close the interface and stop necessary processes.
- Parameters:
event (PySide6.QtGui.QCloseEvent)
- Return type:
None
- get_ground_truth_data()[source]#
Get ground truth data collected during recording.
Returns a dict with ground truth arrays and metadata. Base implementation returns empty data (classification-only). Override in subclasses that collect kinematics.
- Return type:
- abstractmethod initialize_ui_logic()[source]#
Initialize the logic of the UI elements.
- Return type:
None
- save_recording(biosignal, biosignal_timings, ground_truth, ground_truth_timings, record_duration, use_as_classification, recording_label, task, ground_truth_sampling_frequency, **kwargs)[source]#
Save the recording.
- Parameters:
biosignal (numpy.ndarray) – The recorded biosignal data.
biosignal_timings (numpy.ndarray) – The recorded biosignal timings.
ground_truth (numpy.ndarray) – The recorded ground truth data.
ground_truth_timings (numpy.ndarray) – The recorded ground truth timings.
record_duration (int | float) – The duration of the recording in seconds.
use_as_classification (bool) – Whether to use the recording as classification data.
recording_label (str) – The label of the recording.
task (str) – The task of the recording.
ground_truth_sampling_frequency (int | float) – The sampling frequency of the ground truth data.
kwargs (dict) – Additional custom data to save.
- Return type:
None
- save_recording_cursor(biosignal, biosignal_timings, ground_truth, ground_truth_timings, record_duration, use_as_classification, recording_label, task, movement, task_label_map, ground_truth_sampling_frequency, **kwargs)[source]#
Save the recording for the cursor.
- Parameters:
biosignal (numpy.ndarray) – The recorded biosignal data.
biosignal_timings (numpy.ndarray) – The recorded biosignal timings.
ground_truth (numpy.ndarray) – The recorded ground truth data.
ground_truth_timings (numpy.ndarray) – The recorded ground truth timings.
record_duration (int | float) – The duration of the recording in seconds.
use_as_classification (bool) – Whether to use the recording as classification data.
recording_label (str) – The label of the recording.
task (str) – The task of the recording (cursor direction).
movement (str) – The movement associated with the cursor task label.
task_label_map (dict[str, int]) – String task to numerical table mapping.
ground_truth_sampling_frequency (int | float) – The sampling frequency of the ground truth data.
kwargs (dict) – Additional custom data to save.
- Return type:
None
- start_recording_preparation()[source]#
Validate state and prepare for recording.
Called by the RecordProtocol before each recording starts. Override to clear buffers, calculate expected samples, and validate that the VI is ready to record.
Returns
Trueif the VI is ready,Falseotherwise.- Return type: