MetaImageIO

Support for reading and writing images in MetaIO file format.

View the Project on GitHub auneri/MetaImageIO

MetaImageIO

Support for reading and writing images in MetaIO file format.

license build pypi conda-forge matlab-file-exchange

Getting started in Python

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

Getting started in MATLAB

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');