This repository contains a Python/C++ implementation of the radon transform, based on pytorch and its JIT-C++-compilation feature.
- Forward and backward transforms
- Filtering with different filters
- Acceleration via CUDA/OpenMP
- Differentiability
- Generation of radon transform matrices
This image was generated using this package and a filter function generated by a machine learning algorithm. The left picture is an exemplary input from the MNIST dataset, the middle picture shows the corresponding sinogram and the right picture is the reconstruction using custom filtered backprojection.
More examples can be found in cpu_examples.ipynb
and cuda_examples.ipynb
.
The base package requires only pytorch
and a C++ compiler (c++
on Unix/Linux, cl
(MSVC) on Windows). The examples additionally require jupyter notebooks
, torchvision
, matplotlib
and (optionally, for comparison) torch_radon
.
To build:
- Clone the github repository via
git clone https://github.com/AlexanderAuras/radon.git
- Change into the project directory and run
pip install .
to install the package
- Change radon_matrix signature (Replace img with img_size)
- PyPI/conda package
- Support for different floating types
- FIX: Remove duplicate code
- Better detection of CUDA block size
- More filter functions
- Documentation
- FIX: Normalization
FIX: Find reason for pattern in cube reconstruction which does not exist withtorch_radon
FIX: Find reason for difference totorch_radon
Fix CUDA backward bugGenerate transform matrixFiltering asnn.module
- On unix:
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’
: caused by weird nvcc implementation, see NVIDIA/nccl#650 (comment)