Patient-specific reconstruction of volumetric computed tomography images from few-view projections via deep learning
This project (paper link) provides a deep-learning framework for generating volumetric tomographic X-ray images with ultra-sparse 2D projections as input. Using the code requires users to have basic knowledge about python, PyTorch, and deep neural networks.
- test.py: main code to run evaluation.
- net.py: network definition of proposed framework.
- trainer.py: model training functions.
- data.py: dataset definition for model training.
- data_loader.py: data loader definition for model training.
- utils.py: util functions definition.
- exp/model/model.pth.tar: trained model for running experiment. Download link
- exp/data/2D_projection.jpg: 2D projection of the data sample, which is the input of model. Download link
- exp/data/3D_CT.jpg: 3D CT volume of the data sample, which will be used as groundtruth to compare with the output (prediction) results. Download link
- exp/result: output folder to save the model prediction as .png files.
- Please put the trained model and data sample under
exp
folder as above to run the code. - Please note the trained model is for the specific patient sample. We suggest retraining the model to apply to the customized data according to training strategy in the paper.
Loading and running deep network requires a standard computer with enough memory to support the model defined by a user. For optimal performance, a GPU card can largely accelerate computation. In our experiment, we use a NVIDIA Tesla V100 GPU card with about 32 GB of memory.
The runtimes below are generated using a computer with a NVIDIA Tesla V100 GPU.
This package is supported for Linux operating systems. The package has been tested on the following systems:
Linux: Ubuntu 16.04
Before running this package, users should have Python
, PyTorch
, and several python packages (numpy
, sklearn
, skimage
, PIL
, and matplotlib
) installed.
The Python can be installed in Linux by running following command from terminal:
sudo apt-get update
sudo apt-get install python3.5
which should install in about 30 seconds.
This code functions with following dependency packages. The versions of software are, specifically:
pytorch: 0.4.1
numpy: 1.15.0
sklearn: 0.19.1
skimage: 0.14.0
PIL: 5.1.0
matplotlib: 2.2.2
Users should install all the required packages shown above prior to running the algorithm. Most packages can be installed by running following command in terminal on Linux. To install of PyTorch, please refer to their official website.
pip install package-name
which will install in about 30 mins on a recommended machine.
To running the trained model to evaluate reconstruction performance on data samples, please type in following comman in terminal. Parameter exp
is used to run different experiments. Running a model inference on one data sample should take approximately 2 mins using a computer with a NVIDIA Tesla V100 GPU.
Please use the parameter vis_plane
to get output image slices on different planes of 3D pancreas CT. The prediction results are saved under path exp/test_results/sample_1
. The results contains .png
files, which are named after Plane_[0/1/2]_ImageSlice_[].png
. Each file shows the prediction, ground truth, and difference image for one slice along the chosen plane. Specifically, the following commands could be run in terminal to get model results and visualize based on three different planes [0: axial, 1: sagittal, 2: coronal] of 3D pancreas CT.
python3 test.py --vis_plane 0
python3 test.py --vis_plane 1
python3 test.py --vis_plane 2
A provisional patent application for the reported work has been filed. The codes are copyrighted by Stanford University and are for research only. Correspondence should be addressed to the corresponding author in the paper. Licensing of the reported technique and codes is managed by the Office of Technology Licensing (OTL) of Stanford University (Ref. Docket #S18-464).
If you find the code are useful, please consider citing the paper.
@article{shen2019patient,
title={Patient-specific reconstruction of volumetric computed tomography images from a single projection view via deep learning},
author={Shen, Liyue and Zhao, Wei and Xing, Lei},
journal={Nature biomedical engineering},
volume={3},
number={11},
pages={880--888},
year={2019},
publisher={Nature Publishing Group}
}