Metadata-Version: 2.4
Name: aprict
Version: 0.1.3
Summary: Tools to simulate and reconstruct XCT transmission data.
Author: Murdock Grewar
Author-email: Murdock Grewar <murdock.grewar@anu.edu.au>
License-Expression: GPL-3.0-or-later
Project-URL: Documentation, https://docs.aprict.au/
Project-URL: Repository, https://github.com/murdock-grewar/aprict/
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: GPU :: NVIDIA CUDA
Classifier: Environment :: GPU :: NVIDIA CUDA :: 13
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: C++
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: LICENSE_GPLv3.txt
Requires-Dist: asteval>=1.0.10
Requires-Dist: click>=8.5.0
Requires-Dist: click-extra>=9.4.0
Requires-Dist: cuda-core[cu13]>=1.2.0
Requires-Dist: cupy-cuda13x[ctk]>=14.2.0
Requires-Dist: dask>=2026.8.0
Requires-Dist: gpustat>=1.1.1
Requires-Dist: imageio>=2.37.3
Requires-Dist: numexpr>=2.14.1
Requires-Dist: numpy>=2.4.3
Requires-Dist: ome-zarr>=0.21.0
Requires-Dist: pcpp>=1.30
Requires-Dist: pydantic>=2.12.5
Requires-Dist: regex>=2026.4.4
Requires-Dist: rich>=14.3.3
Requires-Dist: scipy>=1.17.1
Requires-Dist: tqdm>=4.68.3
Requires-Dist: zarr>=3.4.2
Provides-Extra: gui
Requires-Dist: imageio>=2.37.3; extra == "gui"
Requires-Dist: matplotlib>=3.10.8; extra == "gui"
Requires-Dist: pyqt6>=6.10.2; extra == "gui"
Requires-Dist: pyqtgraph>=0.14.0; extra == "gui"
Requires-Dist: neuroglancer>=2.41.0; extra == "gui"
Dynamic: author
Dynamic: license-file

![project logo](https://raw.githubusercontent.com/murdock-grewar/aprict/refs/heads/release/img/logo_horz_big.svg)

[![Static Badge](https://img.shields.io/badge/Author_ORCiD-0000--0002--0015--8284-green?logo=orcid)](https://orcid.org/0000-0002-0015-8284)
[![Static Badge](https://img.shields.io/badge/Project_DOI-10.5281%2Fzenodo.23632625-yellow?logo=DOI&color=yellow)](https://doi.org/10.5281/zenodo.23632625)
[![PyPI Version](https://img.shields.io/pypi/v/aprict)](https://pypi.org/project/aprict/)
![Static Badge](https://img.shields.io/badge/Install-pip_install_aprict%5Bgui%5D-212121?logo=PyPI&logoColor=white)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)

# Description
`aprict` (pronounced "apricot") is a Python module for simulating transmission experiments in X-ray Computed Tomography, and for performing reconstructions from real and simulated data. In addition to the Python API, there is a commandline interface for some common operations.

## Installation
```bash
pip install aprict[gui]
```

## Disclaimer
This software is provided with no warranty or guarantee of correctness. This is my research code sandbox, subject to breaking changes on a whim. This is not mature software. So, if you like it and wish to use it, then it is best to download a fixed version and use that. Updates may break things.

## Features
`aprict` uses the GPU for all the heavy operations. The terminology 'in-core' an 'out-of-core' here refers to whether the relevant data must fit entirely within the GPU VRAM (in-core) or not (out-of-core). RAM requirements vary according to the reconstruction method. It is recommended to add a large swap partition for additional virtual memory when using the GBC method on large volumes that can't fit in RAM at least a couple of times. Also, it is generally assumed that the RAM on the machine is at least twice the size of the used VRAM on the GPU. 

Included features as of aprict==0.1.0:

 - Out-of-core calculation of projection data for arbitrary flat-panel geometries. Supports voxelised volumes and (almost) any FORBILD phantom. (Exact line integrals in all cases.)
 - Out-of-core analytic reconstruction for special geometries:
   - Fan-beam data with circular scan
   - Cone-beam data with cylindrical scan
 - In-core iterative reconstruction (Landweber and SIRT) for arbitrary geometries.

# Documentation
## Viewing online
The documentation for the latest release can be viewed online at [`https://docs.aprict.au/`](https://docs.aprict.au/). 
## Viewing locally
The documentation may be viewed locally by cloning the repository and running `python3 -m http.server -d aprict/docs/ 8080`, then navigating to `http://localhost:8080` in a browser window.

# Caveats
## Hardware Requirements
This software requires CUDA toolkit `13.x` or newer to be installed on the system.

It is strongly recommended to use high-speed mass storage, such as an NVMe drive. The software has not been tested on slower mass storage, and is not expected to perform well without it.

This software has been tested with the following GPUs: 
* NVIDIA RTX 2060
* NVIDIA RTX 2080 Ti
* NVIDIA RTX 3050
* NVIDIA RTX 3090
* NVIDIA RTX PRO 6000 Blackwell

## Known limitations
* Only flat-panel X-ray data with square pixels is supported, at this time.
* Implementation-related issues which could be alleviated in the future:
  * Volume size is limited by CUDA texture limit. For example, a `(2400,2400,4800)` volume can be reconstructed, but not a `(30000,30000,1)` volume, due to a volume of this size not fitting within a single CUDA texture
  * The FORBILD shape `Tetrahedron` is not yet implemented, and no primitive shape is permitted to have more than 3 clipping planes applied, due to internal limitations. All other FORBILD phantoms should be supported.
  * Only one GPU is utilised by this module, at the present time. There is no defined behaviour for which GPU will be chosen.
  * Not fully optimised
  * CPU and GPU work not completely asynchronous: due to unresolved bugs, various asynchronous GPU operations have been disabled. This may not have much impact on large reconstructions, but could result in poor GPU utilisation for smaller reconstructions.
  * No smart batching of (back)projections: smarter code would analyse the geometry of projections, and batch together (back)projections that involve similar regions of the volume. Currently, the code does not do any kind of clever batching like this, and so the (back)projection code is not as performant as it could be.

