[Up] [mmSe] Data Types

mmImage
Toolbox image datatype

Description

The Morphology Toolbox mainly supports four types of images according to their pixel datatypes : binary, unsigned gray scale uint8 and uint16, and signed gray scale int32. Most functions work for 1D, 2D and 3D images. If an operation involves images of specific datatype, an automatic conversion can take place, controlled by the function mmfreedom. To verify the datatype of an image, use the functions: mmdatatype and mmlimits.

Examples

In the examples below, all images has pixels with values zero and one, but only the first one is a binary image. This can be verified by calling the function mmlimits that outputs the minimum and maximum pixel values allowed in an image.

>>> f1 = mmbinary([[0,1,0,1],
                   [0,0,1,1]])

              
>>> print mmlimits(f1)
[0 1]
>>> print mmdatatype(f1)
binary
>>> f2 = uint8([[0,1,0,1],
                [0,0,1,1]])

              
>>> print mmlimits(f2)
[  0 255]
>>> print mmdatatype(f2)
uint8
>>> f3 = uint16([[0,1,0,1],
                [0,0,1,1]])

              
>>> print mmlimits(f3)
[    0 65535]
>>> print mmdatatype(f3)
uint16
>>> f4 = int32([[0,1,0,1],
               [0,0,1,1]])

              
>>> print mmlimits(f4)
[-2147483647  2147483647]
>>> print mmdatatype(f4)
int32

See also

mmbinary Convert a gray-scale image into a binary image
uint8 Convert an image to an uint8 image.
uint16 Convert an image to a uint16 image.
int32 Convert an image to an int32 image.
mmshow Display binary or gray-scale images and optionally overlay it with binary images.
mmdatatype Return the image datatype string
mmlimits Get the possible minimum and maximum of an image.
mmfreedom Control automatic data type conversion.
[Up] [mmSe] Python