TopoPlots.CloughTocherType
CloughTocher(fill_value=NaN, tol=1e-6, maxiter=400, rescale=false)

Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D. Find more detailed docs in CloughTocher2DInterpolator.jl.

This is the default interpolator in MNE-Python

TopoPlots.DelaunayMeshType
DelaunayMesh()

Creates a delaunay triangulation of the points and linearly interpolates between the vertices of the triangle. Really fast interpolation that happens on the GPU (for GLMakie), so optimal for exploring larger timeseries.

Warning

DelaunayMesh won't allow you to add a contour plot to the topoplot.

TopoPlots.GeomExtrapolationType
GeomExtrapolation(
    method = Shepard(), # extrapolation method
    geometry = Rect, # the geometry to fit around the points
    enlarge = 3.0 # the amount to grow the bounding geometry for adding the extra points
)

Takes positions and data, and returns points and additional datapoints on an enlarged bounding geometry:

extra = GeomExtrapolation()
extra_positions, extra_data, bounding_geometry, bounding_geometry_enlarged = extra(positions, data)
TopoPlots.InterpolatorType

Interface for all types <: Interpolator:

interpolator = Interpolator(; kw_specific_to_interpolator)
interpolator(xrange::LinRange, yrange::LinRange, positions::Vector{Point2}, data::Vector{<: Real})::Matrix{<: Real}
TopoPlots.NullInterpolatorType
NullInterpolator()

Interpolator that returns "0", which is useful to display only the electrode locations + labels

TopoPlots.ScatteredInterpolationMethodType
ScatteredInterpolationMethod(InterpolationMethod)

Container to specify a `InterpolationMethod` from ScatteredInterpolation.
E.g. ScatteredInterpolationMethod(Shepard(P=4))
TopoPlots.eeg_topoplotFunction
eeg_topoplot(data::Vector{<: Real}, labels::Vector{<: AbstractString})

Attributes:

  • positions::Vector{<: Point} = Makie.automatic: Can be calculated from label (channel) names. Currently, only 10/20 montage has default coordinates provided.

  • head = (color=:black, linewidth=3): draw the outline of the head. Set to nothing to not draw the head outline, otherwise set to a namedtuple that get passed down to the line! call that draws the shape.

Some attributes from topoplot are set to different defaults:

  • label_scatter = true
  • contours = true

Otherwise the recipe just uses the topoplot defaults and passes through the attributes.

TopoPlots.enclosing_geometryFunction
enclosing_geometry(G::Type{<: Geometry}, positions, enlarge=1.0)

Returns the Geometry of Type G, that best fits all positions. The Geometry can be enlarged by 1.x, so e.g. enclosing_geometry(Circle, positions, 0.1) will return a Circle that encloses all positions with a padding of 10%.

TopoPlots.labels2positionsMethod
labels2positions(labels)

Currently only supports 10/20 layout, by looking it up in TopoPlots.CHANNEL_TO_POSITION_10_20.

TopoPlots.topoplotFunction
topoplot(data::Vector{<:Real}, positions::Vector{<: Point2})

Creates an irregular interpolation for each data[i] point at positions[i].

Attributes

  • colormap = Reverse(:RdBu)

  • colorrange = automatic

  • labels::Vector{<:String} = nothing: names for each data point

  • interpolation::Interpolator = CloughTocher(): Applicable interpolators are TopoPlots.CloughTocher, TopoPlots.DelaunayMesh, TopoPlots.NullInterpolator, TopoPlots.ScatteredInterpolationMethod, TopoPlots.SplineInterpolator

  • extrapolation = GeomExtrapolation(): Extrapolation method for adding additional points to get less border artifacts

  • bounding_geometry = Circle: A geometry that defines what to mask and the x/y extend of the interpolation. E.g. Rect(0, 0, 100, 200), will create a heatmap(0..100, 0..200, ...). By default, a circle enclosing the positions points will be used.

  • enlarge = 1.2, enlarges the area that is being drawn. E.g., ifbounding_geometryisCircle`, a circle will be fitted to the points and the interpolation area that gets drawn will be 1.2x that bounding circle.

  • interp_resolution = (512, 512): resolution of the interpolation

  • label_text = false:

    • true: add text plot for each position from labels
    • NamedTuple: Attributes get passed to the Makie.text! call.
  • label_scatter = false:

    • true: add point for each position with default attributes
    • NamedTuple: Attributes get passed to the Makie.scatter! call.
  • markersize = 5: size of the points defined by positions, shortcut for label_scatter=(markersize=5,)

  • contours = false:

    • true: add scatter point for each position
    • NamedTuple: Attributes get passed to the Makie.contour! call.

Example

using TopoPlots, CairoMakie
topoplot(rand(10), rand(Point2f, 10); contours=(color=:red, linewidth=2))