Skip to content

Commit

Permalink
Documentation for channel subset (#57)
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

* merge fixes

* typo

* remove extra file

* minor formatting

* oops

* re-enable natural neighbours

---------

Co-authored-by: Phillip Alday <[email protected]>
  • Loading branch information
behinger and palday authored Nov 16, 2024
1 parent eea824d commit 718cc8b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
18 changes: 18 additions & 0 deletions docs/src/eeg.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ labels = ["s$i" for i in 1:size(data, 1)]
TopoPlots.eeg_topoplot(data[:, 340, 1]; 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 each other, not at absolute coordinates.

```@example eeg
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.

## Example data

```@docs
TopoPlots.example_data
```
1 change: 0 additions & 1 deletion docs/src/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,4 @@ TopoPlots.topoplot(f[1,2],
plotfnc! = surface!) # surface can take all default kwargs similar to heatmap!
f
```
4 changes: 2 additions & 2 deletions docs/src/interpolator_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ interpolators = [
SplineInterpolator() NullInterpolator() DelaunayMesh();
CloughTocher() ScatteredInterpolationMethod(ThinPlate()) ScatteredInterpolationMethod(Shepard(3));
ScatteredInterpolationMethod(Multiquadratic()) ScatteredInterpolationMethod(InverseMultiquadratic()) ScatteredInterpolationMethod(Gaussian());
# NaturalNeighboursMethod(Hiyoshi(2)) NaturalNeighboursMethod(Sibson()) NaturalNeighboursMethod(Laplace());
# NaturalNeighboursMethod(Farin()) NaturalNeighboursMethod(Sibson(1)) NaturalNeighboursMethod(Nearest());
NaturalNeighboursMethod(Hiyoshi(2)) NaturalNeighboursMethod(Sibson()) NaturalNeighboursMethod(Laplace());
NaturalNeighboursMethod(Farin()) NaturalNeighboursMethod(Sibson(1)) NaturalNeighboursMethod(Nearest());
]
data_slice = data[:, 360, 1]
Expand Down

0 comments on commit 718cc8b

Please sign in to comment.