Welcome to the CBCT Reconstruction in MATLAB® repository. This project demonstrates three complementary cone‑beam CT (CBCT) reconstruction approaches implemented in MATLAB:
- FDK (Filtered Backprojection) with automatic GPU utilization
- Hybrid Iterative Refinement (HIR) for improved data consistency
- Deep Learning (2D U‑Net) for slice‑wise enhancement
The workflows are GPU‑aware for fast prototyping and are structured to integrate with CI/CD pipelines for automated validation. The code organization supports both research exploration and production‑oriented deployment. Furthermore, the examples can be expanded to support certification for IEC 62304 standard.
This implementation provides a classical cone‑beam FDK pipeline with robust input handling. Projection stacks are automatically interpreted whether provided as [nu nv nViews] or [nViews nv nu]. The pipeline dynamically selects GPU or CPU execution and supports batching to fit available memory.
The IR approach starts from an FDK reconstruction and iteratively reduces the forward‑projection residual. A backprojected gradient is combined with a light regularization term, such as Gaussian smoothing or Tikhonov‑like priors. Parameters such as step size, iteration count, and batching can be tuned to balance convergence, stability, and runtime.
A slice‑wise 2D U‑Net is used to enhance FDK reconstructions toward a target quality (e.g., IR or ground truth). The workflow includes data preparation, training/validation splitting, TIFF export, and inference with tiled prediction and blending. Quantitative metrics such as PSNR and SSIM are supported for evaluation.
The implementation automatically detects CUDA‑capable GPUs and adapts execution accordingly. Key parameters such as batching depth and padding factors allow the workflows to scale across different hardware configurations. Function interfaces are intentionally minimal, enabling easy integration into custom pipelines.
The repository is designed to be CI/CD‑ready. A lightweight pipeline can be configured to run GPU smoke tests using small datasets, ensuring reproducibility and stability across updates. Deterministic seeds, structured outputs, and logging recommendations support consistent experimentation.
The examples require MATLAB R2026a or newer along with the following products:
- MATLAB™
- MATLAB Coder™
- GPU Coder™
- Deep Learning Toolbox™
- Fuzzy Logic Toolbox™
- Image Processing Toolbox™
- Computer Vision Toolbox™
- Medical Imaging Toolbox™
- Parallel Computing Toolbox™
- Signal Processing Toolbox™
- System Identification Toolbox™
- Clone the repository:
git clone https://github.com/mathworks/CT-Reconstruction-in-MATLAB-.git-
Navigate to the project directory: cd CT-Reconstruction-in-MATLAB
-
Open MATLAB and add the project directory to the path: addpath(genpath('CT_Project'))
Navigate to the CT_Project folder. This folder contains all reconstruction workflows, utilities, and supporting scripts.
Open the folder 01_Example_Scripts.
This folder contains core reconstruction implementations:
- reconFDK.m — FDK-based CBCT reconstruction
- reconIR.m — Hybrid Iterative Refinement
- reconDL.m — Deep learning-based enhancement
This step initializes the environment, sets up paths, and prepares dependencies.
Open the folder 02_Cuda_Codegen_Scripts.
This folder provides GPU Coder-ready scripts:
- reconFDK_codegen.m
- reconIR_codegen.m
- reconDL_codegen.m
These scripts enable CUDA code generation and optimized GPU execution.
Run either:
- demoScript.m
- demoScript.mlx
These scripts provide:
- End-to-end FDK, IR, and DL reconstruction workflows
- CPU and GPU execution options
- Performance benchmarking and visualization
- Reconstructed volumes, intermediate outputs, and evaluation metrics are generated during execution.
- Outputs are organized in structured directories for easy comparison and validation.
Wu, M., FitzGerald, P., Zhang, J., Segars, W.P., Yu, H., Xu, Y., and De Man, B., 2022.
XCIST—an open access x-ray/CT simulation toolkit.
Physics in Medicine & Biology, 67(19), p.194002.
The license is available in the license.txt file in this repository.
© 2026 The MathWorks, Inc.
