def mhdReadHeader(fname):
    """Return a dictionary of meta data from meta header file"""
    fileIN = open(fname, 'r')
    line = fileIN.readline()
    meta_dict = {}
    tag_set1 = ['ObjectType', 'NDims', 'DimSize', 'ElementType',
        'ElementDataFile']
    tag_set2 = ['BinaryData', 'BinaryDataByteOrderMSB', 'CompressedData',
        'CompressedDataSize']
    tag_set3 = ['Offset', 'CenterOfRotation', 'AnatomicalOrientation',
        'ElementSpacing', 'TransformMatrix']
    tag_set4 = ['Comment', 'SeriesDescription', 'AcquisitionDate',
        'AcquisitionTime', 'StudyDate', 'StudyTime']
    tag_set = []
    tag_set.extend(tag_set1)
    tag_set.extend(tag_set2)
    tag_set.extend(tag_set3)
    tag_set.extend(tag_set4)
    tag_flag = [False] * len(tag_set)
    while line:
        tags = str.split(line, '=')
        for i in range(len(tag_set)):
            tag = tag_set[i]
            if str.strip(tags[0]) == tag and not tag_flag[i]:
                meta_dict[tag] = str.strip(tags[1])
                tag_flag[i] = True
        line = fileIN.readline()
    fileIN.close()
    return meta_dict
