Minimal research implementation of BoxPINN for fitting perfusion maps from a single dynamic CT perfusion (CTP) case. The architecture, preprocessing, and optimization settings are fixed to the configuration reported in the associated manuscript. Patient data, trained weights, hospital-specific pipelines, and manuscript result-generation files are not included.
- Python 3.10
- A CUDA-capable GPU
- A CUDA-compatible installation of PyTorch
- A C++ compiler and CUDA toolkit for
tiny-cuda-nn
Install PyTorch for the CUDA version available on your system, then install the remaining packages:
python -m pip install -r requirements.txtThe versions in requirements.txt record the environment used for this code.
Pass one case directory with the following files:
case_directory/
├── CTP_4D.nii.gz # dynamic CTP, ordered as time, z, y, x
├── brainmask.nii.gz # three-dimensional brain mask
├── aif.npy # arterial input function
├── vof.npy # optional venous output function
└── time.npy # optional acquisition times in seconds
If time.npy is absent, acquisition times are inferred from the temporal
spacing of CTP_4D.nii.gz. The AIF length must match the number of CTP time
points. All image inputs for a case must share the same spatial geometry.
From the repository root:
python run_boxpinn.py --case_dir /path/to/case_directory --output_dir resultsThe command writes CBF, CBV, MTT, delay, and Tmax NIfTI maps under
results/<case-name>/BoxPINN/. Run python run_boxpinn.py --help for the
available input and device options. The reported model hyperparameters are not
exposed as command-line options. Unless overridden for memory constraints, the
batch size follows the manuscript rule: 0.05% of raw voxel-time points, clipped
to 20,000--100,000 samples.
This minimal release supports method execution and single-case inference. It does not contain clinical datasets or scripts that regenerate every table and figure in the manuscript. Users are responsible for verifying input preprocessing, acquisition timing, AIF selection, and output suitability for their own data. This research code is not a medical device and is not intended for clinical decision-making.
Please cite the associated article when using this code. Full citation details will be added after publication.