Read and write MetaImages with minimal dependencies
Project description
MetaIO
Read
MetaImages
(.mha or .mhd)
and
NIFTI
images (.nii or .nii.gz)
and write .mha images
in python with minimal dependencies.
Installation
Available on pypi.org: pip install tiny-metaio.
Usage
Writing a MHA file
>>> import metaio
>>> img = metaio.MetaImage([[0, 1], [42, 43]], spacing=[1, 2])
>>> img.save("some-name.mha")
Reading a MHA file
>>> img = metaio.read("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
numpyas 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tiny_metaio-0.2.0.tar.gz.
File metadata
- Download URL: tiny_metaio-0.2.0.tar.gz
- Upload date:
- Size: 54.5 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":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e64c64b4f1de5563bdd51c6b7fe9e6f038622af37d9ffb25905fa65f5fa0d74a
|
|
| MD5 |
ec93881a0329650f3b82e33e15e93521
|
|
| BLAKE2b-256 |
65eb69e48553b8d77467f7f762cfba0f309bd7f226d3c24efec09a82721de22d
|
File details
Details for the file tiny_metaio-0.2.0-py3-none-any.whl.
File metadata
- Download URL: tiny_metaio-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.1 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":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b707790ada8b49144663d9ab5f4967b6d909e18a4ecaeff3c587bdfa4255bc9
|
|
| MD5 |
fec7335a6e9544c3ada0a7d73849da4c
|
|
| BLAKE2b-256 |
97b9f5d4e83c188177ae265bebb0052c0ec04e63ed47e9e1825d2d529dd5d558
|