An implementation for generating simulated datasets for CBCT scans.
The work was done as a part of TomoHead project while working at Planmeca Oy, Helsinki, Finland.
We follow the implementation provided in "Convolutional Neural Network Based Metal Artifact Reduction in X-ray Computed Tomography," by Yanbo Zhang and Hengyong Yu, 2018, which was used to generate the dataset for CT scans. However, the corresponding code was in MATLAB, and the metal dataset was not available. We will use the same approach to generate the dataset for CBCT scans using python and open source CT dataset.
We will use the open sourced CTPelvic1K Dataset for non-metal images and Clinic Metal dataset to generate the metal masks. Further, we will use TIGRE toolbox to generate the metal artifact projections and fdk-reconstrcuted images.
- Download the non-metal CT images from CTPelvic1K Dataset6, place all the zip files under the folder dataset/deeplesion.
- Download metal corrputed dataset from Clinic Metal, place the extracted files under the folder dataset/metals.
- Since I can not find the metal only segmentation online, I will segment the metals using thresholding from the metal corrupted images obtained from the data in step 2.
- Generate the metal only images using the segmentation masks obtained from step 3.
- Generate the metal artifact images by adding the metal only images to the non-metal images and following the metal simulation process in Yanbo Zhang and Hengyong Yu, 2018.
Ground truth![]() |
Simulated metal projection![]() |
Simulated metal artifact![]() |
Only-metal image![]() |
- Clone the repository using the following command:
git clone [email protected]:harshitAgr/CBCTSym.git
- Change the directory to the cloned repository:
cd CBCTSym
- Install the required packages using the requirements.txt file.
pip install -r requirements.txt
- Install the TIGRE toolbox using the following commands at: TIGRE
- Run the code using the following command:
python cbctsym/prepare_dataset.py -c path/to/config.yaml
The code will load the config.yaml file, which contains various parameters for the dataset generation. The code will generate the dataset and save it in the specified output directory. The correspondig config file will also be saved for future reference. Pease, check config file for the available default parameters.
If you find this code useful, you can cite our related metal segmentation network:
@ARTICLE{10250444,
author={Agrawal, Harshit and Hietanen, Ari and Särkkä, Simo},
journal={IEEE Access},
title={Deep Learning Based Projection Domain Metal Segmentation for Metal Artifact Reduction in Cone Beam Computed Tomography},
year={2023},
volume={11},
number={},
pages={100371-100382},
doi={10.1109/ACCESS.2023.3314700}}
Please, also consider citing the original paper:
@article{zhang2018convolutional,
title={Convolutional neural network based metal artifact reduction in X-ray computed tomography},
author={Zhang, Yanbo and Yu, Hengyong},
journal={IEEE transactions on medical imaging},
volume={37},
number={6},
pages={1370--1381},
year={2018},
publisher={IEEE}
}
and TIGRE toolbox:
@article{biguri2016tigre,
title={TIGRE: a MATLAB-GPU toolbox for CBCT image reconstruction},
author={Biguri, Ander and Dosanjh, Manjit and Hancock, Steven and Soleimani, Manuchehr},
journal={Biomedical Physics & Engineering Express},
volume={2},
number={5},
pages={055010},
year={2016},
publisher={IOP Publishing}
}