def read_uic4tag(fh, byteorder, dtype, plane_count):
 assert ((dtype == '1I') and (byteorder == '<'))
 result = {}
 while True:
  tagid = struct.unpack('<H', fh.read(2))[0]
  if (tagid == 0):
   break
  (name, value) = read_uic_tag(fh, tagid, plane_count, offset=False)
  result[name] = value
 return result

def read_uic4tag ( fh , byteorder , dtype , plane_count ) : assert ( ( dtype == '1I' ) and ( byteorder == '<' ) ) result = { } while True : tagid = struct . unpack ( '<H' , fh . read ( 2 ) ) [ 0 ] if ( tagid == 0 ) : break ( name , value ) = read_uic_tag ( fh , tagid , plane_count , offset = False ) result [ name ] = value return result
read metamorph stk uic4tag from file and return as dictionary .