[mmmaxleveltype] [Up] [mmmat2set] Image Information and Manipulation

mmdatatype
Return the image datatype string

Synopsis

type = mmdatatype( f )

Implemented in Python.

Input

f Image Unsigned gray-scale (uint8 or uint16), signed (int32) or binary image.

Any image

Output

type String

String representation of image type: 'binary', 'uint8', 'uint16' or 'int32'

Description

mmdatatype returns a string that identifies the pixel datatype of the image f.

Source Code

def mmdatatype(f):
    code = f.typecode()
    if   code == '1': type='binary'
    elif code == 'b': type='uint8'
    elif code == 'w': type='uint16'
    elif code == 'i': type='int32'
    else:
        assert 0,'Does not accept this typecode:'+code
    return type
    
[mmmaxleveltype] [Up] [mmmat2set] Python