Code Monkey home page Code Monkey logo

helix2fan's Introduction

Helix2Fan: Helical to fan-beam CT geometry rebinning and differentiable reconstruction of DICOM-CT-PD projections

This repository provides code to load raw helical DICOM-CT-PD CT projections and rebin them to flat detector fan-beam geometry. We follow the algorithm of Noo et al. to rebin projections acquired on a helical CT trajectory to a circular trajectory. This enables CT reconstructing using conventional reconstruction frameworks and even differentiable filtered back projection (FBP) operators. In addition to the rebinning framework we provide code to reconstruct the processed projections using a differentiable FBP operator from the torch-radon framework. This differentiable operator allows propagating a loss metric, calculated on the reconstructed image, back to the projection data. It, therefore, enables intervening into the reconstruction pipeline at different stages with, e.g., neural networks.

In our associated paper On the benefit of dual-domain denoising in a self-supervised low-dose CT setting we use this framework to render medical low-dose CT data acquired on a helical trajectory suitable for end-to-end reconstruction and denoising in both projection and image domain using neural networks. Please refer to our arXiv publication if you find our code useful.

out/example_reco.png

Projection data (DICOM-CT-PD):

Our data loader supports the standardized DICOM-CT-PD format for loading and preparing the projection data and geometry information for rebinning and CT reconstruction. The largest public low-dose CT image and projection data set LDCT-and-Projection-data provides projection data of more than 100 abdomen/chest/head CT scans in the DICOM-CT-PD format. Please download projection data from their public repository to run the rebinning in this framework.

Setup rebinning:

  1. Create and activate a python environment (python>=3.7).
  2. Install Torch.
  3. Download the DICOM-CT-PD projection data from TCIA.
  4. Run the rebinning code:
python main.py --path_dicom '/path/to/DICOM-CT-PD/data/folder'
  1. Find the rebinned data in the out folder (default).

Setup differentiable reconstruction:

If you want to run the reconstruction script you additionally need to install torch-radon

  1. Download torch-radon
git clone https://github.com/matteo-ronchetti/torch-radon.git
cd torch-radon
  1. The current torch-radon repository uses some outdated PyTorch functions. You can use the torch-radon_fix.patch in the torch-radon_fix folder of the helix2fan repository to fix this problem:
git apply path/to/helix2fan/torch-radon_fix/torch-radon_fix.patch
  1. Install torch-radon
python setup.py install
  1. Run the reconstruction code using the rebinned projections .tif:
python reco_example_fan_beam.py --path_proj '/path/to/fan-beam/projections.tif'
  1. Find the reconstructed CT images in the out folder (default).

Example scripts:

  • Please use the main.py for projection loading and rebinning.
  • Please use reco_example_fan_beam.py to reconstruct the final CT image from the rebinned projection data.

Some tips:

  • Make sure you rebin enough projections acquired on the helical trajectory to cover all 360deg of the volume slices you are interested in.
  • The reconstructed volume will contain streaks and artifacts in slices where you did not use projections from all 360deg
  • The start and end index of the helical projections that are loaded and used can be chosen with the arguments --idx_proj_start and --idx_proj_stop
python main.py --path_dicom '/path/to/DICOM-CT-PD/data/folder' --idx_proj_start 12000 --idx_proj_stop 16000
  • Rebinning all available helical projections from TCIA abdomen scans can take quite some time. So, make sure you choose start and stop index according to the CT slices you are interested in.
  • Other rebinning and reconstruction arguments are listed in the main.py and reco_example_fan_beam.py scripts and can be set via command line or code.

Disclaimer:

Right now the helical to fan beam geometry rebinning does not properly correct for the flying focal spot (FFS) acquisition. All required geometry parameters are correctly read out from the DICOM-CT-PD raw data (--dangles, --dz, --drho). However, torch-radon currently does not support shifting the source position relative to the detector which would be required to accurately correct for FFS. The soon released revised version of torch-radon will be capable to handle such shifts. We will then adapt the helix2fan code accordingly. For now please use the example scripts if you want to do differentiable FBP. Alternatively, consider the --dangles, --dz, --drho parameters in your custom reconstruction code to achieve reconstruction qualities even closer to the vendor's scanner reconstruction software (even without proper FFS correction is the reconstruction quality reasonable). The geometry of the different FFS protocols are defined in the DICOM-CT-PD User Manual.

Citation:

If you find our code useful, please cite our work

@article{wagner2022dual,
  title={On the Benefit of Dual-domain Denoising in a Self-Supervised Low-dose CT Setting},
  author={Wagner, Fabian and Thies, Mareike and Pfaff, Laura and Aust, Oliver and Pechmann, Sabrina and Maul, Noah and Rohleder, Maximilian and Gu, Mingxuan and Utz, Jonas and Denzinger, Felix and Maier, Andreas},
  journal={arXiv preprint arXiv:2211.01111},
  year={2022},
  doi={https://doi.org/10.48550/arXiv.2211.01111}
}

and the corresponding public data set

@misc{mccollough2020low,
  title={Low Dose CT Image and Projection Data (LDCT-and-Projection-data) (Version 5)},
  author={McCollough, C and Chen, B and Holmes, D and Duan, X and Yu, Z and Yu, L and Leng, S and Fletcher, J},
  journal={The Cancer Imaging Archive},
  year={2020},
  doi={https://doi.org/10.7937/9NPB-2637}
}

Troubleshooting

helix2fan's People

Contributors

faebstn96 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.