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
""" | |
.. _ex-inverse-source-power: | |
========================================= | |
Compute source power using DICS beamfomer | |
========================================= | |
Compute a Dynamic Imaging of Coherent Sources (DICS) [1]_ filter from | |
single-trial activity to estimate source power across a frequency band. This | |
example demonstrates how to source localize the event-related synchronization |
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 subprocess | |
import os | |
import mne | |
mne.set_log_level(False) | |
fname = 'bids/sub-{subject:02d}/ses-{session:02d}/meg/sub-{subject:02d}_ses-{session:02d}_task-naming_run-{run:02d}_meg.fif' | |
for subject in range(1, 21): | |
for session in range(1, 3): |
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
{"embeddings": [{"tensorName": "aalto85", "sensorShape": [123, 85], "tensorPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/aalto85/vectors.tsv", "metadataPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/aalto85/metadata.tsv"}, {"tensorName": "aaltoprod", "sensorShape": [300, 5683], "tensorPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/aaltoprod/vectors.tsv", "metadataPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/aaltoprod/metadata.tsv"}, {"tensorName": "cmu", "sensorShape": [1000, 229], "tensorPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/cmu/vectors.tsv", "metadataPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/cmu/metadata.tsv"}, {"tensorName": "cslb", "sensorShape": [638, 2725], "tensorPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/cslb/vectors.tsv", "metadataPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/cslb/metadata.tsv"}, {"tensorName": "vinson", "sensorShape": [395, 1029], "tensorPath": "/u/45/vanvlm1/unix/public_html/aaltonorms/vinson/vectors.tsv", "metadataPath": "/u/45/vanvlm1 |
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
# encoding: utf-8 | |
# Import required Python modules for this example | |
import pandas as pd | |
import seaborn as sb | |
from matplotlib import pyplot as plt | |
from matplotlib.ticker import MultipleLocator | |
# Reading the data | |
dataframe = pd.read_table('Sensory_measurement.txt', index_col=0) |
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
""" | |
Test whether applying SSP to a CSD matrix is the same as computing the CSD | |
matrix on data where the SSP has already been applied. | |
author: Marijn van Vliet <[email protected]> | |
""" | |
import numpy as np | |
import mne | |
# Be quiet |
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
"""Utility class to manage a list of filenames. | |
Use the `add` method to add new filenames. You specify a short "alias" for | |
them, which you can use to retrieve the full filename later: | |
>>> fname = FileNames() | |
>>> fname.add('my_file', '/path/to/file1') | |
>>> fname.my_file | |
'/path/to/file1' |
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
@verbose | |
def normalize_forward_solution(forward, depth=0.8, limit_depth_chs=True, loose=0.2, | |
use_cps=True, projs=None, verbose=None): | |
"""Normalize a forward solution. | |
Parameters | |
---------- | |
forward : instance of Forward | |
Forward solution to normalize. | |
depth : None | float in [0, 1] |
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 os.path as op | |
import numpy as np | |
import mne | |
from mne.datasets import sample | |
# Import sample data | |
path = op.join(sample.data_path(), 'MEG', 'sample') | |
raw = mne.io.read_raw_fif(op.join(path, 'sample_audvis_filt-0-40_raw.fif')) | |
events = mne.read_events(op.join(path, 'sample_audvis_filt-0-40_raw-eve.fif')) | |
epochs = mne.Epochs(raw, events, [1, 2], tmin=-0.2, tmax=1.0, preload=True) |
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
# PROPOSED FUNCTIONS | |
select_vertices_in_label(inst, label): | |
"""Return the vertno of the vertices that lie within one of the labels.""" | |
select_vertices_in_sensor_range(inst, max_dist, info=None): | |
"""Return the vertno of the vertices which nearest sensor is no further away than max_dist.""" | |
restrict_vertices(inst, vertices): | |
"""Restrict the vertices in a Forward, SourceSpaces or SourceEstimate object to the given vertno.""" |