Support for reading and writing images in MetaIO file format.
Support for reading and writing images in MetaIO file format.
Install using pip install metaimageio
or conda install -c conda-forge metaimageio
.
import metaimageio
image, meta = metaimageio.read('/path/to/input.mha')
metaimageio.write('/path/to/output.mha', image, ElementSpacing=meta['ElementSpacing'])
Add to imageio plugins.
import imageio
metaimageio.imageio()
image = imageio.imread('/path/to/input.mha')
meta = image.meta
Install using the Add-On Manager.
[image, meta] = metaimageio.read('/path/to/input.mha');
metaimageio.write('/path/to/output.mha', image, 'ElementSpacing', meta.ElementSpacing);
Add to image file format registry.
metaimageio.imformats();
image = imread('/path/to/input.mha');
meta = imfinfo('/path/to/input.mha');