VirtualHandInterface_RecordingInterface#
- class myogestic.gui.widgets.visual_interfaces.virtual_hand_interface.VirtualHandInterface_RecordingInterface(main_window, name='VirtualHandInterface', incoming_message_signal=None)[source]#
Class for the recording interface of the Virtual Hand Interface.
This class is responsible for handling the recording of EMG and kinematics data.
- Parameters:
main_window (MainWindow) – The main window of the application.
name (str) –
The name of the interface, by default “VirtualHandInterface”.
Important
This name is used to identify the interface in the main window. It should be unique.
incoming_message_signal (SignalInstance) – The signal instance used to receive incoming messages from the device.
Methods
__init__
(main_window[, name, ...])Accepts the current recording and saves the data to a pickle file.
Checks if the recording process is complete and finishes it if so.
close_event
(_)Closes the recording interface.
disable
()Disable the UI elements.
enable
()Enable the UI elements.
Finishes the recording process and switches to the review recording interface.
Initializes the logic for the UI elements.
Rejects the current recording and resets the recording interface.
reset_ui
()Resets the recording interface UI elements.
start_recording
(checked)Starts the recording process.
Prepares the recording process by checking if the device is streaming.
Updates the buffer with the incoming kinematics data.
- accept_recording()[source]#
Accepts the current recording and saves the data to a pickle file.
The saved data is a dictionary containing:
emg: A 2D NumPy array of EMG signals with time samples as rows and channels as columns.
kinematics: A 2D NumPy array of kinematics data (empty if not used).
timings_emg: A 1D NumPy array of timestamps for EMG samples.
timings_kinematics: A 1D NumPy array of timestamps for kinematics samples (empty if not used).
label: The user-provided label for the recording.
task: The task being recorded.
device: The name of the device used for recording.
bad_channels: A list of channels marked as “bad.”
_sampling_frequency: The EMG sampling frequency.
kinematics_sampling_frequency: The kinematics sampling frequency.
recording_time: The recording duration in seconds.
use_kinematics: Boolean indicating whether kinematics data was recorded.
- Return type:
None
- check_recording_completion()[source]#
Checks if the recording process is complete and finishes it if so.
- Return type:
None
- close_event(_)[source]#
Closes the recording interface.
- Parameters:
_ (QCloseEvent)
- Return type:
None
- finish_recording()[source]#
Finishes the recording process and switches to the review recording interface.
- Return type:
None
- reject_recording()[source]#
Rejects the current recording and resets the recording interface.
- Return type:
None
- start_recording(checked)[source]#
Starts the recording process.
- Parameters:
checked (bool)
- Return type:
None