Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
753e6a7
Draft
adam2392 Sep 20, 2021
280442d
Which one?
adam2392 Sep 20, 2021
fb7acd8
Add fetch dataset'
adam2392 Sep 21, 2021
94c0898
Additional changes
adam2392 Sep 21, 2021
1df054a
Clean up based on comments
adam2392 Sep 21, 2021
2b7bc5f
Clean up docstring
adam2392 Sep 21, 2021
717d713
Adding fix to docstring?
adam2392 Sep 21, 2021
2bbc65b
Try again
adam2392 Sep 21, 2021
ca3bfde
Fix
adam2392 Sep 21, 2021
b87956c
Try again
adam2392 Sep 21, 2021
820f8b3
Try again
adam2392 Sep 21, 2021
6e3722e
Remove _data_path
adam2392 Sep 22, 2021
5bb9af7
Expose higher level
adam2392 Sep 22, 2021
16f731e
Apply suggestions from code review
adam2392 Sep 22, 2021
5c2766e
Try to fix circleci.
adam2392 Sep 23, 2021
f3ffcab
Try
adam2392 Sep 23, 2021
78bc571
Fix to list of dict
adam2392 Sep 23, 2021
bb1dc96
Clean up and make hf_sef work
adam2392 Sep 23, 2021
259a233
ADd additional changelog
adam2392 Sep 23, 2021
4d4d9dc
Fix auth token
adam2392 Sep 23, 2021
d60fe45
ADd init
adam2392 Sep 23, 2021
1413699
FIX: Path
larsoner Sep 23, 2021
dc16927
FIX: Try [circle full]
larsoner Sep 24, 2021
23939f0
FIX: Missed
larsoner Sep 24, 2021
2af4fbe
Fix fieldtrip cmc
adam2392 Sep 24, 2021
74180ea
Try full [circle full]
larsoner Sep 24, 2021
bab479b
Try again [circle full]
adam2392 Sep 24, 2021
53c80dd
Merge branch 'fetchapi' of github.com:adam2392/mne-python into fetchapi
adam2392 Sep 24, 2021
adf321d
try full [circle full]
adam2392 Sep 24, 2021
b7f3fbb
Try again [circle full]
adam2392 Sep 25, 2021
d3419d0
Update the misc button [circle full]
adam2392 Sep 25, 2021
066b6dc
Fix ci [circle full]
adam2392 Sep 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ Enhancements

- All data fetching code now relies on ``pooch``, which is an added optional requirement for dataset fetchers (:gh:`9742` by `Adam Li`_ and `Daniel McCloy`_)

- Add :func:`mne.datasets.fetch_dataset` to allow packages to fetch datasets in a similar fashion to MNE (:gh:`9763` by `Adam Li`_)

Bugs
~~~~
- Fix bug in :meth:`mne.io.Raw.pick` and related functions when parameter list contains channels which are not in info instance (:gh:`9708` **by new contributor** |Evgeny Goldstein|_)
Expand Down Expand Up @@ -250,3 +252,5 @@ API changes
- All ``mne.connectivity`` functions have moved to the ``mne-connectivity`` package; they are deprecated in MNE-Python and will be removed in version 0.25 (:gh:`9493` by `Adam Li`_).

- :func:`mne.inverse_sparse.mixed_norm` now simply warns when source estimates contain no dipole, e.g. if data are too noisy and alpha is based on SURE (:gh:`9685` by `Alex Gramfort`_)

- The output folder name for HF_SEF datasets is now ``hf_sef`` instead of ``HF_SEF`` (:gh:`9763` by `Adam Li`_)
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
'eeglabio': ('https://eeglabio.readthedocs.io/en/latest', None),
'dipy': ('https://dipy.org/documentation/1.4.0./',
'https://dipy.org/documentation/1.4.0./objects.inv/'),
'pooch': ('https://www.fatiando.org/pooch/latest/', None),
}


Expand Down
3 changes: 2 additions & 1 deletion doc/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Datasets

.. autosummary::
:toctree: generated/


