[mmGray] [Up] [mmUshort] Data Type Conversion

mmUbyte
Converts a BIT, UBYTE, USHORT or DOUBLE image into an UBYTE image.

Synopsis

Image mmUbyte ( const Image& X , const String& METHOD = "CAST", const Double& MIN = 0, const Double& MAX = 255 );

Input

X Image [ Gray-scale (uint8 or uint16) or binary image ]

BIT, UBYTE, USHORT or DOUBLE image.

METHOD String

'CAST', 'NORM', or 'WINLEV'.

Default: "CAST"

MIN Double

minimum Gray-Level in output image.

Default: 0

MAX Double

Maximum gray-level in output image.

Default: 255

Output

Y Image

UBYTE image

Description

mmUbyte converts a BIT, UBYTE, USHORT or DOUBLE image X into an UBYTE image following one of three conversion methods: METHOD = 'CAST': copy and truncate the pixel values. METHOD = 'NORM': normalize the result such that the minimum value of the image is assigned the value MIN and the maximum pixel value of the image is assigned the value MAX. This method is not applied to binary images METHOD = 'WINLEV': enhance the pixels between MIN and MAX. values less or equal MIN are assigned 0, values larger or equal MAX are assigned 255. The other values are scaled accordingly.

See also

mmBit Put an uint8 binary image into packed bit format
[mmGray] [Up] [mmUshort]