Yi-Chen Lee and Peirong Liu
Department of Electrical and Computer Engineering,
Data Science and AI Institute,
Johns Hopkins University
Contact: {ylee268, pliu53}@jh.edu
This repository contains the official implementation of our MICCAI 2026 paper HemoPIC: A Physics-Informed Cerebral Hemodynamics Digital Twin for Brain Perfusion. It includes a complete pipeline and evaluation scripts for cerebral perfusion processing.
Fig. 1. Overview of HemoPIC. Given measured tracer dynamics, HemoPIC estimates regional blood inflow and outflow without requiring an arterial input function (AIF). It couples tracer transport with patient-specific hemodynamics in a physics-grounded formulation.
Fig. 2. Consistency between HemoPIC and conventional AIF-based perfusion maps. Deconv denotes the ISLES 2017 silver-standard AIF-based deconvolution maps. All maps are shown using identical scales for each parameter.
Requires Python 3.9 or later.
pip install -r requirements.txt- Preprocessing 1 — build the HemoPIC tissue partition (
hemopic_seg4) - Preprocessing 2 — convert PWI signal to tracer concentration
- Step 1 — run HemoPIC fitting (
scripts/run_hemopic.py) - Step 2 — run evaluation scripts in
Eval/
Use the bundled demo to skip preprocessing and Step 1 fitting; see Demo below.
A running demo for patient 22 (manuscript example) is included in assets/example/, with inputs and precomputed HemoPIC outputs. From the repository root:
python scripts/run_demo.py --eval # Step 2: slice maps (z = 13, 14, 15)
python scripts/run_demo.py --fit # Step 1: rerun fitting
python scripts/run_demo.py --fit --eval # both stepsSee assets/example/README.md for the bundled file layout.
This repository uses the ISLES 2017 Training set. Provide the path to the ISLES2017_Training folder as DATASET_ROOT in all commands.
Each training_XX/ folder should contain:
MR_rCBF,MR_rCBV,MR_MTT— silver-standard perfusion mapsCTC_from_MR_4DPWI— tracer concentration time series (from Preprocessing 2)hemopic_seg4/seg4_label_ref24.nii.gz— HemoPIC tissue partition (from Preprocessing 1; required)hemopic_seg4/seg4_gray_ref24.nii.gz— gray overlay of the partition (from Preprocessing 1; optional)OT— lesion mask (optional; used by some evaluation scripts)
This step builds the HemoPIC tissue partition: a four-class label map (gray matter, white matter, CSF/ventricles, brain stem) resampled to the perfusion grid. For each subject it writes:
training_XX/hemopic_seg4/seg4_label_ref24.nii.gz
training_XX/hemopic_seg4/seg4_gray_ref24.nii.gz
under DATASET_ROOT.
python preprocess/Segmentation/hemopic_seg4.py \
/path/to/ISLES2017_Training \
/path/to/segmentation_rootsegmentation_root should contain per-subject structural segmentations. For ISLES 2017, you can generate these with the helper script below (requires FreeSurfer installation):
export FREESURFER_HOME=<path to your freesurfer install>
source "$FREESURFER_HOME/SetUpFreeSurfer.sh"
export FS_LICENSE=<path to your license.txt>
python preprocess/Segmentation/run_synthseg.py \
/path/to/ISLES2017_Training \
/path/to/segmentation_rootPass the same segmentation_root to hemopic_seg4.py. To process one subject, append training_36 to either command.
This step converts the raw ISLES 2017 perfusion-weighted imaging signal into CTC_from_MR_4DPWI, the tracer time series used by Step 1.
Run for all patients:
python preprocess/signal_to_concentration/pwi_to_tracer.py \
/path/to/ISLES2017_Training \
1 48DATASET_ROOT=/path/to/ISLES2017_Training
OUT_ROOT=/path/to/HemoPIC_outputs
PATIENT_NUM=<PATIENT_NUM>
K_GM=8
K_WM=6
SEED=0
python scripts/run_hemopic.py "$DATASET_ROOT" "$OUT_ROOT" "$PATIENT_NUM" "$K_GM" "$K_WM" "$SEED"Notes:
OUT_ROOTis the output folder produced by HemoPIC.- Fitting writes to
OUT_ROOT/training_XX/(e.g.HemoPIC_CBF.nii.gz,roi_fit_summary.csv). - Use
OUT_ROOTasFIT_ROOTin the Step 2 commands below.
Shared arguments:
DATASET_ROOT=/path/to/ISLES2017_Training
FIT_ROOT=/path/to/HemoPIC_outputs
OUT_DIR=/path/to/HemoPIC_evalpython Eval/cvt_check/run_eval_cvt.py "$DATASET_ROOT" "$FIT_ROOT" "$OUT_DIR"python Eval/summary_maps/run_eval_slice_maps.py \
"$DATASET_ROOT" \
"$FIT_ROOT" \
"$OUT_DIR" \
<patient_id> <slice_z> <cbf_max> <cbv_max> <mtt_max>Notes:
- Manuscript example:
patient_id = 22,slice_z = 13, 14, 15(one slice per run),cbf_max = 70,cbv_max = 7,mtt_max = 15. - Or use
python scripts/run_demo.py --evalwith the bundled demo data.
python Eval/summary_maps/run_eval_summary_stats.py "$DATASET_ROOT" "$FIT_ROOT" "$OUT_DIR"python Eval/tracer_recon/run_eval_tracer_estimation.py "$DATASET_ROOT" "$FIT_ROOT" "$OUT_DIR"python Eval/Windkessel/run_eval_tau_report.py "$DATASET_ROOT" "$FIT_ROOT" "$OUT_DIR"Compare HemoPIC and ISLES silver-standard maps for OT lesion discrimination (CBF, CBV, MTT):
python Eval/lesion_roc/run_eval_lesion_roc.py "$DATASET_ROOT" "$FIT_ROOT" "$OUT_DIR/lesion_roc" --allEval/summary_maps/run_eval_summary_stats.py— patient cohort summary statistics for lesion and gray/white matterEval/summary_maps/run_eval_slice_maps.py— qualitative slice map figures for selected patients and slicesEval/tracer_recon/run_eval_tracer_estimation.py— tracer reconstruction evaluation reports and plotsEval/cvt_check/run_eval_cvt.py— central volume theorem consistency summaries and plotsEval/Windkessel/run_eval_tau_report.py— Windkessel parameter reportsEval/lesion_roc/run_eval_lesion_roc.py— lesion ROC/PR analysis for CBF, CBV, and MTT
@inproceedings{lee2026hemopic,
title={{HemoPIC: A Physics-Informed Cerebral Hemodynamics Digital Twin for Brain Perfusion}},
author={Lee, Yi-Chen and Liu, Peirong},
booktitle={Medical Image Computing and Computer Assisted Intervention (MICCAI)},
year={2026}
}"HemoPIC: A Physics-Informed Cerebral Hemodynamics Digital Twin for Brain Perfusion" is a publication of The Johns Hopkins University and copyright © 2026 The Johns Hopkins University. All rights reserved.