Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1c32f6f
feat: implement DragerEitParser.parse() with full calibration pipeline
Kernel236 Mar 27, 2026
ec25640
docs: update README and data_model for DragerEitParser implementation
Kernel236 Mar 27, 2026
2f4816b
feat: add EIT parser validation notebook
Kernel236 Mar 27, 2026
876a4a6
fix: move warnings import to module level in eit_parser
Kernel236 Mar 27, 2026
463f378
test: add full test suite for .eit parser (84 tests)
Kernel236 Mar 27, 2026
cefe6f1
refactor: reorganize tests/ into models/ and parsers/ subdirectories
Kernel236 Mar 27, 2026
9d09537
feat: add DragerEitParser, GREIT reconstruction bridge, and ruff fixes
Kernel236 Mar 27, 2026
237c935
docs(notebook): translate validation notebook to English; add §9 std/…
Kernel236 Mar 27, 2026
b337607
docs: split data_model.md into containers + parsers; add parsers.md
Kernel236 Mar 27, 2026
bef7016
chore: update tasks.csv and learning_journal for session 2026-03-27
Kernel236 Mar 27, 2026
7aadc1d
fix: correct GREIT protocol to fmmu and add horizontal flip for Dräge…
Kernel236 Mar 27, 2026
4f35eda
docs(notebook): fix §9 frame alignment — .bin is derived from .eit, n…
Kernel236 Mar 27, 2026
f4eeaa2
docs: implore clariness.
Kernel236 Mar 27, 2026
2657dd3
Remove cache for local file
Kernel236 Mar 27, 2026
289edcb
docs: clarify memmap and struct.unpack performance explanations
Kernel236 Mar 27, 2026
a0098f1
refactor: rename file to eit pyeit bridge for clariness and fix all i…
Kernel236 Mar 27, 2026
197e1b1
docs: clarify .eit file handling in parsing layer documentation
Kernel236 Mar 27, 2026
c68d143
docs: specify DragerBinParsers in purpose statement for clarity
Kernel236 Mar 27, 2026
d74c0af
docs: remove task reference from Dräger `.eit` parser docstring for c…
Kernel236 Mar 27, 2026
284c910
fix: remove trailing newline at end of DragerEitParser class
Kernel236 Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ print(data.n_frames, data.fs) # e.g. 11500, 50.0
print(data.pixels.shape) # (11500, 32, 32)
print(data.global_signal[:10]) # first 10 frames global EIT signal

# Dräger .eit — raw transimpedances for pyEIT reconstruction
data = load_data("patient01.eit")
print(data.n_frames, data.fs) # e.g. 11500, 50.0
print(data.measurements.shape) # (11500, 208) — 208 = 16 inj × 13 meas
print(list(data.aux_signals.keys())) # timestamp, I_real, V_diff, medibus, ...

# Dräger .asc — continuous frame-by-frame signal export
data = load_data("patient01.asc")
print(data.n_frames, data.fs) # e.g. 11500, 50.0
Expand All @@ -57,24 +63,36 @@ Pre-alpha. Data model and parsing layer implemented.
|-------|---------|-------------|
| `ReconstructedFrameData` | 32×32 pixel matrices + synchronized signals | `.bin`, `.txt` |
| `ContinuousSignalData` | Signal table, one row per frame | `.asc` |
| `RawImpedanceData` | Raw transimpedances for pyEIT | `.eit` (scaffold) |
| `RawImpedanceData` | Calibrated transimpedances + aux signals for pyEIT | `.eit` |

**Parsers** (`parsers/`):

| Parser | Status | Formats |
|--------|--------|---------|
| `DragerBinParser` | Implemented | `.bin` — base frame (4358 b) and PressurePod frame (4382 b); registry-driven, new frame sizes require only a dtype + one entry |
| `DragerAscParser` | Implemented | `.asc`, `.txt`, `.csv` — continuous waveform export |
| `DragerEitParser` | Scaffold | `.eit` (Fase 2) |
| `DragerEitParser` | Implemented | `.eit` — ASCII header + binary frames (5495 b/frame); 208 calibrated transimpedances + Medibus aux signals |
| `TimpelTabularParser` | Implemented | `.csv`, `.txt` — reconstructed frame export |

All parsers are accessible via the single entry point `load_data(path)`, which
auto-detects vendor and format.

`RawImpedanceData` from `.eit` files can be reconstructed to 32×32 pixel images via
which is an example of pyEIT wrapping `reconstruct_greit()` (optional dependency: `pip install fasteit[pyeit]`; implements
GREIT — Adler et al., *Physiol. Meas.* 2009, DOI: 10.1088/0967-3334/30/6/S03):

