using PyMNE
using UnfoldMakie
using CairoMakieThere are dozens of standard and arbitrary ways to set electrodes. Using PyMNE package you can get 27 predefined montages with corresponding lavels and channel positions.
builtin_montages = PyMNE.channels.get_builtin_montages(descriptions = true)
pyconvert(Vector{Tuple{String,String}}, builtin_montages)28-element Vector{Tuple{String, String}}:
("standard_1005", "Electrodes are named and positioned according to the international 10-05 system (343+3 locations)")
("standard_1020", "Electrodes are named and positioned according to the international 10-20 system (94+3 locations)")
("standard_alphabetic", "Electrodes are named with LETTER-NUMBER combinations (A1, B2, F4, …) (65+3 locations)")
("standard_postfixed", "Electrodes are named according to the international 10-20 system using postfixes for intermediate positions (100+3 locations)")
("standard_prefixed", "Electrodes are named according to the international 10-20 system using prefixes for intermediate positions (74+3 locations)")
("standard_primed", "Electrodes are named according to the international 10-20 system using prime marks (' and '') for intermediate positions (100+3 locations)")
("biosemi16", "BioSemi cap with 16 electrodes (16+3 locations)")
("biosemi32", "BioSemi cap with 32 electrodes (32+3 locations)")
("biosemi64", "BioSemi cap with 64 electrodes (64+3 locations)")
("biosemi128", "BioSemi cap with 128 electrodes (128+3 locations)")
⋮
("GSN-HydroCel-128", "HydroCel Geodesic Sensor Net (128+3 locations)")
("GSN-HydroCel-129", "HydroCel Geodesic Sensor Net and Cz (129+3 locations)")
("GSN-HydroCel-256", "HydroCel Geodesic Sensor Net (256+3 locations)")
("GSN-HydroCel-257", "HydroCel Geodesic Sensor Net and Cz (257+3 locations)")
("mgh60", "The (older) 60-channel cap used at MGH (60+3 locations)")
("mgh70", "The (newer) 70-channel BrainVision cap used at MGH (70+3 locations)")
("artinis-octamon", "Artinis OctaMon fNIRS (8 sources, 2 detectors)")
("artinis-brite23", "Artinis Brite23 fNIRS (11 sources, 7 detectors)")
("brainproducts-RNP-BA-128", "Brain Products with 10-10 electrode names (128 channels)")This demonstration will show how could motages differ from each other
begin
f = Figure(size = (1200, 800))
montages = [
("Biosemi", "biosemi64"),
("10-20", "standard_1020"),
("10-05", "standard_1005"),
("brainproducts-128", "brainproducts-RNP-BA-128"),
]
for (i, (title, mname)) in enumerate(montages)
row = (i - 1) ÷ 2 + 1
col = (i - 1) % 2 + 1
montage = PyMNE.channels.make_standard_montage(mname)
labels = pyconvert(Vector{String}, montage.ch_names)
ch_pos = pyconvert(Dict{String,Any}, montage.get_positions()["ch_pos"])
pos3d = hcat([ch_pos[l] for l in labels]...)
pos2 = to_positions(pos3d)
scatter(f[row, col], pos2, axis = (title = title,))
text!(
f[row, col],
labels,
position = Point2f.(pos2),
align = (:center, :center),
fontsize = 16,
)
end
f
end
This page was generated using Literate.jl.