Pixel values are converted for type and sign by specifying values for
MI_ICV_SIGN (they default
MI_SIGNED). Values can also be converted
for valid range and for normalization. These conversions are enabled
TRUE (the default).
FALSE (the default) then only
conversions for valid range are made. This means that if the input
file has shorts in the range 0 to 4095, then they can be converted to
bytes in the range 64 to 248 (for example). The real image maximum and
MIimagemin) are ignored. The
valid range is specified by the properties
MI_ICV_VALID_MIN, which default to the legal range for the type
We may want to scale values so that they are normalized either to all
values in the
MIimage variable or to some user-defined range.
To do normalization, set
FALSE (the default) causes normalization to
the real maximum and minimum of the variable (the maximum of
MIimagemax and the minimum of
MI_ICV_USER_NORM is true then the values of
MI_ICV_IMAGE_MIN are used (defaulting to 1.0 and 0.0).
MI_ICV_TYPE or the file type is floating-point,
then the conversion to and from real values is always done using the
real image maximum and minimum information. If the internal type is
FALSE, then the rescaling
is done so that the slice maximum maps to the valid range of the
Note that when converting to integer types, values are rounded to the nearest integer and limited to be within the legal range for the data type.
The above transformations are simple enough, but the use of floating-point values adds to the complexity, since in general we do not want to rescale these values to get the real values. The various possibilities are described in greater detail below.