def read_fiducials(fname):
    'Read fiducials from a fiff file\n\n    Returns\n    -------\n    pts : list of dicts\n        List of digitizer points (each point in a dict).\n    coord_frame : int\n        The coordinate frame of the points (one of\n        mne.fiff.FIFF.FIFFV_COORD_...)\n    '
    (fid, tree, _) = fiff_open(fname)
    with fid:
        isotrak = dir_tree_find(tree, FIFF.FIFFB_ISOTRAK)
        isotrak = isotrak[0]
        pts = []
        coord_frame = FIFF.FIFFV_COORD_UNKNOWN
        for k in range(isotrak['nent']):
            kind = isotrak['directory'][k].kind
            pos = isotrak['directory'][k].pos
            if (kind == FIFF.FIFF_DIG_POINT):
                tag = read_tag(fid, pos)
                pts.append(tag.data)
            elif (kind == FIFF.FIFF_MNE_COORD_FRAME):
                tag = read_tag(fid, pos)
                coord_frame = tag.data[0]
    if (coord_frame == FIFF.FIFFV_COORD_UNKNOWN):
        err = ('No coordinate frame was found in the file %r, it is probably not a valid fiducials file.' % fname)
        raise ValueError(err)
    for pt in pts:
        pt['coord_frame'] = coord_frame
    return (pts, coord_frame)
Read fiducials from a fiff file

Returns
-------
pts : list of dicts
    List of digitizer points (each point in a dict).
coord_frame : int
    The coordinate frame of the points (one of
    mne.fiff.FIFF.FIFFV_COORD_...)
def read_fiducials(fname):
    'Read fiducials from a fiff file\n\n    Returns\n    -------\n    pts : list of dicts\n        List of digitizer points (each point in a dict).\n    coord_frame : int\n        The coordinate frame of the points (one of\n        mne.fiff.FIFF.FIFFV_COORD_...)\n    '
    (fid, tree, _) = fiff_open(fname)
    with fid:
        isotrak = dir_tree_find(tree, FIFF.FIFFB_ISOTRAK)
        isotrak = isotrak[0]
        pts = []
        coord_frame = FIFF.FIFFV_COORD_UNKNOWN
        for k in range(isotrak['nent']):
            kind = isotrak['directory'][k].kind
            pos = isotrak['directory'][k].pos
            if (kind == FIFF.FIFF_DIG_POINT):
                tag = read_tag(fid, pos)
                pts.append(tag.data)
            elif (kind == FIFF.FIFF_MNE_COORD_FRAME):
                tag = read_tag(fid, pos)
                coord_frame = tag.data[0]
    if (coord_frame == FIFF.FIFFV_COORD_UNKNOWN):
        err = ('No coordinate frame was found in the file %r, it is probably not a valid fiducials file.' % fname)
        raise ValueError(err)
    for pt in pts:
        pt['coord_frame'] = coord_frame
    return (pts, coord_frame)