Skip to main content

TomoSphero

A differentiable 3D/4D volumetric tomographic projector in spherical coordinates.

Check the tutorial for instruction on using this library or examples for complete samples demonstrating forward raytracing and retrieval.

Features

TomoSphero was originally created for tomographic retrieval of planetary atmospheres, but is designed to work for any problem defined on a spherical grid. Some of its features are

  • 3D spherical raytracing with optional support for dynamic volume (4D)
  • implemented purely in PyTorch for easy integration with PyTorch's optimization and machine learning capabilities
  • support for square/circular detectors or other custom detector shapes
  • retrieval framework for easily defining loss functions and parametric models (currently supports only static 3D volumes)

Note that TomoSphero is a volumetric raytracer (i.e. not occlusions, shading, etc.).

Installation and Quickstart

# optional: pre-install appropriate PyTorch for your system (defaults to CUDA version)
# https://pytorch.org/get-started/locally/

pip install tomosphero[extras]
git clone https://github.com/evidlo/tomosphero && cd tomosphero
python examples/single_vantage.py
python examples/static_retrieval.py

python examples/dynamic_measurements.py

Memory Usage

This library uses only PyTorch array operations for implementation simplicity and speed at the expense of memory consumption. The peak memory usage in GB can be approximated with examples/memory_usage.py

$ python examples/memory_usage.py

--- Parameters ---

(50, 50, 50) object
50 observations, 1 channels, (50, 100) sensor

--- Memory Usage ---

Ray coordinates memory: 4.25 GB
Object memory: 0.05 GB

Architecture

Below is a list of modules in this package and their purpose:

Forward Raytracing

  • raytracer.py - computation of voxel indices for intersecting rays, raytracing Operator
  • geometry.py - viewing geometry (detector) definitions, spherical grid definition

Retrieval

  • model.py - parameterized models for representing an object. used in retrieval
  • loss.py - some loss functions to be used in retrieval
  • retrieval.py - retrieval algorithms
  • plotting.py - functions for plotting stacks of images, retrieval losses

Running Tests

pytest tomosphero

See Also

tomosipo, which inspired parts of this library's interface.

Metadata

Release files for tomosphero 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tomosphero 0.0.3
File Size Uploaded
tomosphero-0.0.3.tar.gz 36.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tomosphero 0.0.3
File Interpreter ABI Platform
tomosphero-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 75.0 kB

Release files / tomosphero-0.0.3.tar.gz

Download URL tomosphero-0.0.3.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
75c8ad77fd9150bf4708a18644a28cb7c041956661e88d5324028142ad96cc6f
BLAKE2b-256 checksum
How to use checksums
bf818b4d997e29db73b1ae1199ec568c58485c0e9348fa188036ff25c2b4d365
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / tomosphero-0.0.3-py3-none-any.whl

Download URL tomosphero-0.0.3-py3-none-any.whl
Size 39.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fc528ac5a5302a2c46adf2dfecb02ae26cfdb064e809583a82ae9d8663eaf4f
BLAKE2b-256 checksum
How to use checksums
55fe9b75874f42c630f9f95ee67a53a7bce47da1d72c987bcabd1e4976983510
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page