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
def image_header_info ( filename ) : 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
Read file info from image header

    ANTsR function: `antsImageHeaderInfo`

    Arguments
    ---------
    filename : string
        name of image file from which info will be read

    Returns
    -------
    dict