Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 20 additions & 22 deletions JOSS/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,59 +40,57 @@ Oscillatory cortical activity has been found to systematically propagate across
WaveSpace is a modular Python toolbox for the simulation and analysis of traveling wave dynamics in multichannel recording arrays. Based on a single, flexible data class users can execute, compare and recombine multiple commonly used analysis steps as well as evaluate their performance against simulated benchmarks.

# Statement of need
Various approaches to detect and characterize cortical traveling waves have emerged in the literature. Typically, laboratories develop customized pipelines tailored to their experimental requirements and software platform preferences [@alexander_measurement_2006;@muller_stimulus-evoked_2014;@alamia_alpha_2019;@das_how_2022; but see also; @gutzen_modular_2024; for a notable exception].
Various approaches to detect and characterize cortical traveling waves have emerged in the literature. Typically, laboratories develop customized pipelines tailored to their experimental requirements and software platform preferences [@alexander_measurement_2006;@muller_stimulus-evoked_2014;@alamia_alpha_2019;@das_how_2022; but see also @gutzen_modular_2024 for a notable exception].

The diversity of methods and implementations found in the literature poses challenges for researchers, both in selecting the one most suitable for their own studies and in directly comparing the performance of different pipelines. WaveSpace addresses this gap by integrating commonly used strategies into a single modular framework. This framework ensures that modules for preprocessing, data decomposition, spatial arrangement of sensor positions, wave analysis, and evaluation are interchangeable within the same workflow. Additionally, a simulation module allows for the generation of benchmarking data with desired properties to directly test the accuracy and specificity of planned analysis pipelines in silico. The resulting pipelines are ready-to-use in empirical studies [@petras_locally_2025;@fakche_alpha_2024].
The diversity of methods and implementations found in the literature poses challenges for researchers, both in selecting the one most suitable for their own studies and in directly comparing the performance of different pipelines. WaveSpace addresses this gap by integrating commonly used strategies into a single modular framework. This framework ensures that modules for preprocessing, data decomposition, spatial arrangement of sensor positions, wave analysis, and evaluation are interchangeable within the same workflow. Additionally, a simulation module allows for the generation of benchmarking data with desired properties to directly test the accuracy and specificity of planned analysis pipelines in silico. The resulting pipelines are ready-to-use in empirical studies [@Petrase0089252025;@fakche_alpha_2024].

# State of the field
Several single purpose pipelines for the analysis of cortical traveling waves exist. Table 1 shows a non-exhaustive list of openly available analysis code. In most cases, the provided code accompanies, and is tailored towards, a single experimental contribution to the scientific literature on cortical traveling waves.

Table 1. Single‑purpose tools for traveling‑wave analysis.

| Tool | Language | Method | Repository |
|---|---|---|---|
| wavematlab | MATLAB | phase-distance correlation | https://github.com/mullerlab/wave-matlab |
| Traveling‑waveanalysis | Python | SVD‑based phase‑wave analysis | https://github.com/ScaleSymmetry/Traveling-wave-analysis |
| travellingWaveEEG | MATLAB | 2D FFT | https://github.com/artipago/travellingWaveEEG |
| Traveling‑waveanalysis | MATLAB | Circularlinear correlations | https://github.com/jacobslab/Traveling-wave-analysis |
| NeuroPattToolbox | MATLAB | Optical flow analysis | https://github.com/BrainDynamicsUSYD/NeuroPattToolbox |
| cobrawap | Python + Snakemake | Optical flow analysis | https://github.com/NeuralEnsemble/cobrawap |
| comparing-phase-based-and-Granger-based-analyses | MATLAB | Phase gradient and Granger causality analysis | https://github.com/artipago/comparing-phase-based-and-Granger-based-analyses |
| Tool | Lang | Method | Repo |
|------|------|--------|------|
| wave-matlab | MATLAB | Phase–distance correlation | [GitHub](https://github.com/mullerlab/wave-matlab) |
| Travelling wave analysis (ScaleSymmetry) | Python | SVD phase waves | [GitHub](https://github.com/ScaleSymmetry/Traveling-wave-analysis) |
| travellingWaveEEG | MATLAB | 2D FFT | [GitHub](https://github.com/artipago/travellingWaveEEG) |
| Travelling wave analysis (jacobslab) | MATLAB | Circularlinear correlation | [GitHub](https://github.com/jacobslab/Traveling-wave-analysis) |
| NeuroPattToolbox | MATLAB | Optical flow | [GitHub](https://github.com/BrainDynamicsUSYD/NeuroPattToolbox) |
| cobrawap | Python | Optical flow (Snakemake) | [GitHub](https://github.com/NeuralEnsemble/cobrawap) |
| Phase vs Granger | MATLAB | Phase gradient + Granger | [GitHub](https://github.com/artipago/comparing-phase-based-and-Granger-based-analyses) |

In principle, multi-purpose neurophysiology data analysis packages such as fieldtrip [@oostenveld2011fieldtrip] for Matlab or MNE [@gramfort2014mne] for Python could be extended to include traveling wave analysis methods. Given the wide variety of available approaches and the lack of systematic comparison in the literature, WaveSpace was instead designed as a standalone tool with consistent workflows dedicated exclusively to traveling wave analysis. However, to ensure users can still benefit from the pre-processing, time-frequency decomposition and visualization methods provided by MNE, WaveSpace easily integrates MNE data objects at any stage of processing.

# Functionality and software design
WaveSpace has been developed to offer a central location for gathering analysis methods for the detection of cortical traveling waves, primarily in non-invasive electrophysiology data such as electro- or magnetoencephalography. All WaveSpace functionality is based on a single data class, called WaveData, that enforces conventions for data dimension order and dimension naming. This allows for most processing steps to be interchangeable. The WaveData class organizes the in- and output of consecutive processing steps into discrete data-buckets, where each function takes a data-bucket as input and writes its output to a new data-bucket.
WaveSpace has been developed to provide an array of methods for the detection and analysis of cortical traveling waves, primarily in non-invasive electrophysiology data such as electro- or magnetoencephalography. All WaveSpace functionality is based on a single data class, called WaveData, that enforces conventions for data dimension order and dimension naming. This allows for most processing steps to be interchangeable. The WaveData class organizes the in- and output of consecutive processing steps into discrete data-buckets, while logging progress. The entire framework is comprehensively documented and includes example scripts to facilitate adoption.

The entire framework is comprehensively documented and includes example scripts to facilitate its adoption.

WaveSpace contains 5 core modules (see figure 1 for module overview):
WaveSpace contains 6 core modules (see figure 1 for module overview):

- Decomposition: Provides multiple techniques to decompose broadband data into frequency components, including FFT-based methods (e.g., wavelets, filter-Hilbert), empirical mode decomposition (EMD), and generalized phase analysis.

- Spatial Arrangement: Includes methods to map 3D sensor positions onto 2D regular grids using approaches such as multidimensional scaling (MDS) and isomap. Multiple interpolation options are available.

- Wave Analysis: Offers a variety of analysis methods, such as 2D FFT, optical flow analysis, phase gradient methods, and principal component analysis (PCA).

- Simulation: Functions to simulate traveling and spatially stationary (i.e., standing) waves with both linear and nonlinear properties, as well as incorporating noise.
- Simulation: Functions to simulate traveling and spatially stationary (i.e., standing) waves with both linear and nonlinear properties, as well as incorporate noise.

- Evaluation and statistics: Summarizes wave characteristics. Contains options for wave-scoring.

- Plotting: Contains visualization tools for each analysis option.

![WaveSpace Module Overview](WaveSpace_overview.png)
*Figure 1: Overview of WaveSpace modules.*

# Research impact statement
WaveSpace has been introduced during a workshop at the 47th European conference on visual perception (2025) and used in peer reviewed as well as ongoing work [@petras_locally_2025;@fakche_alpha_2024;PetrasDugue2024ECVP;@kong2025oscillatory]. Users are invited to contribute to the ongoing package development via github.
WaveSpace has been publically introduced during a workshop at the 47th European conference on visual perception (2025) and used in peer reviewed as well as ongoing work [@Petrase0089252025;@fakche_alpha_2024;@PetrasDugue2024ECVP;@kong2025oscillatory]. Users are invited to contribute to the ongoing package development via github.

# Funding

This project received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program (grant agreement No. 852139 - Laura Dugué).

# Toolbox dependencies

[Environment file](https://github.com/kpetras/WaveSpace/blob/main/WaveSpaceEnv.yaml)

# References

# AI usage disclosure
Github copilot in "ask" mode has been used in the initial translation of Matlab code to Python. When the resulting code was found to be inaccurate and failed to match the style of the rest of the package, most of it was manually re-written. Single word autocomplete was used throughout for code and comments. Copilot was used for formatting suggestions. No agentic AI was used.
Github copilot in "ask" mode has been used in the initial translation of Matlab code to Python. When the resulting code was found to be inaccurate and failed to match the style of the rest of the package, most of it was manually re-written. Single word autocomplete was used throughout for code and comments. Copilot was used for code and formatting suggestions. No agentic AI was used.

# References
23 changes: 14 additions & 9 deletions JOSS/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,20 @@ @article{gutzen_modular_2024
note = {Publisher: Elsevier},
}

@article{petras_locally_2025,
title = {Locally induced traveling waves generate globally observable traveling waves},
url = {https://www.biorxiv.org/content/10.1101/2025.01.07.630662.abstract},
urldate = {2025-01-17},
journal = {bioRxiv},
author = {Petras, Kirsten and Grabot, Laetitia and Dugué, Laura},
@article {Petrase0089252025,
author = {Petras, Kirsten and Grabot, Laetitia and Dugu{\'e}, Laura},
title = {Locally Induced Traveling Waves Generate Globally Observable Traveling Waves},
volume = {45},
number = {34},
elocation-id = {e0089252025},
year = {2025},
note = {Publisher: Cold Spring Harbor Laboratory},
pages = {2025--01},
doi = {10.1523/JNEUROSCI.0089-25.2025},
publisher = {Society for Neuroscience},
abstract = {Cortical traveling waves have been proposed as a fundamental mechanism for neural communication and computation. Methodological uncertainties currently limit the interpretability of noninvasive, extracranial traveling wave data, sparking debates about their cortical origin. Studies using EEG or MEG typically report waves that cover large portions of the sensor array which are often interpreted as reflecting long range cortical waves. Meanwhile, invasive, intracranial recordings in humans and animals routinely find both local, mesoscopic waves and large-scale, macroscopic waves in cortex. Whether the global sensor array waves found with EEG/MEG necessarily correspond to macroscopic cortical waves or whether they are merely projections of local dynamics remains unclear. In this study, we made use of the well-established retinotopic organization of early visual cortex to generate traveling waves with known properties in human participants (N = 19, 10 female, 9 male) via targeted visual stimulation, while simultaneously recording MEG and EEG. The inducer stimuli were designed to elicit waves whose traveling direction in mesoscopic retinotopic visual areas depends on stimulus direction, while leaving macroscopic activation patterns along the visual hierarchy largely unchanged. We observed that the preferred direction of traveling waves across the sensor array was influenced by that of the visual stimulus, but only at the stimulation frequency. Comparison between single-trial and trial-averaged responses further showed considerable temporal variation in traveling wave patterns across trials. Our results highlight that under tight experimental control, noninvasive, extracranial recordings can recover mesoscopic traveling wave activity, thus making them viable tools for the investigation of spatially constrained wave dynamics.},
issn = {0270-6474},
URL = {https://www.jneurosci.org/content/45/34/e0089252025},
eprint = {https://www.jneurosci.org/content/45/34/e0089252025.full.pdf},
journal = {Journal of Neuroscience}
}

@article{fakche2024perceptual,
Expand Down Expand Up @@ -193,4 +198,4 @@ @article{PetrasDugue2024ECVP
number = {Supplement},
pages = {ECVP 2024 Abstracts},
note = {Talk in Symposium 3: Space matters: Cortical traveling waves and their role in perception and attention},
}
}