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, ...])

accept_recording()

Accepts the current recording and saves the data to a pickle file.

check_recording_completion()

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.

finish_recording()

Finishes the recording process and switches to the review recording interface.

initialize_ui_logic()

Initializes the logic for the UI elements.

reject_recording()

Rejects the current recording and resets the recording interface.

reset_ui()

Resets the recording interface UI elements.

start_recording(checked)

Starts the recording process.

start_recording_preparation()

Prepares the recording process by checking if the device is streaming.

update_ground_truth_buffer(data)

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

disable()[source]#

Disable the UI elements.

enable()[source]#

Enable the UI elements.

finish_recording()[source]#

Finishes the recording process and switches to the review recording interface.

Return type:

None

initialize_ui_logic()[source]#

Initializes the logic for the UI elements.

Return type:

None

reject_recording()[source]#

Rejects the current recording and resets the recording interface.

Return type:

None

reset_ui()[source]#

Resets the recording interface UI elements.

Return type:

None

start_recording(checked)[source]#

Starts the recording process.

Parameters:

checked (bool)

Return type:

None

start_recording_preparation()[source]#

Prepares the recording process by checking if the device is streaming.

Return type:

bool

update_ground_truth_buffer(data)[source]#

Updates the buffer with the incoming kinematics data.

Parameters:

data (ndarray)

Return type:

None