mne_bids/read.py
def _read_raw(raw_path, electrode=None, hsp=None, hpi=None,
              allow_maxshield=False, config_path=None, **kwargs):
    """Read a raw file into MNE, making inferences based on extension."""
    _, ext = _parse_ext(raw_path)

    # KIT systems
    if ext in ['.con', '.sqd']:
        raw = io.read_raw_kit(raw_path, elp=electrode, hsp=hsp,
                              mrk=hpi, preload=False, **kwargs)

    # BTi systems
    elif ext == '.pdf':
        raw = io.read_raw_bti(
            pdf_fname=str(raw_path),  # FIXME MNE should accept Path!
            config_fname=str(config_path),  # FIXME MNE should accept Path!
            head_shape_fname=hsp,
            preload=False,
            **kwargs
        )

    elif ext == '.fif':
        raw = reader[ext](raw_path, allow_maxshield, **kwargs)

    elif ext in ['.ds', '.vhdr', '.set', '.edf', '.bdf', '.EDF']:
        raw_path = Path(raw_path)
        raw = reader[ext](raw_path, **kwargs)

    # MEF and NWB are allowed, but not yet implemented
    elif ext in ['.mef', '.nwb']:
        raise ValueError(f'Got "{ext}" as extension. This is an allowed '
                         f'extension but there is no IO support for this '
                         f'file format yet.')

    # No supported data found ...
    # ---------------------------
    else:
        raise ValueError(f'Raw file name extension must be one '
                         f'of {ALLOWED_DATATYPE_EXTENSIONS}\n'
                         f'Got {ext}')
    return raw
Read a raw file into MNE, making inferences based on extension.
Read a raw file into MNE, making inferences based on extension.
Read a raw file into MNE making inferences based on extension .
def _read_raw(raw_path, electrode=None, hsp=None, hpi=None,
              allow_maxshield=False, config_path=None, **kwargs):
    _, ext = _parse_ext(raw_path)
    if ext in ['.con', '.sqd']:
        raw = io.read_raw_kit(raw_path, elp=electrode, hsp=hsp,
                              mrk=hpi, preload=False, **kwargs)
    elif ext == '.pdf':
        raw = io.read_raw_bti(
            pdf_fname=str(raw_path),  
            config_fname=str(config_path),  
            head_shape_fname=hsp,
            preload=False,
            **kwargs
        )
    elif ext == '.fif':
        raw = reader[ext](raw_path, allow_maxshield, **kwargs)
    elif ext in ['.ds', '.vhdr', '.set', '.edf', '.bdf', '.EDF']:
        raw_path = Path(raw_path)
        raw = reader[ext](raw_path, **kwargs)
    elif ext in ['.mef', '.nwb']:
        raise ValueError(f'Got "{ext}" as extension. This is an allowed '
                         f'extension but there is no IO support for this '
                         f'file format yet.')
    else:
        raise ValueError(f'Raw file name extension must be one '
                         f'of {ALLOWED_DATATYPE_EXTENSIONS}\n'
                         f'Got {ext}')
    return raw
def _read_raw ( raw_path , electrode = None , hsp = None , hpi = None , allow_maxshield = False , config_path = None , ** kwargs ) : _ , ext = _parse_ext ( raw_path ) if ext in [ '.con' , '.sqd' ] : raw = io . read_raw_kit ( raw_path , elp = electrode , hsp = hsp , mrk = hpi , preload = False , ** kwargs ) elif ext == '.pdf' : raw = io . read_raw_bti ( pdf_fname = str ( raw_path ) , config_fname = str ( config_path ) , head_shape_fname = hsp , preload = False , ** kwargs ) elif ext == '.fif' : raw = reader [ ext ] ( raw_path , allow_maxshield , ** kwargs ) elif ext in [ '.ds' , '.vhdr' , '.set' , '.edf' , '.bdf' , '.EDF' ] : raw_path = Path ( raw_path ) raw = reader [ ext ] ( raw_path , ** kwargs ) elif ext in [ '.mef' , '.nwb' ] : raise ValueError ( f'Got "{ext}" as extension. This is an allowed ' f'extension but there is no IO support for this ' f'file format yet.' ) else : raise ValueError ( f'Raw file name extension must be one ' f'of {ALLOWED_DATATYPE_EXTENSIONS}\n' f'Got {ext}' ) return raw
Read a raw file into MNE, making inferences based on extension.
Read a raw file into MNE making inferences based on extension .
"""Read a raw file into MNE, making inferences based on extension.""" # KIT systems # BTi systems # FIXME MNE should accept Path! # FIXME MNE should accept Path! # MEF and NWB are allowed, but not yet implemented # No supported data found ... # ---------------------------
raw_path
electrode
hsp
hpi
allow_maxshield
config_path