# mmgshow
Apply binary overlays as color layers on a binary or gray-scale image

## Synopsis

Y = mmgshow( X, X1 = None, X2 = None, X3 = None, X4 = None, X5 = None, X6 = None )

Implemented in Python.

### Input

X | Image Gray-scale (uint8 or uint16) or binary image.
X1 | Image Binary image. Red overlay. Default: `None`
X2 | Image Binary image. Green overlay. Default: `None`
X3 | Image Binary image. Blue overlay. Default: `None`
X4 | Image Binary image. Magenta overlay. Default: `None`
X5 | Image Binary image. Yellow overlay. Default: `None`
X6 | Image Binary image. Cyan overlay. Default: `None`

### Output

Y | Image Gray-scale (uint8 or uint16) or binary image.

## Source Code

    def mmgshow(X, X1=None, X2=None, X3=None, X4=None, X5=None, X6=None):
        if mmisbinary(X): X = mmgray(X,'uint8')
        r = X
        g = X
        b = X
        if X1 is not None: # red 1 0 0
          assert mmisbinary(X1),'X1 must be binary overlay'
          x1 = mmgray(X1,'uint8')
          r = mmunion(r,x1)
          g = mmintersec(g,mmneg(x1))
          b = mmintersec(b,mmneg(x1))
        if X2 is not None: # green 0 1 0
          assert mmisbinary(X2),'X2 must be binary overlay'
          x2 = mmgray(X2,'uint8')
          r = mmintersec(r,mmneg(x2))
          g = mmunion(g,x2)
          b = mmintersec(b,mmneg(x2))
        if X3 is not None: # blue 0 0 1
          assert mmisbinary(X3),'X3 must be binary overlay'
          x3 = mmgray(X3,'uint8')
          r = mmintersec(r,mmneg(x3))
          g = mmintersec(g,mmneg(x3))
          b = mmunion(b,x3)
        if X4 is not None: # magenta 1 0 1
          assert mmisbinary(X4),'X4 must be binary overlay'
          x4 = mmgray(X4,'uint8')
          r = mmunion(r,x4)
          g = mmintersec(g,mmneg(x4))
          b = mmunion(b,x4)
        if X5 is not None: # yellow 1 1 0
          assert mmisbinary(X5),'X5 must be binary overlay'
          x5 = mmgray(X5,'uint8')
          r = mmunion(r,x5)
          g = mmunion(g,x5)
          b = mmintersec(b,mmneg(x5))
        if X6 is not None: # cyan 0 1 1
          assert mmisbinary(X6),'X6 must be binary overlay'
          x6 = mmgray(X6,'uint8')
          r = mmintersec(r,mmneg(x6))
          g = mmunion(g,x6)
          b = mmunion(b,x6)
        return mmconcat('d',r,g,b)
        return Y

## See also

mmshow | Display binary or gray-scale images and optionally overlay it with binary images.

[`mmglblshow`] [Up] [`mmdtshow`] |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center.