ASTRA Toolbox: GPU tomography primitives for Python and MATLAB
ASTRA Tomography Toolbox
At a glance
- What is it?
- The ASTRA Toolbox is a Python and MATLAB toolbox of GPU-accelerated primitives for 2D and 3D tomography, with parallel, fan beam and cone beam geometries, a set of standard reconstruction algorithms, and forward and backward projectors you can call directly to build your own. The trade-off is a heavy dependency stack around CUDA, and a source build that has to satisfy MATLAB's own compiler expectations.
- Who is it for?
- ASTRA suits a computational imaging researcher who needs fast projectors and reconstructions for X-ray tomography without writing CUDA, and who is comfortable with conda, CUDA versions and a build tree. It is the wrong tool if you only need a CPU reconstruction of a small dataset, since the conda-forge CPU build is limited to 2D algorithms, and it is the wrong tool if you need something other than X-ray tomography.
- Can I use it commercially?
- Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
- Is it still maintained?
- Yes. The repository last received commits 75 days ago.
- What is it written in?
- Mainly C++, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
Projections, back-projections and a geometry you do not have to model
The ASTRA Toolbox is a Python and MATLAB toolbox of high-performance GPU primitives for 2D and 3D tomography. The primitives that matter are the forward and backward projection operations, and the documentation makes a point of them being GPU-accelerated and directly callable from MATLAB and Python, which is what turns the toolbox from a bag of ready-made reconstructions into a building block. A forward projection takes a volume and a geometry and produces the projections a detector would see, and a backward projection does the reverse. Once you can call those two operations, you can implement iterative reconstruction schemes yourself. On top of that sits a large number of 2D and 3D algorithms, including FBP, SIRT, SART and CGLS, so the common cases are one call away. The audience is computational imaging researchers and the physicists and engineers who write the reconstruction code that other people use.
Geometries: parallel, fan beam and cone beam
The geometry support is what separates a general purpose projector from a specific scanner model. ASTRA supports 2D parallel and fan beam geometries and 3D parallel and cone beam, and the README emphasises that all of them have highly flexible source and detector positioning. That flexibility is the practical point. A fixed parallel beam in 3D is a research convenience, but industrial cone beam CT has a source that orbits, a detector that tilts, and a geometry where the magnification changes with position. A projector that only handles the idealised case forces you to resample your data before you can reconstruct it, and resampling is where artefacts come from. Handling the source and detector placement natively means the reconstruction can work with the geometry your scanner actually produced. For a Python or MATLAB user the ergonomics matter as much as the physics, and the samples directory holds both a Python and a MATLAB set of code samples, with the full documentation hosted on the project's own site.
A toolbox to build on, not only a menu of algorithms
It is worth separating the two things ASTRA offers, because they have different adoption profiles. The algorithm set, FBP, SIRT, SART, CGLS among others, is what most users come for, and for that the toolbox is a replacement for a hand-written projector, saving both the implementation effort and the time spent getting the geometry conventions right. The projector interface is the more interesting half, because it turns ASTRA into a component. A research group implementing a new regularisation scheme, or a method that needs a gradient operator, needs the forward and backward operators in the loop, and the fact that these are directly callable from both languages is what makes that possible without a second code path for Python and for MATLAB. The cost of that flexibility is that you now have two layers to learn rather than one, the configuration of the geometry and the algorithm, and the documentation is where the time goes, which is why the project points at both the samples directory and the online documentation rather than at a single worked example.
Installing the binaries, and the two channels
For Windows and Linux, the recommended route is conda, and the README asks for a conda Python environment with 64 bit Python 3.9 to 3.13. The packages live in the astra-toolbox channel, and because ASTRA depends on CUDA packages it also needs the nvidia channel:
conda install -c astra-toolbox -c nvidia astra-toolboxThere is a second route with a different trade-off. The project is also distributed in the conda-forge channel, which the README says may be less up to date than the main channel, but which includes builds for Linux on ARM and macOS on Apple Silicon with CPU-only functionality:
conda install -c conda-forge astra-toolboxAnd if you want to stay off the GPU entirely, the CPU-only builds, with no GPU acceleration and no CUDA dependencies and 2D algorithms only, are selected by a version pattern:
conda install -c conda-forge astra-toolbox=*=py*The Linux pip route is simpler but narrower. The README notes that, unlike the conda packages, only Linux builds are provided through pip, with a single reasonably recent CUDA toolkit version, and that these depend on the PyPI CUDA distribution from NVIDIA.
pip install astra-toolboxBuilding from source, and the MATLAB compiler trap
The source build needs automake, libtool, g++ 7 or higher and CUDA 11.0 or higher on Linux, and the README shows that the dependencies can be assembled in a conda environment, which avoids hunting for system packages. After activating that environment, the build is the standard autotools sequence, with the CUDA path and the Python interface selected at configure time:
cd build/linux
./autogen.sh # when building a git version
./configure --with-cuda=/usr/local/cuda \
--with-python \
--with-install-type=module
make
make installThe same tree can be configured for MATLAB, for Octave with the enable-octave option, or as a plain C++ library with the install-dev target. The trap the README warns about is worth knowing before you start. Each MATLAB version only supports a specific range of g++ versions, and if you have a newer g++ and hit errors about missing GLIBCXX symbols, the documented workaround is to delete the libstdc++ version shipped with MATLAB or to preload the system one through LD_PRELOAD, at your own risk. In other words, the compiler conflict is a known, solvable problem, but the solution involves altering the MATLAB installation.
Windows binaries, macOS from source, and the Apple Silicon caveat
On Windows there is a binary route that avoids the toolchain entirely. You download and unpack a zip archive for the desired version from the project's downloads site, then add the mex and tools subdirectories to your MATLAB path, or install the Python wheel with pip. The Microsoft Visual Studio 2017 redistributable package is required, and if it is not already installed it ships in the archive as vc_redist.x64.exe. Building on Windows from source uses Visual Studio 2017 with its own solution file, or the batch scripts in the build directory, where the Python script produces a wheel in the python dist directory. macOS is source only, needing Xcode plus Homebrew for libtool, autoconf and automake, and the configure line for MATLAB points at an application bundle such as the R2026a path. The one macOS convenience is that Apple Silicon packages are available from the conda-forge distribution of ASTRA, and the README flags that they are CPU-only, which is a real limit for a toolbox whose selling point is GPU acceleration.
Testing the install, and what the project expects of users
There is a basic test for both languages, and it is worth running before you trust a long reconstruction. In Python it is an import and a call:
import astra
astra.test()and in MATLAB the equivalent is the astra_test command. The repository layout shows the scope of the project, with cuda/ for the GPU kernels, include/ and lib/ for the C++ layer, src/ for the shared sources, matlab/ and python/ for the language bindings, build/ for the build system and packaging, samples/ with both matlab and python examples, and tests/. The project is GPL-3.0 licensed with the COPYING file at the root, and the release history is steady, with v2.5.0 in June 2026, v2.4.1 in December 2025 and v2.4.0 in August 2025, and the last push to master on 2026-08-10. The one non-technical request in the README is a citation one: if you use the toolbox for your research, the project asks that you refer to the listed papers, starting with the Optics Express article on fast and flexible X-ray tomography using the ASTRA Toolbox. For an academic tool, that is a reasonable expectation, but it is an expectation, so plan for it.
Editorial conclusion
ASTRA suits a computational imaging researcher who needs fast projectors and reconstructions for X-ray tomography without writing CUDA, and who is comfortable with conda, CUDA versions and a build tree. It is the wrong tool if you only need a CPU reconstruction of a small dataset, since the conda-forge CPU build is limited to 2D algorithms, and it is the wrong tool if you need something other than X-ray tomography. Before installing, check which of the two conda channels matches your hardware, since the main channel carries the CUDA builds and the conda-forge channel carries the CPU-only and Apple Silicon ones, and note that the project asks researchers to cite its papers in published work.
Frequently asked questions
How do I install the ASTRA Toolbox for Python?
On Windows and Linux the recommended route is conda, with the command conda install -c astra-toolbox -c nvidia astra-toolbox, in an environment with 64 bit Python 3.9 to 3.13. On Linux, pip install astra-toolbox also works, but only Linux builds are provided that way.
Can I use the ASTRA Toolbox without a GPU?
Yes, CPU-only builds with no GPU acceleration and no CUDA dependencies, limited to the 2D algorithms, are installed from conda-forge with conda install -c conda-forge astra-toolbox=*=py*. The conda-forge channel also carries Linux ARM and macOS on Apple Silicon builds.
How do I test that the installation works?
In Python, import astra and run astra.test(). In MATLAB, the equivalent command is astra_test. The project calls this a very basic test of the installation.
Which reconstruction algorithms and geometries does ASTRA support?
It supports 2D parallel and fan beam geometries and 3D parallel and cone beam, all with flexible source and detector positioning. A large number of 2D and 3D algorithms are available, including FBP, SIRT, SART and CGLS, and the forward and backward projection operations are directly callable so that new algorithms can be built on them.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/astra-toolbox-astra-toolbox)Was this useful?