pyoephys.applications package

Viewer exports, loaded when requested so standalone applications stay lightweight.

EMGViewer

alias of EMGViewerQt

class EMGTrialSelector(root)[source]

Bases: object

Tkinter-based application for manual EMG trial indexing.

emg_data

EMG signal matrix (channels × samples)

Type:

np.ndarray

time_vector

Time vector aligned with EMG samples

Type:

np.ndarray

sampling_rate

Sampling rate of amplifier

Type:

float

current_channel

Channel index currently displayed

Type:

int

indexing_enabled

If True, allows user to click to insert marker

Type:

bool

load_file()[source]

Load EMG data from a file and initialize the GUI with the first channel.

sample_index_to_timestamp(index)[source]

Convert a sample index to a timestamp string.

Parameters:

index (int) – Sample index to convert.

Returns:

Formatted timestamp string (HH:MM:SS).

Return type:

str

save_table()[source]

Save the trial markers to a text file with sample index and timestamp.

delete_selected()[source]

Delete selected rows from the table.

extract_edges()[source]
clear_indices()[source]

Clear all rows in the table and remove drawn marker lines.

update_channel(event=None)[source]

Update the current channel based on the selection from the dropdown.

enable_indexing()[source]

Enable the indexing mode to allow trial marking on the plot.

on_click(event)[source]

Handle mouse click events on the plot to mark trial onset points.

Parameters:

event (matplotlib.backend_bases.Event) – The mouse event.

plot_channel()[source]

Plot the currently selected EMG channel.

on_closing()[source]
class RealTimeEMGViewer(host='127.0.0.1', port=5556, channels=None)[source]

Bases: QMainWindow

init_ui()[source]
toggle_connection()[source]
load_model()[source]

Load a PyTorch model from file.

update_plot()[source]