Skip to main content

Python bindings for the GeometricMedicalPhantoms shared library — synthetic MRI/CT phantoms (Shepp-Logan, Tubes, Torso) with physiological motion signals

Project description

geometric-medical-phantoms

Python bindings for the GeometricMedicalPhantoms shared library — a Julia-based toolkit for generating synthetic MRI/CT phantoms.

Supported phantoms

  • Shepp-Logan — classic ellipsoid head phantom (CT and MRI variants)
  • Tubes — cylindrical quality-control phantom
  • Torso — anatomically-motivated torso with respiratory and cardiac motion

Requirements

  • Python ≥ 3.9
  • NumPy ≥ 1.20
  • The pre-built libgeomphantoms shared library (see Releases)

Installation

pip install geometric-medical-phantoms

Then download the pre-built library bundle for your platform from the GitHub Releases page and extract it.

Quick start

from geometric_medical_phantoms import GMPLib

lib = GMPLib("/path/to/build/lib/libgeomphantoms.so")  # .dylib / .dll on other platforms

# Shepp-Logan 3-D phantom
ti = lib.shepp_logan_ct_default()
phantom = lib.create_shepp_logan_phantom_3d(128, 128, 128, ti)
# phantom is a (128, 128, 128) float32 numpy array in Fortran (column-major) order

# Respiratory signal
phys = lib.respiratory_physiology_default()
t, sig = lib.generate_respiratory_signal(60.0, 50.0, 15.0, phys)

# Dynamic torso phantom (4-D cine)
torso = lib.create_torso_phantom_3d(64, 64, 64, resp_signal=sig[:50])
# torso.shape == (64, 64, 64, 50)

Documentation

Full API reference and usage guides are available at https://hakkelt.github.io/GeometricMedicalPhantoms.jl.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geometric_medical_phantoms-1.0.2.tar.gz (10.6 kB view details)

Uploaded Source

File details

Details for the file geometric_medical_phantoms-1.0.2.tar.gz.

File metadata

File hashes

Hashes for geometric_medical_phantoms-1.0.2.tar.gz
Algorithm Hash digest
SHA256 290ce956b2c6251a9fdef6575a33db70b38b4e452afbd6fe15cb5130d9649d5d
MD5 914360ad147c01428b711956062c3881
BLAKE2b-256 a4886b1d30b167789edb55ea33f088ff03c1ff64e65d7ebfc317aa0a1b0d451e

See more details on using hashes here.

Provenance

The following attestation bundles were made for geometric_medical_phantoms-1.0.2.tar.gz:

Publisher: build-lib.yml on hakkelt/GeometricMedicalPhantoms.jl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page