[mmis] [Up] [mmisequal] Relations

mmisbinary
Check for binary image

Synopsis

bool = mmisbinary( f )

Implemented in Python.

Input

f Image

Output

bool Boolean

Description

mmisbinary returns TRUE(1) if the datatype of the input image is binary. A binary image has just the values 0 and 1.

Examples

>>> a=uint8([0, 1, 0, 1])

              
>>> print mmisbinary(a)
0.0
>>> b=(a)

              
>>> print mmisbinary(b)
0.0

Source Code

def mmisbinary(f):
    bool = type(f) is type(mmbinary([1]))
    if bool:            
       bool = f.typecode() == '1'
    return bool
    

See also

mmfreedom Control automatic data type conversion.
mmbinary Convert a gray-scale image into a binary image
mmgray Convert a binary image into a gray-scale image.
mmis Verify if a relationship among images is true or false.
[mmis] [Up] [mmisequal] Python