The HDF_DFR8_NIMAGES function returns the number of 8-bit images in the specified Hierarchical Data Format file. A -1 is returned if the specified file is invalid or damaged.
h = HDF_OPEN('myhdf.hdf') ; Open the file myfile.hdf.
number = HDF_DFR8_NIMAGES('myhdf.hdf') ; Retrieve the number of 8-bit images in the file into the variable number; .