EENVI function does not produce the GeoTiff by default. We need another function to convert it to GeoTiff. For example:

ENVI_MASK_APPLY_DOIT, /in_memory, DIMS = dims_mask, $

                             FID = fid_in, $

                             M_FID = fid_mask, M_POS = m_pos, $

                             POS = pos, $

                             R_FID = fid_out, $

                             VALUE = missing_value

ENVI_FILE_QUERY, fid_out, dims=dims

ENVI_OUTPUT_TO_EXTERNAL_FORMAT, fid = fid_out ,OUT_NAME = sFilename_out,$

          dims=dims