File: meg_sensors.py

package info (click to toggle)
python-mne 1.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 100,172 kB
  • sloc: python: 166,349; pascal: 3,602; javascript: 1,472; sh: 334; makefile: 236
file content (77 lines) | stat: -rw-r--r-- 2,013 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- coding: utf-8 -*-
"""
.. _ex-plot-meg-sensors:

======================================
Plotting sensor layouts of MEG systems
======================================

Show sensor layouts of different MEG systems.
"""
# Author: Eric Larson <larson.eric.d@gmail.com>
#
# License: BSD-3-Clause

# %%

from pathlib import Path

import mne
from mne.datasets import sample, spm_face, testing
from mne.io import (read_raw_artemis123, read_raw_bti, read_raw_ctf,
                    read_raw_fif, read_raw_kit)
from mne.viz import plot_alignment, set_3d_title

print(__doc__)

root_path = Path(mne.__file__).parent.absolute()

# %%
# Neuromag
# --------

kwargs = dict(eeg=False, coord_frame='meg', show_axes=True, verbose=True)

raw = read_raw_fif(
    sample.data_path() / 'MEG' / 'sample' / 'sample_audvis_raw.fif')
fig = plot_alignment(raw.info, meg=('helmet', 'sensors'), **kwargs)
set_3d_title(figure=fig, title='Neuromag')

# %%
# CTF
# ---

raw = read_raw_ctf(
    spm_face.data_path() / 'MEG' / 'spm' / 'SPM_CTF_MEG_example_faces1_3D.ds')
fig = plot_alignment(raw.info, meg=('helmet', 'sensors', 'ref'), **kwargs)
set_3d_title(figure=fig, title='CTF 275')

# %%
# BTi
# ---

bti_path = root_path / 'io' / 'bti' / 'tests' / 'data'
raw = read_raw_bti(bti_path / 'test_pdf_linux',
                   bti_path / 'test_config_linux',
                   bti_path / 'test_hs_linux')
fig = plot_alignment(raw.info, meg=('helmet', 'sensors', 'ref'), **kwargs)
set_3d_title(figure=fig, title='Magnes 3600wh')

# %%
# KIT
# ---

kit_path = root_path / 'io' / 'kit' / 'tests' / 'data'
raw = read_raw_kit(kit_path / 'test.sqd')
fig = plot_alignment(raw.info, meg=('helmet', 'sensors'), **kwargs)
set_3d_title(figure=fig, title='KIT')

# %%
# Artemis123
# ----------

raw = read_raw_artemis123(
    testing.data_path() / 'ARTEMIS123' /
    'Artemis_Data_2017-04-14-10h-38m-59s_Phantom_1k_HPI_1s.bin')
fig = plot_alignment(raw.info, meg=('helmet', 'sensors', 'ref'), **kwargs)
set_3d_title(figure=fig, title='Artemis123')