Loading and saving images¶
>>> from medpy.io import load >>> image_data, image_header = load('path/to/image.xxx')
image_data is a
ndarray with the image data and
image_header is a header object holding the associated metadata.
Now, to save the image, use
>>> from medpy.io import load, save >>> save(image_data, 'path/to/image.xxx', image_header)
The image format is automatically deducted from the file ending.