Skip to content

About

CBCT generates pseudo CT.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Repository files navigation

CBCT (Cone Beam Computed Tomography) generates pseudo CT images, which are essential for applications where traditional CT scans are unavailable or difficult to acquire.

Dataset

Synthrad2023

SynthRAD2023 Grand Challenge

Data structure

Brain_Pelvis
-train
|-brain
  |-1BA001
    |-ct.nii.gz
    |-cbct.nii.gz
    |-mask.nii.gz
  |- ...
  |-1BA005
    |-ct.nii.gz
    |-cbct.nii.gz
    |-mask.nii.gz
|-pelvis
  |-1PA001
    |-ct.nii.gz
    |-cbct.nii.gz
    |-mask.nii.gz
  |- ...
  |-1PA004
    |-ct.nii.gz
    |-cbct.nii.gz
    |-mask.nii.gz

-test
|-brain
  |- ...
|-pelvis
  |- ...

Usage

1. Data Split

python data_split.py

2. Make Dataset

python make_dataset.py

3. Train, Test & Predict

python train.py
python test.py
python predict.py

Result

image

Environment

conda env create -f env.yml
conda activate cbct2ct
conda env export --no-builds > env.yml

PyInstaller Installation Guide:

1. Create and Activate Conda Environment

conda create --name cbct2ct python=3.9
conda activate cbct2ct

2. Install Required Python Packages

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyinstaller
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple SimpleITK
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple onnxruntime
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tqdm

3. Use PyInstaller to Package Python Script

pyinstaller --name CBCT2CT --onefile --icon=cbct2ct.ico CBCT2CT.py

4. Clean the Build Cache and Temporary Files

pyinstaller --clean CBCT2CT.spec

5. Run the Executable

Once the build is complete, you can run the generated CBCT2CT.exe with the required parameters:

CBCT2CT.exe --cbct_path ./test_data/brain/cbct.nii.gz --mask_path ./test_data/brain/mask.nii.gz --result_path ./result --anatomy brain
CBCT2CT.exe --cbct_path ./test_data/pelvis/cbct.nii.gz --mask_path ./test_data/pelvis/mask.nii.gz --result_path ./result --anatomy pelvis
  • --cbct_path: Path to the input CBCT image file.
  • --mask_path: Path to the input mask file.
  • --result_path: Path where the results will be saved.
  • --anatomy: Choose a model based on anatomical region.

6. Deactivate and Remove Conda Environment

conda deactivate
conda remove --name cbct2ct --all

Reference

A Simple Two-stage Residual Network for MR-CT Translation

CBCTLiTS

About

CBCT generates pseudo CT.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages