RecordProtocol#

class myogestic.gui.protocols.RecordProtocol(main_window)[source]#

Protocol for recording EMG and kinematics data.

This class provides methods for recording EMG and kinematics data during specified tasks. It enables users to specify the recording duration, task type, and label, and handles the data recording process.

Parameters:

main_window (MyoGestic) – The parent application that manages the recording protocol.

_selected_visual_interface#

The visual interface used for the recording.

Type:

Optional[VisualInterfaceTemplate]

_sampling_frequency#

Sampling frequency of the biosignal device.

Type:

Optional[int]

_total_samples_to_record#

Total number of samples to be recorded.

Type:

int

_biosignal__buffer#

Buffer for storing timestamped EMG data samples.

Type:

list[Tuple[float, np.ndarray]]

is_biosignal_recording_complete#

Indicates if the EMG recording process has completed.

Type:

bool

recording_start_time#

Start time of the recording session.

Type:

float

Methods

__init__(main_window)

_complete_recording_process()

Finalize the recording process.

_reset_recording_ui()

Reset the recording UI and clear the buffer.

close_event(_)

Handle the close event for the recording protocol.

retrieve_recorded_data()

Retrieve recorded EMG data and timestamps.

start_recording_preparation(duration)

Prepare for EMG data recording.

update_biosignal_buffer(data)

Update the buffer with incoming EMG data.

close_event(_)[source]#

Handle the close event for the recording protocol.

Parameters:

_ (QCloseEvent)

Return type:

None

retrieve_recorded_data()[source]#

Retrieve recorded EMG data and timestamps.

Returns:

A tuple of EMG data and corresponding timestamps.

Return type:

Tuple[np.ndarray, np.ndarray]

start_recording_preparation(duration)[source]#

Prepare for EMG data recording.

Parameters:

duration (float) – Duration of the recording in seconds.

Returns:

True if preparation succeeds, False otherwise.

Return type:

bool

update_biosignal_buffer(data)[source]#

Update the buffer with incoming EMG data.

Parameters:

data (np.ndarray) – New EMG data sample.

Return type:

None