Skip to content

DJAHIDDJ13/BREIT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BREIT

BREIT: A Framework for Brain Stroke Reconstruction using Multi-Frequency 3D EIT

This repository contains the official implementation of the paper BREIT: Brain Stroke Reconstruction using Multi-Frequency 3D Electrical Impedance Tomography, accepted at MICCAI 2026.


BREIT is the release repository for Brain Stroke Reconstruction using Multi-Frequency 3D Electrical Impedance Tomography. It contains the code used to generate synthetic multi-frequency EIT data from tetrahedral head models, precompute D-bar reconstruction caches, train/evaluate the neural reconstruction models, and reproduce the main synthetic experiments from the paper.

The package names remain deepeit and eit_core for compatibility with the training and checkpoint-loading code.

Repository layout

Path Purpose
app.py Hydra entry point for training/evaluation jobs.
config/ Hydra configs for data modules, models, runners, callbacks, and trainers.
deepeit/ PyTorch/PyTorch-Lightning data modules, models, runners, callbacks, and utilities.
eit_core/ Numerical EIT code: CEM forward solver, D-bar utilities, Gauss-Newton tools, and mesh helpers.
scripts/ Workflow scripts for forward generation, D-bar cache generation, training, and metrics. See scripts/README.md.
scripts/batch/ Batch forward-simulation generator. See scripts/batch/README.md.
dataset/ Metadata, mesh assets, admittivity tables, downloaded PKLs, and generated caches. See dataset/README.md.
pipelines/ Optional MRI/CT-to-tetra preprocessing wrappers and sanitized example configs.
tests/ Release checks, smoke tests, and utility tests.

Installation

1. Mamba installation

If you don't have Conda installed, you can either install it manually or opt for Mamba, which is faster.

To install Mamba, follow this link to Mambaforge. Below are the latest installers with Mamba in the base environment:

Operating System Architecture Download Link
Linux x86_64 (amd64) Miniforge3‑Linux‑x86_64.sh
macOS x86_64 Miniforge3‑MacOSX‑x86_64.sh
macOS arm64 (Apple Silicon) Miniforge3‑MacOSX‑arm64.sh
Windows x86_64 Miniforge3‑Windows‑x86_64.exe

After installing Mambaforge, verify that it is functioning correctly by running the following command in your terminal:

mamba --version

2. Install and activate the environment

Create the conda environment from the release file:

conda env create -f env.yml
conda activate deepeit

Run commands from the repository root so Hydra can resolve config/ next to app.py.

Data and checkpoints

Public data and checkpoints are hosted separately from the GitHub repository.

Zenodo data/checkpoint record: https://doi.org/10.5281/zenodo.20937062

Recommended public archives:

breit-pkls-isles-v1.tar
breit-pkls-physio-v1.tar
breit-pkls-healthy-v1.tar
breit-pkls-pat-v1.tar
breit-checkpoints-paper-v1.tar
SHA256SUMS.txt

Each PKL archive should contain both the 1M tetrahedral segmentation PKLs and the matching 75k PKLs for that split:

