From d94f8ddc06016eb4a0266f383b20acf8809225a9 Mon Sep 17 00:00:00 2001 From: "behinger (s-ccs 001)" Date: Wed, 18 Sep 2024 19:46:29 +0000 Subject: [PATCH] added an example with custom bounds #38 --- docs/src/eeg.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/src/eeg.md b/docs/src/eeg.md index baaba71..d87a6f8 100644 --- a/docs/src/eeg.md +++ b/docs/src/eeg.md @@ -25,6 +25,24 @@ labels = ["s$i" for i in 1:size(data, 1)] TopoPlots.eeg_topoplot(data[:, 340, 1]; labels = labels, label_text = true, positions=positions, axis=(aspect=DataAspect(),)) ``` + +## Subset of channels +If you only ask to plot a subset of channels, we highly recommend to define your bounding geometry yourself. We follow MNE functionality and normalize the positions prior to interpolation / plotting. If you only use a subset of channels, the positions will be relative to eachother, not at absolute coordinates. + +```@example 1 +f = Figure() +ax1 = f[1,1] = Axis(f;aspect=DataAspect()) +ax2 = f[1,2] = Axis(f;aspect=DataAspect()) +kwlist = (;label_text=true,label_scatter=(markersize=10, strokewidth=2,color=:white)) +TopoPlots.eeg_topoplot!(ax1,[1,0.5,0]; labels=["Cz","Fz","Fp1"],kwlist...) +TopoPlots.eeg_topoplot!(ax2,[1,0.5,05]; labels=["Cz","Fz","Fp1"], bounding_geometry=Circle(Point2f(0.5,0.5), 0.5),kwlist...) + +f +``` +As visible in the left plot, the positions are normalized to the bounding geometry. The right plot shows the same data, but with Cz correctly centered. + + + ```@docs TopoPlots.example_data ```