intan.applications package¶
GUI applications and launchers for EMG analysis and trial labeling.
Lightweight package exports for intan.applications.
Make imports lazy/guarded so importing the package doesn’t pull optional GUI, SciPy, or pandas dependencies during CLI or test runs.
Submodules¶
intan.processing._emg_viewer_gui
Graphical User Interface (GUI) for loading and visualizing EMG data.
The EMGViewer provides an interactive interface for exploring high-density EMG signals from Intan .rhd recordings. It supports: - Channel selection - Segment visualization - Preprocessing - Trigger-based analysis (if available)
Typically launched via _emg_launcher.py.
- class EMGViewerTk(root)[source]¶
Bases:
object- apply_visualization_filters(signal)[source]¶
Filtering for visualization using Filtering Tab controls.
- update_training_labels_from_directory()[source]¶
Helper function to refresh the training labels listbox with all the labels detected from the current directories
- refresh_labels_list()[source]¶
Clear and rebuild the labels list from all currently listed directories.
- update_training_labels_from_filename(fname)[source]¶
Extract label from filename and add to label list if not already present. Assumes filenames like: participant_label_0.npz
- run_trial_segmentation()[source]¶
Segment the EMG data into trials based on manual indices or notes files. Saves each segment as a compressed .npz file (with ‘emg’ data and ‘label’) in an ‘emg’ subfolder.
- extract_features_from_directories()[source]¶
Iterate over each selected directory of segmented trials, apply filters, extract features, and aggregate the results. Saves individual feature files and builds a dataset.
- extract_td_features(segment)[source]¶
Computes a variety of unique features from segmented EMG data. Input shape expects (channels x samples).
- EMGViewer¶
alias of
EMGViewerTk
intan.processing._emg_trial_selector
Graphical tool for interactively labeling trial events on EMG recordings.
This GUI allows researchers to: - Load and visualize EMG signals from .rhd files - Select individual channels - Click to mark trial onset points - Assign labels to each indexed event - Append new recordings for multi-session review - Export trial events to a timestamped CSV or TXT file
Clicking the signal while “Set Trial Index” is enabled will add a labeled marker. This tool is useful for supervised training of gesture classifiers, post-hoc annotation, or protocol validation in EMG experiments.
- class EMGTrialSelector(root)[source]¶
Bases:
objectTkinter-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
- 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
- update_channel(event=None)[source]¶
Update the current channel based on the selection from the dropdown.
Launch the packaged desktop applications.