This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Before/after demo for plotly/plotly.py#5701 (sphinx-gallery scraper rewrite). | |
| # Creates ./sgdemo and ./sgdemo-venv, builds the same one-example gallery with | |
| # released plotly and with the PR branch, and prints what to compare. | |
| set -euo pipefail | |
| mkdir -p sgdemo/examples | |
| # a rerun must not reuse sphinx-gallery's cache of executed examples | |
| rm -rf sgdemo/auto_examples sgdemo/_build_before sgdemo/_build_after |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % FieldTrip reference runs for MNE-Python's mne/stats/tests/test_cluster_equiv.py | |
| % (see mne-tools/mne-python#12663). | |
| % | |
| % The input file cluster_equiv_data.mat is produced by the scenario builders in | |
| % test_cluster_equiv.py (exported with scipy.io.savemat); each scenario holds | |
| % `data` (n_rows x n_chan x n_times), per-row factor labels, and (for | |
| % within-subject designs) 1-based subject indices. This script runs the | |
| % matching FieldTrip cluster-based permutation test for each scenario with | |
| % ft_timelockstatistics (cfg.method = 'montecarlo', cfg.correctm = 'cluster', | |
| % cfg.clusterstatistic = 'maxsum') and saves/prints the observed stat map and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Minimal reproducer: OpenBLAS 0.3.20 DSYMM is wrong on its Cooperlake kernel. | |
| C = B @ A with A symmetric, column-major, via | |
| cblas_dsymm(CblasColMajor, CblasRight, CblasUpper, | |
| m, n, 1.0, A(n x n), n, B(m x n), m, 0.0, C, m) | |
| compared against numpy. (This is the call OpenMEEG makes in | |
| Matrix::operator*(const SymMatrix&).) | |
| Needs only numpy and a libopenblas. To exercise a kernel your CPU does not | |
| have, use Intel SDE -- `-cpx` sets CPUID to Cooper Lake -- together with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Create fsaverage_1020 | |
| headshape = ft_read_headshape('~/mne_data/MNE-sample-data/subjects/fsaverage/bem/outer_skin.surf'); | |
| % [pos, tri, magic] = read_surf('~/mne_data/MNE-sample-data/subjects/fsaverage/surf/lh.seghead'); | |
| % headshape = []; | |
| % headshape.pos = pos; | |
| % headshape.tri = tri; | |
| % ft_plot_mesh(headshape,'facecolor','skin');camlight; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Visual stimulus design. | |
| Tools for drawing shapes and text on the screen. | |
| """ | |
| # Authors: Dan McCloy <drmccloy@uw.edu> | |
| # Eric Larson <larsoner@uw.edu> | |
| # Ross Maddox <rkmaddox@uw.edu> | |
| # | |
| # License: BSD (3-clause) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import mne | |
| import time | |
| data_path = mne.datasets.sample.data_path() | |
| subjects_dir = data_path / 'subjects' | |
| n_dips = 10 | |
| radius = 0.05 | |
| rr = np.random.default_rng(0).normal(size=(n_dips, 3)) | |
| rr /= np.linalg.norm(rr, axis=1)[:, np.newaxis] / radius * 0.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import mne | |
| from mne.datasets import sample | |
| from mne.inverse_sparse import make_stc_from_dipoles, mixed_norm | |
| from mne.minimum_norm import apply_inverse, make_inverse_operator | |
| from mne.viz import ( | |
| plot_dipole_amplitudes, | |
| plot_dipole_locations, | |
| plot_sparse_source_estimates, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .PHONY: all clean openmeeg_wrap.cxx _example.so test1 test2 test3 test4 test5 | |
| all : clean example_wrap.cxx _example.so test1 test2 test3 test4 test5 | |
| clean: | |
| rm -f *.o | |
| rm -f *.so | |
| rm -f *wrap*.c* | |
| rm -f *wrapper.py | |
| rm -Rf build | |
| rm -Rf __pycache__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mne | |
| data_path = mne.datasets.sample.data_path() | |
| sample_data_raw_file = data_path / "MEG" / "sample" / "sample_audvis_raw.fif" | |
| subjects_dir = data_path / "subjects" | |
| raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False).crop(tmax=60) | |
| events = mne.find_events(raw, stim_channel="STI 014") | |
| epochs = mne.Epochs(raw, events, event_id = {"auditory/left": 1}, tmin=-0.3, tmax=0.7)[:10] | |
| inverse_operator_file = data_path / "MEG" / "sample" / "sample_audvis-meg-oct-6-meg-inv.fif" | |
| inv_operator = mne.minimum_norm.read_inverse_operator(inverse_operator_file) | |
| stcs = mne.minimum_norm.apply_inverse_epochs(epochs, inv_operator, lambda2=1/3, pick_ori=None) |
NewerOlder