<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def image_header_info(filename):
 """ Read file info from image header ANTsR function: `antsImageHeaderInfo` Arguments --------- filename : string name of image file from which info will be read Returns ------- dict """

    if not os.path.exists(filename):
        raise Exception('filename does not exist')

    libfn = utils.get_lib_fn('antsImageHeaderInfo')
    retval = libfn(filename)
    retval['dimensions'] = tuple(retval['dimensions'])
    retval['origin'] = tuple([round(o,4) for o in retval['origin']])
    retval['spacing'] = tuple([round(s,4) for s in retval['spacing']])
    retval['direction'] = np.round(retval['direction'],4)
    return retval