Skip to main content

Generate numerical phantoms.

Project description

Installation

pip install phantominator

About

Python package for easy generation of numerical phantoms. I often need a simple image to try something out on. In MATLAB, I would use the phantom command to quickly get something to work with. In Python, it’s not quite so easy, so I made this package that’s quick to install and use so there’s as little friction as possible. There are other implementations of Shepp-Logan available from other projects, but they are usually not as easy to install or include other things that I don’t want for this project.

This package offers both CT and MR versions.

Usage

Also see the examples module and docstrings. The interface for CT phantom generation is similar to MATLAB’s phantom function.

Basic usage:

# CT phantom
from phantominator import shepp_logan
ph = shepp_logan(128)

# MR phantom (returns proton density, T1, and T2 maps)
M0, T1, T2 = shepp_logan((128, 128, 20), MR=True)

# Dynamic (concentric circles), 20 time frames
from phantominator import dynamic
ph = dynamic(128, 20)

Arbitrary k-space sampling is supported for the single coil 2D Shepp-Logan phantom:

# Given k-space coordinates (kx, ky), where kx and ky are 1D
# arrays using the same unit conventions as BART's traj command,
# we can find the corresponding k-space measurements:
from phantominator import kspace_shepp_logan
k = kspace_shepp_logan(kx, ky)

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

phantominator-0.4.5.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phantominator-0.4.5-py3-none-any.whl (38.8 kB view details)

Uploaded Python 3

File details

Details for the file phantominator-0.4.5.tar.gz.

File metadata

  • Download URL: phantominator-0.4.5.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9

File hashes

Hashes for phantominator-0.4.5.tar.gz
Algorithm Hash digest
SHA256 51c4ad064a61ef6bf3f0e49fe1e5883656b24a0be1cf3548f24cdac7e01db2d3
MD5 2224262e897c46846a6b16a032d42906
BLAKE2b-256 09de01896661953cd4cbfb58bdad0ad2806d5730e1a5e8c860c23bd49729e817

See more details on using hashes here.

File details

Details for the file phantominator-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: phantominator-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9

File hashes

Hashes for phantominator-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f03ee11dc58ebf0a305a1d76921ac9ca6f258281ad4a54e5c0fc7209d6905c04
MD5 b5311b7808a576beeea5bec598c275fd
BLAKE2b-256 653505cc071a19d299383e1f718dcf50d7a5055c261d82d141bbeff4ff0b0a96

See more details on using hashes here.

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