Skip to content

Commit

Permalink
updating path handling inverse folder (mne-tools#10896)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashdrew authored Jul 1, 2022
1 parent 37bbe27 commit 3c23f13
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 deletions.
8 changes: 3 additions & 5 deletions tutorials/inverse/10_stc_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,17 @@

# %%

import os

from mne import read_source_estimate
from mne.datasets import sample

print(__doc__)

# Paths to example data
sample_dir_raw = sample.data_path()
sample_dir = os.path.join(sample_dir_raw, 'MEG', 'sample')
subjects_dir = os.path.join(sample_dir_raw, 'subjects')
sample_dir = sample_dir_raw / 'MEG' / 'sample'
subjects_dir = sample_dir_raw / 'subjects'

fname_stc = os.path.join(sample_dir, 'sample_audvis-meg')
fname_stc = sample_dir / 'sample_audvis-meg'

# %%
# Load and inspect example data
Expand Down
13 changes: 6 additions & 7 deletions tutorials/inverse/20_dipole_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
from nilearn.datasets import load_mni152_template

data_path = mne.datasets.sample.data_path()
subjects_dir = op.join(data_path, 'subjects')
fname_ave = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif')
fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis-cov.fif')
fname_bem = op.join(subjects_dir, 'sample', 'bem', 'sample-5120-bem-sol.fif')
fname_trans = op.join(data_path, 'MEG', 'sample',
'sample_audvis_raw-trans.fif')
fname_surf_lh = op.join(subjects_dir, 'sample', 'surf', 'lh.white')
subjects_dir = data_path / 'subjects'
fname_ave = data_path / 'MEG' / 'sample' / 'sample_audvis-ave.fif'
fname_cov = data_path / 'MEG' / 'sample' / 'sample_audvis-cov.fif'
fname_bem = subjects_dir / 'sample' / 'bem' / 'sample-5120-bem-sol.fif'
fname_trans = data_path / 'MEG' / 'sample' / 'sample_audvis_raw-trans.fif'
fname_surf_lh = subjects_dir / 'sample' / 'surf' / 'lh.white'

# %%
# Let's localize the N100m (using MEG only)
Expand Down
16 changes: 7 additions & 9 deletions tutorials/inverse/70_eeg_mri_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

# %%

import os.path as op

import nibabel
from nilearn.plotting import plot_glass_brain
import numpy as np
Expand Down Expand Up @@ -45,15 +43,15 @@
# and thus are stored as part of the ``misc`` dataset).

data_path = mne.datasets.sample.data_path()
subjects_dir = op.join(data_path, 'subjects')
fname_raw = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')
bem_dir = op.join(subjects_dir, 'sample', 'bem')
fname_bem = op.join(bem_dir, 'sample-5120-5120-5120-bem-sol.fif')
fname_src = op.join(bem_dir, 'sample-oct-6-src.fif')
subjects_dir = data_path / 'subjects'
fname_raw = data_path / 'MEG' / 'sample' / 'sample_audvis_raw.fif'
bem_dir = subjects_dir / 'sample' / 'bem'
fname_bem = bem_dir / 'sample-5120-5120-5120-bem-sol.fif'
fname_src = bem_dir / 'sample-oct-6-src.fif'

misc_path = mne.datasets.misc.data_path()
fname_T1_electrodes = op.join(misc_path, 'sample_eeg_mri', 'T1_electrodes.mgz')
fname_mon = op.join(misc_path, 'sample_eeg_mri', 'sample_mri_montage.elc')
fname_T1_electrodes = misc_path / 'sample_eeg_mri' / 'T1_electrodes.mgz'
fname_mon = misc_path / 'sample_eeg_mri' / 'sample_mri_montage.elc'

##############################################################################
# Visualizing the MRI
Expand Down
3 changes: 1 addition & 2 deletions tutorials/inverse/80_brainstorm_phantom_elekta.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

# %%

import os.path as op
import numpy as np
import matplotlib.pyplot as plt

Expand All @@ -37,7 +36,7 @@
# are read to construct instances of :class:`mne.io.Raw`.
data_path = bst_phantom_elekta.data_path(verbose=True)

raw_fname = op.join(data_path, 'kojak_all_200nAm_pp_no_chpi_no_ms_raw.fif')
raw_fname = data_path / 'kojak_all_200nAm_pp_no_chpi_no_ms_raw.fif'
raw = read_raw_fif(raw_fname)

# %%
Expand Down
5 changes: 2 additions & 3 deletions tutorials/inverse/85_brainstorm_phantom_ctf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

# %%

import os.path as op
import warnings

import numpy as np
Expand All @@ -42,9 +41,9 @@
# Switch to these to use the higher-SNR data:
# raw_path = op.join(data_path, 'phantom_200uA_20150709_01.ds')
# dip_freq = 7.
raw_path = op.join(data_path, 'phantom_20uA_20150603_03.ds')
raw_path = data_path / 'phantom_20uA_20150603_03.ds'
dip_freq = 23.
erm_path = op.join(data_path, 'emptyroom_20150709_01.ds')
erm_path = data_path / 'emptyroom_20150709_01.ds'
raw = read_raw_ctf(raw_path, preload=True)

# %%
Expand Down

0 comments on commit 3c23f13

Please sign in to comment.