Skip to content

Commit

Permalink
upgrade to template 10-05 locations (#58)
Browse files Browse the repository at this point in the history
* fix labels, fix #39

* added a backward compatability with warning

* removed NaturalNeighbours for now until #55 is fixed

* added example of contourf and surface to docs

* added an example with custom bounds #38

* added 10-05 template electrodes; breaking: new default enlarge = 1.0 for eeg-topoplot only

* renamed     T3 is now T7
    T4 is now T8
    T5 is now P7
    T6 is now P8
according to the MCN system

* fixed 10/20 old labels work now too

* fixed bug

* added test for 10-20/10-05

* fix indent

* formatting

* s/begin/let

* docstrings

* s/warn/warning

* docs fix

* again

* 🤦

* I give up

---------

Co-authored-by: Phillip Alday <[email protected]>
Co-authored-by: Phillip Alday <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2024
1 parent 718cc8b commit c358936
Show file tree
Hide file tree
Showing 9 changed files with 655 additions and 13 deletions.
349 changes: 349 additions & 0 deletions assets/1005.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,349 @@
label x y
AF1 -0.1371 0.6754
AF10 0.8580 1.1810
AF10h 0.7078 0.9743
AF1h -0.0683 0.6700
AF2 0.1371 0.6754
AF2h 0.0683 0.6700
AF3 -0.2781 0.6983
AF3h -0.2069 0.6848
AF4 0.2781 0.6983
AF4h 0.2069 0.6848
AF5 -0.4269 0.7404
AF5h -0.3513 0.7166
AF6 0.4269 0.7404
AF6h 0.3513 0.7166
AF7 -0.5878 0.8090
AF7h -0.5056 0.7708
AF8 0.5878 0.8090
AF8h 0.5056 0.7708
AF9 -0.8580 1.1810
AF9h -0.7078 0.9743
AFF1 -0.1588 0.5428
AFF10 1.0322 1.0322
AFF10h 0.8515 0.8515
AFF1h -0.0790 0.5366
AFF2 0.1588 0.5428
AFF2h 0.0790 0.5366
AFF3 -0.3244 0.5692
AFF3h -0.2403 0.5535
AFF4 0.3244 0.5692
AFF4h 0.2403 0.5535
AFF5 -0.5042 0.6197
AFF5h -0.4120 0.5908
AFF6 0.5042 0.6197
AFF6h 0.4120 0.5908
AFF7 -0.7071 0.7071
AFF7h -0.6021 0.6576
AFF8 0.7071 0.7071
AFF8h 0.6021 0.6576
AFF9 -1.0322 1.0322
AFF9h -0.8515 0.8515
AFFz 0.0000 0.5345
AFp1 -0.1089 0.8246
AFp10 0.6626 1.3007
AFp10h 0.5467 1.0730
AFp1h -0.0543 0.8217
AFp2 0.1089 0.8246
AFp2h 0.0543 0.8217
AFp3 -0.2195 0.8369
AFp3h -0.1639 0.8296
AFp4 0.2195 0.8369
AFp4h 0.1639 0.8296
AFp5 -0.3339 0.8583
AFp5h -0.2761 0.8463
AFp6 0.3339 0.8583
AFp6h 0.2761 0.8463
AFp7 -0.4540 0.8910
AFp7h -0.3931 0.8731
AFp8 0.4540 0.8910
AFp8h 0.3931 0.8731
AFp9 -0.6626 1.3007
AFp9h -0.5467 1.0730
AFpz 0.0000 0.8207
AFz 0.0000 0.6682
C1 -0.1965 0.0000
C1h -0.0973 0.0000
C2 0.1965 0.0000
C2h 0.0973 0.0000
C3 -0.4088 0.0000
C3h -0.2996 0.0000
C4 0.4088 0.0000
C4h 0.2996 0.0000
C5 -0.6582 0.0000
C5h -0.5271 0.0000
C6 0.6582 0.0000
C6h 0.5271 0.0000
CCP1 -0.1976 -0.1008
CCP1h -0.0978 -0.0991
CCP2 0.1976 -0.1008
CCP2h 0.0978 -0.0991
CCP3 -0.4110 -0.1085
CCP3h -0.3012 -0.1039
CCP4 0.4110 -0.1085
CCP4h 0.3012 -0.1039
CCP5 -0.6620 -0.1244
CCP5h -0.5300 -0.1151
CCP6 0.6620 -0.1244
CCP6h 0.5300 -0.1151
CCPz 0.0000 -0.0985
CP1 -0.1933 -0.2034
CP1h -0.0958 -0.2000
CP2 0.1933 -0.2034
CP2h 0.0958 -0.2000
CP3 -0.4013 -0.2183
CP3h -0.2944 -0.2094
CP4 0.4013 -0.2183
CP4h 0.2944 -0.2094
CP5 -0.6433 -0.2489
CP5h -0.5164 -0.2311
CP6 0.6433 -0.2489
CP6h 0.5164 -0.2311
CPP1 -0.1859 -0.3098
CPP1h -0.0922 -0.3050
CPP2 0.1859 -0.3098
CPP2h 0.0922 -0.3050
CPP3 -0.3843 -0.3307
CPP3h -0.2826 -0.3181
CPP4 0.3843 -0.3307
CPP4h 0.2826 -0.3181
CPP5 -0.6113 -0.3731
CPP5h -0.4930 -0.3486
CPP6 0.6113 -0.3731
CPP6h 0.4930 -0.3486
CPPz 0.0000 -0.3034
CPz 0.0000 -0.1989
Cz 0.0000 0.0000
F1 -0.1747 0.4220
F10 1.1810 0.8580
F10h 0.9743 0.7078
F1h -0.0867 0.4161
F2 0.1747 0.4220
F2h 0.0867 0.4161
F3 -0.3592 0.4472
F3h -0.2650 0.4321
F4 0.3592 0.4472
F4h 0.2650 0.4321
F5 -0.5653 0.4970
F5h -0.4586 0.4683
F6 0.5653 0.4970
F6h 0.4586 0.4683
F7 -0.8090 0.5878
F7h -0.6812 0.5356
F8 0.8090 0.5878
F8h 0.6812 0.5356
F9 -1.1810 0.8580
F9h -0.9743 0.7078
FC1 -0.1933 0.2034
FC1h -0.0958 0.2000
FC2 0.1933 0.2034
FC2h 0.0958 0.2000
FC3 -0.4013 0.2183
FC3h -0.2944 0.2094
FC4 0.4013 0.2183
FC4h 0.2944 0.2094
FC5 -0.6433 0.2489
FC5h -0.5164 0.2311
FC6 0.6433 0.2489
FC6h 0.5164 0.2311
FCC1 -0.1976 0.1008
FCC1h -0.0978 0.0991
FCC2 0.1976 0.1008
FCC2h 0.0978 0.0991
FCC3 -0.4110 0.1085
FCC3h -0.3012 0.1039
FCC4 0.4110 0.1085
FCC4h 0.3012 0.1039
FCC5 -0.6620 0.1244
FCC5h -0.5300 0.1151
FCC6 0.6620 0.1244
FCC6h 0.5300 0.1151
FCCz 0.0000 0.0985
FCz 0.0000 0.1989
FFC1 -0.1859 0.3098
FFC1h -0.0922 0.3050
FFC2 0.1859 0.3098
FFC2h 0.0922 0.3050
FFC3 -0.3843 0.3307
FFC3h -0.2826 0.3181
FFC4 0.3843 0.3307
FFC4h 0.2826 0.3181
FFC5 -0.6113 0.3731
FFC5h -0.4930 0.3486
FFC6 0.6113 0.3731
FFC6h 0.4930 0.3486
FFCz 0.0000 0.3034
FFT10 1.3007 0.6626
FFT10h 1.0730 0.5467
FFT7 -0.8910 0.4540
FFT7h -0.7425 0.4070
FFT8 0.8910 0.4540
FFT8h 0.7425 0.4070
FFT9 -1.3007 0.6626
FFT9h -1.0730 0.5467
FT10 1.3884 0.4512
FT10h 1.1453 0.3722
FT7 -0.9511 0.3090
FT7h -0.7860 0.2738
FT8 0.9511 0.3090
FT8h 0.7860 0.2738
FT9 -1.3884 0.4512
FT9h -1.1453 0.3722
FTT10 1.4418 0.2284
FTT10h 1.1894 0.1884
FTT7 -0.9877 0.1564
FTT7h -0.8120 0.1376
FTT8 0.9877 0.1564
FTT8h 0.8120 0.1376
FTT9 -1.4418 0.2284
FTT9h -1.1894 0.1884
Fp1 -0.3090 0.9511
Fp1h -0.1564 0.9877
Fp2 0.3090 0.9511
Fp2h 0.1564 0.9877
Fpz 0.0000 1.0000
Fz 0.0000 0.4142
I1 -0.4512 -1.3884
I1h -0.2284 -1.4418
I2 0.4512 -1.3884
I2h 0.2284 -1.4418
Iz 0.0000 -1.4598
LPA -1.4598 -0.0000
N1 -0.4512 1.3884
N1h -0.2284 1.4418
N2 0.4512 1.3884
N2h 0.2284 1.4418
NAS -0.0000 1.4598
NFp1 -0.3722 1.1453
NFp1h -0.1884 1.1894
NFp2 0.3722 1.1453
NFp2h 0.1884 1.1894
NFpz -0.0000 1.2042
Nz -0.0000 1.4598
O1 -0.3090 -0.9511
O1h -0.1564 -0.9877
O2 0.3090 -0.9511
O2h 0.1564 -0.9877
OI1 -0.3722 -1.1453
OI1h -0.1884 -1.1894
OI2 0.3722 -1.1453
OI2h 0.1884 -1.1894
OIz 0.0000 -1.2042
Oz 0.0000 -1.0000
P1 -0.1747 -0.4220
P10 1.1810 -0.8580
P10h 0.9743 -0.7078
P1h -0.0867 -0.4161
P2 0.1747 -0.4220
P2h 0.0867 -0.4161
P3 -0.3592 -0.4472
P3h -0.2650 -0.4321
P4 0.3592 -0.4472
P4h 0.2650 -0.4321
P5 -0.5653 -0.4970
P5h -0.4586 -0.4683
P6 0.5653 -0.4970
P6h 0.4586 -0.4683
P7 -0.8090 -0.5878
P7h -0.6812 -0.5356
P8 0.8090 -0.5878
P8h 0.6812 -0.5356
P9 -1.1810 -0.8580
P9h -0.9743 -0.7078
PO1 -0.1371 -0.6754
PO10 0.8580 -1.1810
PO10h 0.7078 -0.9743
PO1h -0.0683 -0.6700
PO2 0.1371 -0.6754
PO2h 0.0683 -0.6700
PO3 -0.2781 -0.6983
PO3h -0.2069 -0.6848
PO4 0.2781 -0.6983
PO4h 0.2069 -0.6848
PO5 -0.4269 -0.7404
PO5h -0.3513 -0.7166
PO6 0.4269 -0.7404
PO6h 0.3513 -0.7166
PO7 -0.5878 -0.8090
PO7h -0.5056 -0.7708
PO8 0.5878 -0.8090
PO8h 0.5056 -0.7708
PO9 -0.8580 -1.1810
PO9h -0.7078 -0.9743
POO1 -0.1089 -0.8246
POO10 0.6626 -1.3007
POO10h 0.5467 -1.0730
POO1h -0.0543 -0.8217
POO2 0.1089 -0.8246
POO2h 0.0543 -0.8217
POO3 -0.2195 -0.8369
POO3h -0.1639 -0.8296
POO4 0.2195 -0.8369
POO4h 0.1639 -0.8296
POO5 -0.3339 -0.8583
POO5h -0.2761 -0.8463
POO6 0.3339 -0.8583
POO6h 0.2761 -0.8463
POO7 -0.4540 -0.8910
POO7h -0.3931 -0.8731
POO8 0.4540 -0.8910
POO8h 0.3931 -0.8731
POO9 -0.6626 -1.3007
POO9h -0.5467 -1.0730
POOz 0.0000 -0.8207
POz 0.0000 -0.6682
PPO1 -0.1588 -0.5428
PPO10 1.0322 -1.0322
PPO10h 0.8515 -0.8515
PPO1h -0.0790 -0.5366
PPO2 0.1588 -0.5428
PPO2h 0.0790 -0.5366
PPO3 -0.3244 -0.5692
PPO3h -0.2403 -0.5535
PPO4 0.3244 -0.5692
PPO4h 0.2403 -0.5535
PPO5 -0.5042 -0.6197
PPO5h -0.4120 -0.5908
PPO6 0.5042 -0.6197
PPO6h 0.4120 -0.5908
PPO7 -0.7071 -0.7071
PPO7h -0.6021 -0.6576
PPO8 0.7071 -0.7071
PPO8h 0.6021 -0.6576
PPO9 -1.0322 -1.0322
PPO9h -0.8515 -0.8515
PPOz 0.0000 -0.5345
Pz 0.0000 -0.4142
RPA 1.4598 0.0000
T10 1.4598 0.0000
T10h 1.2042 0.0000
T7 -1.0000 0.0000
T7h -0.8072 0.0000
T8 1.0000 0.0000
T8h 0.8072 -0.0000
T9 -1.4598 -0.0000
T9h -1.2042 -0.0000
TP10 1.3884 -0.4512
TP10h 1.1453 -0.3722
TP7 -0.9511 -0.3090
TP7h -0.7860 -0.2738
TP8 0.9511 -0.3090
TP8h 0.7860 -0.2738
TP9 -1.3884 -0.4512
TP9h -1.1453 -0.3722
TPP10 1.3007 -0.6626
TPP10h 1.0730 -0.5467
TPP7 -0.8910 -0.4540
TPP7h -0.7425 -0.4070
TPP8 0.8910 -0.4540
TPP8h 0.7425 -0.4070
TPP9 -1.3007 -0.6626
TPP9h -1.0730 -0.5467
TTP10 1.4418 -0.2284
TTP10h 1.1894 -0.1884
TTP7 -0.9877 -0.1564
TTP7h -0.8120 -0.1376
TTP8 0.9877 -0.1564
TTP8h 0.8120 -0.1376
TTP9 -1.4418 -0.2284
TTP9h -1.1894 -0.1884
Binary file added assets/layout_10_05.bin
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
using PyMNE, PyCall, TopoPlots
using PyMNE, PythonCall, TopoPlots
channels = ["fp1", "f3", "c3", "p3", "o1", "f7", "t3", "t5", "fz", "cz", "pz", "fp2", "f4", "c4", "p4", "o2", "f8", "t4", "t6"]
info = pycall(PyMNE.mne.create_info, PyObject, channels, 120.0; ch_types="eeg")
info.set_montage("standard_1020"; match_case=false)
layout = PyMNE.mne.find_layout(info)
write(TopoPlots.assetpath("layout_10_20.bin"), hcat(layout.pos[:, 1], layout.pos[:, 2]))

#---

using CSV,DataFrames

loc2d = CSV.read(TopoPlots.assetpath("1005.tsv"),DataFrame) # taken from https://github.com/sappelhoff/eeg_positions/blob/main/data/Fpz-T8-Oz-T7/standard_1005_2D.tsv
write(TopoPlots.assetpath("layout_10_05.bin"),hcat(loc2d.x,loc2d.y))
3 changes: 3 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using TopoPlots
using Documenter

using TopoPlots: CHANNEL_TO_POSITION_10_05, CHANNEL_TO_POSITION_10_20

DocMeta.setdocmeta!(TopoPlots, :DocTestSetup, :(using TopoPlots); recursive=true)

makedocs(;
modules=[TopoPlots],
authors="Benedikt Ehinger, Simon Danisch, Beacon Biosignals",
sitename="TopoPlots.jl",
checkdocs=:exports,
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://MakieOrg.github.io/TopoPlots.jl",
Expand Down
Loading

0 comments on commit c358936

Please sign in to comment.