mne-tools / mne-hfo

Estimate/compute high-frequency oscillations (HFOs) from iEEG data that are BIDS and MNE compatible using a scikit-learn-style API.
http://mne.tools/mne-hfo/
BSD 3-Clause "New" or "Revised" License
13 stars 16 forks source link

Is real sample data in mne-bids available? #51

Closed zhengliuer closed 2 years ago

zhengliuer commented 2 years ago

Hi, great repo! I want to use mne-hfo to do some research, is the data in mne-bids here https://mne.tools/mne-hfo/dev/tutorials/comparing_detectors.html#1-Working-with-Real-Data available in mne?

adam2392 commented 2 years ago

Hi @BarryLiu97 thanks! A lot of the direction of this repo is still in alpha stage, so hoping to make improvements.

https://openneuro.org/datasets/ds003498

zhengliuer commented 2 years ago

Thanks a lot!

zhengliuer commented 2 years ago

Hi, Mr. Li, when I loaded the sample data, I've got this error when I did raw = read_raw_bids(dataset_path, extra_params):

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
C:/Users/barryliu/AppData/Local/Temp/xpython_28768/2657012993.py in <module>
      1 # load dataset into mne Raw object
      2 extra_params = dict(preload=True)
----> 3 raw = read_raw_bids(dataset_path, extra_params)

<decorator-gen-586> in read_raw_bids(bids_path, extra_params, verbose)

D:\ProgramData\Miniconda3\envs\mne\lib\site-packages\mne_bids\read.py in read_raw_bids(bids_path, extra_params, verbose)
    682     if raw_path.suffix == '.fif' and 'allow_maxshield' not in extra_params:
    683         extra_params['allow_maxshield'] = True
--> 684     raw = _read_raw(raw_path, electrode=None, hsp=None, hpi=None,
    685                     config_path=config_path, **extra_params)
    686 

D:\ProgramData\Miniconda3\envs\mne\lib\site-packages\mne_bids\read.py in _read_raw(raw_path, electrode, hsp, hpi, allow_maxshield, config_path, **kwargs)
     57     elif ext in ['.ds', '.vhdr', '.set', '.edf', '.bdf', '.EDF']:
     58         raw_path = Path(raw_path)
---> 59         raw = reader[ext](raw_path, **kwargs)
     60 
     61     # MEF and NWB are allowed, but not yet implemented

D:\ProgramData\Miniconda3\envs\mne\lib\site-packages\mne\io\brainvision\brainvision.py in read_raw_brainvision(vhdr_fname, eog, misc, scale, preload, verbose)
    855     mne.io.Raw : Documentation of attribute and methods.
    856     """
--> 857     return RawBrainVision(vhdr_fname=vhdr_fname, eog=eog,
    858                           misc=misc, scale=scale, preload=preload,
    859                           verbose=verbose)

<decorator-gen-211> in __init__(self, vhdr_fname, eog, misc, scale, preload, verbose)

D:\ProgramData\Miniconda3\envs\mne\lib\site-packages\mne\io\brainvision\brainvision.py in __init__(self, vhdr_fname, eog, misc, scale, preload, verbose)
     71         vhdr_fname = op.abspath(vhdr_fname)
     72         (info, data_fname, fmt, order, n_samples, mrk_fname, montage,
---> 73          orig_units) = _get_vhdr_info(vhdr_fname, eog, misc, scale)
     74 
     75         with open(data_fname, 'rb') as f:

D:\ProgramData\Miniconda3\envs\mne\lib\site-packages\mne\io\brainvision\brainvision.py in _get_vhdr_info(vhdr_fname, eog, misc, scale)
    455                       "not a file with extension '%s'." % ext)
    456 
--> 457     settings, cfg, cinfostr, info = _aux_vhdr_info(vhdr_fname)
    458     info._unlocked = True
    459 

D:\ProgramData\Miniconda3\envs\mne\lib\site-packages\mne\io\brainvision\brainvision.py in _aux_vhdr_info(vhdr_fname)
    365         # same in Latin-1 and UTF-8
    366         header = header.decode('ascii', 'ignore').strip()
--> 367         _check_bv_version(header, 'header')
    368 
    369         settings = f.read()

D:\ProgramData\Miniconda3\envs\mne\lib\site-packages\mne\io\brainvision\brainvision.py in _check_bv_version(header, kind)
    315             return version
    316     else:
--> 317         raise ValueError(_data_err % (kind, header))
    318 
    319 

ValueError: MNE-Python currently only supports header versions 1.0 and 2.0, got unparsable '../../../.git/annex/objects/1W/fj/MD5E-s1619--90ced559786a5c30e9f7aadcb3a552d7.vhdr/MD5E-s1619--90ced559786a5c30e9f7aadcb3a552d7.vhdr'. Contact MNE-Python developers for support.

The code is exactly the same as the tutorial https://mne.tools/mne-hfo/stable/tutorials/compute_hfos_on_fedele_dataset.html#2-Optimizing-the-Detectors. Any solutions? Do I need to update the mne-bids to the dev version? @adam2392

adam2392 commented 2 years ago

Hmm.. tbh I'm not sure. This looks like a mne-bids issue, so if you want to open an issue there with a reproducible code snippet + data link, then devs there can take a look.

zhengliuer commented 2 years ago

OK, thank you for your advice!

zhengliuer commented 2 years ago

OK, it seems that I couldn't successfully download the data, I just got 143MB data, which seems like a network problem. I'll close this issue.