dataset/1m_isles/*.pkl      dataset/75k_isles/*.pkl
dataset/1m_physio/*.pkl     dataset/75k_physio/*.pkl
dataset/1m_healthy/*.pkl    dataset/75k_healthy/*.pkl
dataset/1m_pat/*.pkl        dataset/75k_pat/*.pkl

Both resolutions are needed for the full workflow. The forward generator scans the 1m_* PKLs, and the D-bar/reconstruction pipeline uses the matching 75k_* PKLs.

Download and extract public data

Download the public archives into release_archives/, then extract them from the repository root:

mkdir -p dataset release_archives

tar -xf release_archives/breit-pkls-isles-v1.tar
tar -xf release_archives/breit-pkls-physio-v1.tar
tar -xf release_archives/breit-pkls-healthy-v1.tar
tar -xf release_archives/breit-pkls-pat-v1.tar

# Optional paper checkpoints:
tar -xf release_archives/breit-checkpoints-paper-v1.tar

If checksum files are provided:

sha256sum -c release_archives/SHA256SUMS.txt

After extraction, the relevant public layout is:

dataset/
  EITSETTINGS.json
  electrodes2.json
  electrode_pos_sphere.json
  head_tissue_admittivity_exploded.csv
  admittivity_source/
  1m_mesh/
  75k_mesh/
  75k_ball_mesh/
  1m_isles/*.pkl
  75k_isles/*.pkl
  1m_physio/*.pkl
  75k_physio/*.pkl
  1m_healthy/*.pkl
  75k_healthy/*.pkl
  1m_pat/*.pkl
  75k_pat/*.pkl

The default data root is ./dataset. If your data are elsewhere, symlink them:

ln -s /path/to/BREIT_dataset dataset

or override the data root in the relevant command.

Source datasets and restricted data

The public BREIT synthetic release is derived from several sources. Users must follow the terms of the original datasets.

Split What is included in the BREIT archive Notes / original source
isles Stroke-case head geometries derived from ISLES 2022 MRI data, with ischemic lesion labels mapped into the BREIT tissue classes. Both 1m_isles/*.pkl and 75k_isles/*.pkl are included. Users who want to regenerate the PKLs from raw imaging should obtain ISLES 2022 from the official challenge/data source.
healthy Healthy-control head geometries derived from the IXI public MRI dataset. Both 1m_healthy/*.pkl and 75k_healthy/*.pkl are included. Used as non-stroke/healthy simulation cases.
physio Synthetic physiological/phantom-style BREIT geometries used for controlled simulation experiments. Both 1m_physio/*.pkl and 75k_physio/*.pkl are included. Included in the public archive.
pat Derived UCLH patient-specific CT/MRI head geometries used for simulation experiments. Both 1m_pat/*.pkl and 75k_pat/*.pkl are included. The derived BREIT PKLs are included in the public archive. Raw clinical EIT measurements/settings must be obtained separately from the UCLH Stroke EIT Dataset when needed.
bhsd Hemorrhage-case head geometries derived from BHSD CT data, with hemorrhage labels mapped into the BREIT tissue classes. Not included in the default public archive. Users must obtain BHSD from its original source under the appropriate terms before regenerating or using these cases.

BHSD-derived files were not included. To run BHSD experiments, obtain BHSD under its own license/terms, then use the preprocessing wrappers in pipelines/ to generate:

dataset/1m_bhsd/*.pkl
dataset/75k_bhsd/*.pkl

After that, include BHSD in the generation commands, for example --splits ... 1m_bhsd for forward generation and --modes ... bhsd for D-bar cache generation.

Raw UCLH clinical EIT measurements are not redistributed in this repository. If you need measured clinical voltages for patient-data comparisons, obtain the UCLH Stroke EIT Dataset from its original repository:

https://github.com/EIT-team/Stroke_EIT_Dataset

Place the measurement file at:

dataset/EITDATA.json

dataset/EITSETTINGS.json is the public protocol/settings file used by the code. The raw measurement file is only needed for clinical-voltage comparisons, not for generating synthetic forward/D-bar caches from the public PKLs.

Generate forward simulations from PKLs

After downloading the PKL archives, generate the forward cache before D-bar preprocessing or training.

One-case sanity run:

python scripts/batch/batch_forward.py \
  --dataset-root ./dataset \
  --sim-version sim_v2 \
  --splits 1m_isles \
  --max-cases 1 \
  --freqs 100 \
  --solver auto \
  --force

Full public generation:

python scripts/batch/batch_forward.py \
  --dataset-root ./dataset \
  --sim-version sim_v2 \
  --splits 1m_isles 1m_physio 1m_healthy 1m_pat \
  --solver auto

If you have generated BHSD PKLs:

python scripts/batch/batch_forward.py \
  --dataset-root ./dataset \
  --sim-version sim_v2 \
  --splits 1m_isles 1m_physio 1m_healthy 1m_pat 1m_bhsd \
  --solver auto

The forward script writes:

dataset/<split>/sim_v2/<case>/
  meta.json
  forward/
    U_unit_<freq>Hz.npy
    U_raw_<freq>Hz.npy
    Ldn_<freq>Hz.npy
    forward_all_freqs.npz
    forward_meta.json

More details are in scripts/batch/README.md.

Generate D-bar caches

After forward simulation, precompute the D-bar caches used by DeepDbar and dFNOBAR/FNO training.

Noiseless public modes:

python scripts/precompute_dbar_cache.py \
  --root-dir ./dataset \
  --sim-version sim_v2 \
  --config both \
  --modes isles healthy physio pat \
  --noiseless-only \
  --no-viz

Noise levels used for the released paper checkpoints:

python scripts/precompute_dbar_cache.py \
  --root-dir ./dataset \
  --sim-version sim_v2 \
  --config both \
  --modes isles healthy physio pat \
  --noise-snr 30 40 50 \
  --no-viz

For the multi-Txi/single-frequency FNO cache grid:

python scripts/precompute_all_txi_freqs.py \
  --root-dir ./dataset \
  --sim-version sim_v2 \
  --modes isles healthy physio pat \
  --config both \
  --noise 30 40 50

Both D-bar scripts support chunking for cluster runs. Use --dry-run first if you are unsure how many cases/jobs will be processed.

Training and evaluation

The two main shell entry points are scripts/train_dbar.sh and scripts/train_fno.sh. For the public release data, pass the public modes explicitly:

bash scripts/train_dbar.sh \
  data.modes='[isles,healthy,physio,pat]'

bash scripts/train_fno.sh \
  data.modes='[isles,healthy,physio,pat]'

The shell scripts accept Hydra overrides on the command line; more examples and workflow notes are in scripts/README.md. The main model families used in the paper are:

  • DeepDbar: D-bar reconstruction followed by a U-Net refinement.
  • dFNOBAR: FNO/U-Net cascade using D-bar scattering features.
  • Classical baselines: D-bar and Gauss-Newton tools in eit_core/ and scripts/.

Paper checkpoints

The checkpoint archive preserves the TensorBoard-style paths so each checkpoint stays next to the hparams.yaml and test_results.json used for the paper metrics:

breit-checkpoints-paper-v1/tensorboard/Unet_deepdbar_noiseless/version_0/...
breit-checkpoints-paper-v1/tensorboard/Unet_deepdbar_50db/version_0/...
breit-checkpoints-paper-v1/tensorboard/Unet_deepdbar_40db/version_0/...
breit-checkpoints-paper-v1/tensorboard/Unet_deepdbar_30db/version_0/...
breit-checkpoints-paper-v1/tensorboard/FNO_Unet_cascade_noiseless/version_0/...
breit-checkpoints-paper-v1/tensorboard/FNO_Unet_cascade_50db/version_0/...
breit-checkpoints-paper-v1/tensorboard/FNO_Unet_cascade_40db/version_0/...
breit-checkpoints-paper-v1/tensorboard/FNO_Unet_cascade_30db/version_0/...

These checkpoints are reproducibility artifacts. They are not required to generate forward or D-bar data.

Preprocessing from raw MRI/CT

The public training release does not require raw MRI/CT data if you download the prepared PKLs. Users who want to regenerate PKLs from raw imaging should start from:

The preprocessing wrappers assume external tools such as FSL/ANTs/CT tooling and external lesion-segmentation dependencies. Those third-party tools and weights are not vendored in this repository.

Development checks

Release/smoke checks are kept under tests/. They are mainly for maintainers or users debugging an installation; they are not required for the normal data-generation/training workflow. A typical maintainer check is:

bash scripts/run_release_validation.sh --repo-root . --out validation_runs/release_validation

Citation

Please cite the BREIT paper when using this code or derived data:

@inproceedings{abdelmoumene2026breit,
  title     = {BREIT: A Framework for Brain Stroke Reconstruction using Multi-Frequency 3D EIT},
  author    = {Abdelmoumene, Djahid and Ayad, Ishak and Nguyen, Mai K. and Daveau, Christian},
  booktitle = {Medical Image Computing and Computer Assisted Intervention -- MICCAI},
  year      = {2026}
}

Also cite the original source datasets used for any raw-data regeneration you perform.

License

Code is released under the MIT license in LICENSE. Data, checkpoints, and third-party source materials may have separate terms; follow the license/terms attached to each external archive and original dataset.

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors