Skip to content

Commit

Permalink
Merge branch 'main' into uncertain
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdez authored Jan 14, 2025
2 parents e79ff61 + 806540f commit d3bdf6c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ GridLayoutBase = "0.9, 0.10, 0.11"
ImageFiltering = "0.7"
Interpolations = "0.14, 0.15"
LinearAlgebra = "1"
Makie = "0.17, 0.18, 0.19, 0.20, 0.21"
Makie = "0.17, 0.18, 0.19, 0.20, 0.21, 0.22"
MakieThemes = "0.1"
PyMNE = "0.2"
SparseArrays = "1"
Expand Down
8 changes: 4 additions & 4 deletions joss_paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ The target audience of this package is anyone working with EEG, MEG, ERP, iEEG o

- Focused. `UnfoldMakie.jl` focuses exclusively on visualizing (r)ERPs, unlike other toolboxes such as `EEGLAB`, `FieldTrip`, `Brainstorm`, or `MNE`. This makes it easier to understand, use, and maintain the package in the future.

- Customizable. The majority of EEG researchers perceive the flexibility of coding as the most important feature of the EEG toolbox [@mikheev2024art]. Consequently, users `UnfoldMakie.jl` have great flexibility in customizing most aspects of the plots, such as colors, line styles, and axis decorations.
- Customizable. The majority of EEG researchers perceive the flexibility of coding as the most important feature of the EEG toolbox [@mikheev2024art]. Consequently, users of `UnfoldMakie.jl` have great flexibility in customizing most aspects of the plots, such as colors, line styles, and axis decorations.

- Combining plots. The layout system for subplots in `Makie.jl` makes it easy to combine and align various plot types.
- Flexible mapping. With `AlgebraOfGraphics.jl`, it is easy to map conditions, groups, channels, or other features, to a large variety of aesthetics like linestyle, color, marker and others. It works similar to the popular R package `ggplot2`.
- Flexible mapping. With `AlgebraOfGraphics.jl`, it is easy to map conditions, groups, channels, or other features, to a large variety of aesthetics like linestyle, color, marker and others. It works similarly to the popular R package `ggplot2`.

- Flexible data input. All functions support basic `Arrays` and tidy `DataFrames`.

- Fast. Julia and `Makie.jl` allows fast plotting of figures with very complex layout. As an example, it is able to plot one figure with 50 topoplots in 1.9 seconds (1.6 sec with DelaunayMesh interpolation), which is ~20 times faster, compared to `EEGLAB`. Although, the Python-based `MNE` is faster by one second (Table 1). [^1]
- Fast. Julia and `Makie.jl` allows fast plotting of figures with very complex layouts. As an example, it is able to plot one figure with 50 topoplots in 1.9 seconds (1.6 sec with DelaunayMesh interpolation), which is ~20 times faster than `EEGLAB`. Although, the Python-based `MNE` is faster by one second (Table 1). [^1]

[^1]: Be aware that results of benchmarking can vary each run and depends on a OS, package environment, other processes running on computer etc. Current measurements were done by using `BenchmarkTools.jl`. [@BenchmarkTools_jl_2016]

- Faster updating. `Makie.jl` is incredibly fast at updating figures, which is beneficial for developing interactive tools and creating animations. `UnfoldMakie.jl` can create and save a topoplot gif file with 50 frames in 1.7 times less time than `MNE` (Table 2).
- Faster updating. `Makie.jl` is incredibly fast at updating figures, which is beneficial for developing interactive tools and creating animations. `UnfoldMakie.jl` can create and save a topoplot gif file with 50 frames in 1.7 times faster than `MNE` (Table 2).

- Interactive. Several plots in our package have interactive features. They are supported by `Observables.jl`, which allows for fast data exchange and quick plot updating.

Expand Down
3 changes: 0 additions & 3 deletions src/eeg_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ function eeg_topoplot_series!(
)
# for performance, new variable name is necessary, as type might change
data = _as_observable(data_inp)

topo_axis = update_axis(supportive_defaults(:topo_default_series); topo_axis...)

# do the col/row plot
Expand All @@ -80,7 +79,6 @@ function eeg_topoplot_series!(
r = layout[t_idx][1]
c = layout[t_idx][2]
end

ax = Axis(
fig[r, c];
topo_axis...,
Expand Down Expand Up @@ -173,7 +171,6 @@ end
eeg_array_to_dataframe(data::AbstractMatrix, label_aliases::AbstractVector)
eeg_array_to_dataframe(data::AbstractVector, label_aliases::AbstractVector)
eeg_array_to_dataframe(data::Union{AbstractMatrix, AbstractVector{<:Number}})
Helper function converting an array (Matrix or Vector) to a tidy `DataFrame` with columns `:estimate`, `:time` and `:label` (with aliases `:color`, `:group`, `:channel`).
Format of Arrays:\\
Expand Down
3 changes: 1 addition & 2 deletions src/plot_erpimage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ function plot_erpimage!(
config_kwargs!(config; kwargs...)
!isnothing(to_value(sortindex)) ? @assert(to_value(sortindex) isa Vector{Int}) : ""


sortindex = sortindex_management(sortindex, sortvalues, data)
filtered_data = @lift(
UnfoldMakie.imfilter(
Expand Down Expand Up @@ -138,7 +137,7 @@ function ei_meanplot(ax, data, config, f, ga, times, meanplot_axis)
trace = @lift(mean($data, dims = 2)[:, 1])
meanplot_axis = update_axis(supportive_defaults(:meanplot_default); meanplot_axis...)
xticks = @lift(round.(LinRange(minimum($times), maximum($times), 5), digits = 2))
yticks = @lift(round.(LinRange(minimum($trace), maximum($trace), 3), digits = 1))
yticks = @lift(round.(LinRange(minimum($trace), maximum($trace), 5), digits = 1))

axbottom = Axis(
ga[5, 1:4];
Expand Down
1 change: 1 addition & 0 deletions src/plot_topoplotseries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function plot_topoplotseries!(
end
# resolve columns with data
config.mapping = resolve_mappings(to_value(data), config.mapping)

# check number of topoplots and group the data accordint to their location
data_row, xlabels, layout =
cutting_management(data, data_cuts, bin_width, bin_num, combinefun, nrows, config)
Expand Down

0 comments on commit d3bdf6c

Please sign in to comment.