Skip to main content

Read and write MetaImages with minimal dependencies

Project description

MetaIO

Read and write MetaImages in python with minimal dependencies.

Installation

Available on pypi.org: pip install metaio.

Usage

Writing a MHA file

>>> from metaio import MetaImage, read_mha
>>> img = MetaImage([[0, 1], [42, 43]], spacing=[1, 2])
>>> img.save("some-name.mha")

Reading a MHA file

>>> img = read_mha("some-name.mha")
>>> img.spacing
array([1., 2.])
>>> img.data
array([[ 0,  1],
       [42, 43]])
>>> img.direction
array([1., 0., 0., 1.])
>>> img.origin
array([0., 0.])

Philosophy

  • numpy as only runtime dependency.
  • idiomatic python.
  • similar behavior than SimpleITK's GetArrayFromImage, GetImageFromArray, GetDirection, GetOrigin, GetSpacing, ReadImage, WriteImage.

Why should I use this over SimpleITK?

If you just need the IO parts and do not want the large SimpleITK package, this package might be for you. If you do not care about having SimpleITK as a dependency for your project, this package is not for you.

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

tiny_metaio-0.1.1.tar.gz (52.0 kB view details)

Uploaded Source

Built Distribution

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

tiny_metaio-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file tiny_metaio-0.1.1.tar.gz.

File metadata

  • Download URL: tiny_metaio-0.1.1.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tiny_metaio-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4f50550aeb05e8818c91106d201b3802af4232cc36638532e7a02d86aac829dc
MD5 7c96d301f56af872ae86685fa310d320
BLAKE2b-256 da9e862352d3697981a8cf0f4b02090010f8194a0aedc62bfc120edd595831ab

See more details on using hashes here.

File details

Details for the file tiny_metaio-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tiny_metaio-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for tiny_metaio-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e0668dc3393f618663c3efe2749f4242cee449a44fb69450f7359aebb27ccc7
MD5 59199899bce66e2a9228f56abcafcc57
BLAKE2b-256 cbc635a4c4e100712c347400e65dd838d896a5ee1acfc993356df68392ca05ee

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