fetch_dataset
brainstorm.bst_auditory.data_path
brainstorm.bst_resting.data_path
brainstorm.bst_raw.data_path
Expand Down
22 changes: 15 additions & 7 deletions examples/visualization/3d_to_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# License: BSD-3-Clause

# %%
from scipy.io import loadmat
from mne.io.fiff.raw import read_raw_fif
import numpy as np
from matplotlib import pyplot as plt
from os import path as op
Expand All @@ -38,7 +38,7 @@
sample_path = mne.datasets.sample.data_path()
subjects_dir = op.join(sample_path, 'subjects')
misc_path = mne.datasets.misc.data_path()
ecog_data_fname = op.join(misc_path, 'ecog', 'sample_ecog.mat')
ecog_data_fname = op.join(misc_path, 'ecog', 'sample_ecog_ieeg.fif')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# We've already clicked and exported
layout_path = op.join(op.dirname(mne.__file__), 'data', 'image')
Expand All @@ -51,12 +51,19 @@
# First we will load a sample ECoG dataset which we'll use for generating
# a 2D snapshot.

mat = loadmat(ecog_data_fname)
ch_names = mat['ch_names'].tolist()
elec = mat['elec'] # electrode coordinates in meters
raw = read_raw_fif(ecog_data_fname)
ch_names = raw.ch_names

# Since we loaded in the ecog data from FIF, the coordinates
# are in 'head' space, but we actually want them in 'mri' space.
# So we will extract the positions and create a new montage
# with the 'mri' coordinate frame.
montage = raw.get_montage()
ch_pos = montage.get_positions()['ch_pos']

# Now we make a montage and specify that these electrode contacts
# are in the "mri" or surface RAS coordinate frame
montage = mne.channels.make_dig_montage(ch_pos=dict(zip(ch_names, elec)),
montage = mne.channels.make_dig_montage(ch_pos=ch_pos,
coord_frame='mri')

# now we'll add some fiducials estimated from the Taliarach transform
Expand All @@ -66,7 +73,8 @@
# we also need the head->mri transform based on these fiducials
trans = mne.channels.compute_native_head_t(montage)

info = mne.create_info(ch_names, 1000., 'ecog').set_montage(montage)
info = mne.create_info(ch_names, 1000., 'ecog')
info.set_montage(montage)
print('Created %s channel positions' % len(ch_names))

# %%
Expand Down
4 changes: 3 additions & 1 deletion mne/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from . import ssvep
from . import erp_core
from . import epilepsy_ecog
from ._fetch import fetch_dataset
from .utils import (_download_all_example_data, fetch_hcp_mmp_parcellation,
fetch_aparc_sub_parcellation)
from ._fsaverage.base import fetch_fsaverage
Expand All @@ -37,5 +38,6 @@
'fetch_hcp_mmp_parcellation', 'fieldtrip_cmc', 'hf_sef', 'kiloword',
'misc', 'mtrf', 'multimodal', 'opm', 'phantom_4dbti', 'sample',
'sleep_physionet', 'somato', 'spm_face', 'ssvep', 'testing',
'visual_92_categories', 'limo', 'erp_core', 'epilepsy_ecog'
'visual_92_categories', 'limo', 'erp_core', 'epilepsy_ecog',
'fetch_dataset'
]
9 changes: 5 additions & 4 deletions mne/datasets/_fake/_fake.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
# License: BSD Style.

from ...utils import verbose
from ..utils import (_data_path, _data_path_doc,
from ..utils import (_data_path_doc, _download_mne_dataset,
_get_version, _version_doc)


@verbose
def data_path(path=None, force_update=False, update_path=False,
download=True, verbose=None): # noqa: D103
return _data_path(path=path, force_update=force_update,
update_path=update_path, name='fake',
download=download)
return _download_mne_dataset(
name='fake', processor='untar', path=path,
force_update=force_update, update_path=update_path,
download=download)


data_path.__doc__ = _data_path_doc.format(name='fake',
Expand Down
Loading