This module import functions to manipulate images
Reads an image file completely into memory.
It uses the file extension to determine how to read the file. It first tries some specific readers for volume images (Inrimages, TIFFs, LSMs, NPY) or falls back on PIL readers for common formats if installed.
In all cases the returned image is 3D (2D is upgraded to single slice 3D). If it has colour or is a vector field it is even 4D.
Parameters: |
|
---|---|
Returns Type: |
Save a |SpatialImage| to filename.
The filewriter is choosen according to the file extension. However all file extensions will not match the data held by img, in dimensionnality or encoding, and might raise `IOError`s.
For real volume data, Inrimage and NPY are currently supported. For |SpatialImage|s that are actually 2D, PNG, BMP, JPG among others are supported if PIL is installed.
Parameters: |
|
---|
Load a pickled, .npy, or .npz binary file.
Parameters: |
|
---|---|
Returns Type: |
Save an array to a binary file in numpy format with a |SpatialImage| header.
Warning
There is no way to distinguish a 2D RGB[A] image from a 3D scalar image. If img is a 2D RGB[A] image, make sure its shape is similar to (SX,SY,1,3) for RGB or (SX,SY,1,4) for RGBA.
Parameters: |
|
---|