Since the intensity values are resampled in the mapping from the raw
space of the LI to the geometrically rectified space of the SI, the
flag values must also be appropriately mapped into this new space.
In order to map the flag values from raw space to the new geometric
space, a ``resampling'' algorithm is clearly not desired as the
flags have a very specific discrete meaning which must be
maintained. The flag values need to be mapped to their new coordinates
such that they retain their initial values, but also are appropriately
assigned to additional locations in the remapped space in accordance to
the distribution of intensities.
The residuals from integer coordinates are computed for the sample and
line final floating-point geometric coordinates. These residuals are
then evaluated in combination against a pre-defined threshold of 0.25.
This threshold represents an ``in-between'' region which determines if
the flags should be mapped to 1, 2, 3, or 4 pixels in the final
geometric space.