Skip to content

🧠 Pythonic, Yet Rudimental, Electrical Impedance Tomography Expert

Notifications You must be signed in to change notification settings

harmening/pyreite

Repository files navigation

Pythonic, Yet Rudimental, Electrical Impedance Tomography Expert (Pyreite) ☠️ ☠️ ☠️

build codecov python

Pythonic head model algorithms for Electrical Impedance Tomography (EIT)

With only small changes to the hardware (no changes to the EEG cap setup), an EIT measurement can be performed in less than 60 seconds before running the actual EEG experiment.
Pyreite aims to derive individual electrical conductivity parameters for the different biological head tissues (scalp, skull, CSF, cortex) from that EIT data. Knowing these subject-dependent (and also within subject-dependent) parameters can significantly improve EEG source localization accuracy!

Get up and running

Prerequisites

  • Python3
  • OpenMEEG 2.4 with python wrapping: compile with "-DENABLE_PYTHON=ON"

Install pyreite

git clone https://github.com/harmening/pyreite.git
cd pyreite
pip install -r requirements.txt
python setup.py install

docker 🐳

Build pyreite image

$ docker build -t pyreite .

or pull from docker hub

$ docker pull harmening/pyreite:v0.2

Example EIT simulation

import os.path.join as pth
from collections import OrderedDict
from pyreite.OpenMEEGHead import OpenMEEGHead
from pyreite.data_io import load_tri, load_elecs_dips_txt


# Load Colins surface meshes
geom = OrderedDict()
for tissue in ['cortex', 'csf', 'skull', 'scalp']:
    geom[tissue] = load_tri(pth('tests', 'test_data', tissue+'.tri'))

# Define conductivity values [S/m]
cond = {'cortex': 0.201, 'csf': 1.65, 'skull': 0.01, 'scalp': 0.465}

# Load electrode positions
sens = load_elecs_dips_txt(pth('tests', 'test_data', 'electrodes_aligned.txt'))


# Create EIT head model
model = OpenMEEGHead(cond, geom, sens)

# Calculate EIT voltage measurement array
V = model.V

About

🧠 Pythonic, Yet Rudimental, Electrical Impedance Tomography Expert

Resources

Stars

Watchers

Forks

Packages

No packages published