scales all values of
that lie in the range (
) into the range (0
). The returned result has the same structure as the original parameter and is of byte type.
Result = BYTSCL(
The array to be scaled and converted to bytes.
The maximum value of
to be considered. If MAX is not provided,
is searched for its maximum value. All values greater or equal to MAX are set equal to TOP in the result.
The minimum value of
to be considered. If MIN is not provided,
is searched for its minimum value. All values less than or equal to MIN are set equal to 0 in the result.
Set this keyword to cause the routine to check for occurrences of the IEEE floating-point value NaN in the input data. Elements with the value NaN are treated as missing data. (See
Special Floating-Point Values
for more information on IEEE floating-point values.)
The maximum value of the scaled result. If TOP is not specified, 255 is used. Note that the minimum value of the scaled result is always 0.
BYTSCL is often used to scale images into the appropriate range for 8-bit displays. As an example, enter the following commands:
IM = DIST(200)
Now scale the image into the full range of bytes (0 to 255) and re-display it by entering:
IM = BYTSCL(IM)