```python
from fasteit.parsers.draeger.eit.eit_pyeit_bridge import reconstruct_greit

data = load_data("patient01.eit")
images = reconstruct_greit(data.measurements) # (N_frames, 32, 32)
```

## Documentation

- [`docs/data_model.md`](docs/data_model.md) — data containers and parsing flow per file type
- [`docs/parsing_layer.md`](docs/parsing_layer.md) — how to extend: new frame sizes, new vendors, new formats
- [`docs/data_model.md`](docs/data_model.md) — data container field specifications
- [`docs/parsers.md`](docs/parsers.md) — parser reference: formats, calibration, GREIT bridge, loader utilities
- [`docs/parsing_layer.md`](docs/parsing_layer.md) — architecture and extension recipes

## Contributing

Expand Down
51 changes: 29 additions & 22 deletions docs/data_model.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
# fastEIT — Data Model

Specifications for all data containers. For parsing flow, detection logic, and
extension recipes see [`parsing_layer.md`](parsing_layer.md).

---

## 1. Overview

| File | Vendor | Container | Content |
|------|--------|-----------|---------|
| `.bin` | Dräger | `ReconstructedFrameData` | 32×32 pixel matrices + Medibus signals |
| `.csv` / `.txt` / `.asc` | Timpel | `ReconstructedFrameData` | 32×32 pixel matrices + 6 device signals |
| `.asc` | Dräger | `ContinuousSignalData` | Frame-by-frame signal table, no matrices |
| `.eit` | Dräger | `RawImpedanceData` | 208 raw transimpedances per frame |
| `.x` | Timpel | `RawImpedanceData` | 208 raw transimpedances per frame |
Specifications for all data containers. For parser details, calibration
constants, and loader utilities see [`parsers.md`](parsers.md). For architecture
and extension recipes see [`parsing_layer.md`](parsing_layer.md).

All containers inherit from `BaseData` (`models/base_data.py`).

---

## 2. `BaseData` — common base
## 1. `BaseData` — common base

```
filename str Source file path
Expand All @@ -33,7 +22,7 @@ duration float n_frames / fs (0.0 if fs is None)

---

## 3. `ReconstructedFrameData`
## 2. `ReconstructedFrameData`

**File:** `models/reconstructed_data.py`
**Produced by:** `DragerBinParser` (`.bin`), `TimpelTabularParser` (`.csv/.txt/.asc`)
Expand Down Expand Up @@ -80,7 +69,7 @@ is applied in the preprocessing layer.

---

## 4. `ContinuousSignalData`
## 3. `ContinuousSignalData`

**File:** `models/continuous_data.py`
**Produced by:** `DragerAscParser` (`.asc`)
Expand All @@ -97,16 +86,34 @@ table pd.DataFrame One row per EIT frame. Snake_case column names.

---

## 5. `RawImpedanceData`
## 4. `RawImpedanceData`

**File:** `models/raw_impedance_data.py`
**Produced by:** `DragerEitParser` (`.eit`), `TimpelRawParser` (`.x`) — both scaffold
**Produced by:** `DragerEitParser` (`.eit`); `TimpelRawParser` (`.x`) — scaffold

```
measurements np.ndarray shape (N_frames, 208)
Calibrated transimpedances (not raw ADC counts, not
yet image-reconstructed). For Dräger:
vv = FT_A*trans_A - FT_B*trans_B (EIDORS, Adler 2016)
208 = 16 electrodes × 13 measurement pairs
Adjacent drive pattern (Dräger and Timpel)
(adjacent drive, standard Dräger pattern)

aux_signals dict|None Named per-frame arrays. Populated by DragerEitParser:
"timestamp" float64 (N,) fraction of day
"trans_A" float64 (N,208) raw ADC — primary
"trans_B" float64 (N,208) raw ADC — reference
"injection_current" float64 (N,16) raw ADC counts
"I_real" float64 (N,16) injected current [A]
"voltage_A" float64 (N,16) raw ADC counts
"voltage_B" float64 (N,16) raw ADC counts
"V_diff" float64 (N,16) differential voltage [V]
"frame_counter" uint16 (N,)
"medibus" float32 (N,67) ventilator channels
None if the source file carries no auxiliary signals.
```

Intended consumer: **pyEIT** or any reconstruction library.
fastEIT does not perform image reconstruction — it ingests vendor-reconstructed files.
Intended consumer: `reconstruct_greit()` (in `fasteit.parsers.draeger.eit.eit_pyeit_bridge`,
requires optional `pyeit` dependency) or any external reconstruction library.
For `.bin` and Timpel `.csv` files, fastEIT ingests vendor-reconstructed images
and does not re-reconstruct them.
Loading
Loading