# oagld/emg_and_skin-temperature_data_collection architecture

> Architecture diagram of the GitHub repository oagld/emg_and_skin-temperature_data_collection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oagld/emg_and_skin-temperature_data_collection
- Repository: https://github.com/oagld/emg_and_skin-temperature_data_collection

## Overview

This repository is an EMG/BioArmband acquisition and gesture-training application. Its principal workflow starts in `main.py`: configuration selects modalities and collection settings, the streamer acquires device data into shared memory, an online handler exposes that stream, and the session menu launches training and related tools. The graph preserves the separate screen-guided collection, media, quality-check, and analysis capabilities. Edges are limited to relationships shown in excerpts or the source index; unsampled internals are not assumed.

Main entry points: [`main.py`](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/main.py) (Application setup), [`menu.py`](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/menu.py) (Session menu), [`CustomLibEMG/Streamer/_sifi_bridge_streamer.py`](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/Streamer/_sifi_bridge_streamer.py) (Device stream process), [`CustomLibEMG/streamers.py`](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/streamers.py) (Streamer factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Session orchestration"]
  node_entry["Application setup<br/>[main.py]"]
  node_session["Session menu<br/>[menu.py]"]
  node_gesture_media["Gesture media setup<br/>[Auxiliary.py]"]
end

subgraph group_acquisition["Signal acquisition"]
  node_device["SiFi armband"]
  node_stream_api["Streamer factory<br/>[streamers.py]"]
  node_stream_process["Device stream process"]
  node_shared_memory[("Shared-memory manager")]
  node_online_data["Online data handler"]
end

subgraph group_training["Gesture training"]
  node_training_gui["Training GUI<br/>[gui.py]"]
  node_collection_panel["Collection panel"]
  node_odh_collection_panel["ODH collection panel"]
  node_media_support["Media handling<br/>[_utils.py]"]
end

subgraph group_analysis["Monitoring and analysis"]
  node_quality_check["Continuous data QA<br/>[Auxiliary.py]"]
  node_data_analysis["Online analysis and logging"]
end

node_operator(("Operator"))
node_sifi_bridge["SiFi Bridge"]

node_operator -->|"starts"| node_entry
node_entry -->|"starts acquisition"| node_stream_api
node_entry -->|"creates handler"| node_online_data
node_entry -->|"downloads media"| node_gesture_media
node_entry -->|"launches menu"| node_session
node_stream_api -->|"starts process"| node_stream_process
node_stream_process -->|"uses manager"| node_shared_memory
node_stream_process -->|"connects and streams"| node_sifi_bridge
node_session -->|"imports GUI"| node_training_gui
node_session -->|"imports QA tools"| node_quality_check
node_training_gui -->|"creates panel"| node_collection_panel
node_collection_panel -->|"uses utilities"| node_media_support
node_odh_collection_panel -->|"uses utilities"| node_media_support
node_operator -.->|"uses controls"| node_session
node_online_data -->|"provides analysis tools"| node_data_analysis

click node_entry "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/main.py"
click node_session "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/menu.py"
click node_gesture_media "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/Auxiliary.py"
click node_stream_api "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/streamers.py"
click node_stream_process "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/Streamer/_sifi_bridge_streamer.py"
click node_shared_memory "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/Streamer/shared_memory_manager.py"
click node_online_data "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/OnlineDataHandler.py"
click node_training_gui "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/gui.py"
click node_collection_panel "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/SGT/_data_collection_panel.py"
click node_odh_collection_panel "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/SGT/_data_collection_panel_odh_enabled.py"
click node_media_support "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/SGT/_utils.py"
click node_quality_check "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/Auxiliary.py"
click node_data_analysis "https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/OnlineDataHandler.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_session,node_gesture_media toneBlue
class node_device,node_stream_api,node_stream_process,node_shared_memory,node_online_data toneAmber
class node_training_gui,node_collection_panel,node_odh_collection_panel,node_media_support toneMint
class node_quality_check,node_data_analysis toneRose
class node_operator,node_sifi_bridge toneIndigo
```

## Components

### Session orchestration

- [Application setup](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/main.py): `main.py`
- [Session menu](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/menu.py): `menu.py`
- [Gesture media setup](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/Auxiliary.py): `Auxiliary.py`

### Signal acquisition

- **SiFi armband**
- [Streamer factory](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/streamers.py): `CustomLibEMG/streamers.py`
- [Device stream process](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/Streamer/_sifi_bridge_streamer.py): `CustomLibEMG/Streamer/_sifi_bridge_streamer.py`
- [Shared-memory manager](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/Streamer/shared_memory_manager.py): `CustomLibEMG/Streamer/shared_memory_manager.py`
- [Online data handler](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/OnlineDataHandler.py): `CustomLibEMG/OnlineDataHandler.py`

### Gesture training

- [Training GUI](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/gui.py): `CustomLibEMG/gui.py`
- [Collection panel](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/SGT/_data_collection_panel.py): `CustomLibEMG/SGT/_data_collection_panel.py`
- [ODH collection panel](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/SGT/_data_collection_panel_odh_enabled.py): `CustomLibEMG/SGT/_data_collection_panel_odh_enabled.py`
- [Media handling](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/SGT/_utils.py): `CustomLibEMG/SGT/_utils.py`

### Monitoring and analysis

- [Continuous data QA](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/Auxiliary.py): `Auxiliary.py`
- [Online analysis and logging](https://github.com/oagld/emg_and_skin-temperature_data_collection/blob/main/CustomLibEMG/OnlineDataHandler.py): `CustomLibEMG/OnlineDataHandler.py`

### Other components

- **Operator**
- **SiFi Bridge**

## Connections

- Operator → Application setup: starts (evidence: `main.py`)
- Application setup → Streamer factory: starts acquisition (evidence: `main.py`)
- Application setup → Online data handler: creates handler (evidence: `main.py`)
- Application setup → Gesture media setup: downloads media (evidence: `main.py`)
- Application setup → Session menu: launches menu (evidence: `main.py`)
- Streamer factory → Device stream process: starts process (evidence: `CustomLibEMG/streamers.py`)
- Device stream process → Shared-memory manager: uses manager (evidence: `CustomLibEMG/Streamer/_sifi_bridge_streamer.py`)
- Device stream process → SiFi Bridge: connects and streams (evidence: `CustomLibEMG/Streamer/_sifi_bridge_streamer.py`)
- Session menu → Training GUI: imports GUI (evidence: `menu.py`)
- Session menu → Continuous data QA: imports QA tools (evidence: `menu.py`)
- Training GUI → Collection panel: creates panel (evidence: `CustomLibEMG/gui.py`)
- Collection panel → Media handling: uses utilities (evidence: `CustomLibEMG/SGT/_data_collection_panel.py`)
- ODH collection panel → Media handling: uses utilities (evidence: `CustomLibEMG/SGT/_data_collection_panel_odh_enabled.py`)
- Operator → Session menu: uses controls
- Online data handler → Online analysis and logging: provides analysis tools (evidence: `CustomLibEMG/OnlineDataHandler.py`)
