Skip to content

v0.2.0

Choose a tag to compare

@danclab danclab released this 07 Oct 09:08
· 8 commits to main since this release

laMEG v0.2.0 - 2026-10-07

laMEG v0.2.0 is a substantial update to the toolbox, adding a new source-data framework, BigBrain-informed layer-to-lamina mapping, OPM-MEG support, improved simulation and coregistration tools, and more reproducible installation and software infrastructure.

🧠 Source reconstruction and source-data framework

This release introduces a new framework for storing and working with reconstructed source activity.

  • Added LaminarSourceData for structured access to source estimates by layer, cortical column, time, and trial.
  • Added HDF5-based export of source activity with explicit dimensions and metadata.
  • Added a versioned HDF5 schema for source data.
  • Added provenance and cortical-geometry metadata to source exports.
  • Source exports are validated against the corresponding LayerSurfaceSet geometry.
  • Sliding-window inverse matrices can now be stored externally per window, reducing coupling between inversion and subsequent source reconstruction.
  • Source I/O, export, schema handling, and BigBrain mapping have been separated into dedicated internal modules.
  • Added documentation for the source-data API and HDF5 schema.

🧬 BigBrain-informed laminar mapping

laMEG can now transform activity reconstructed on equidistant cortical surfaces into BigBrain-informed cortical laminae.

  • Added analytic layer-to-lamina transformation weights based on BigBrain-derived laminar boundaries.
  • Added support for column-specific or common laminar mappings.
  • BigBrain mappings can be attached directly to source HDF5 files.
  • LaminarSourceData provides on-demand access to lamina-resolved source estimates.
  • Invalid or unavailable BigBrain mappings are handled explicitly through masking/NaN values rather than hard failure.
  • Added dedicated numerical tests and validation analyses for the layer-to-lamina transformation.
  • Added validation scripts for sampling and mapping behaviour under varying cortical geometries.

The distinction between reconstructed layers and histologically defined laminae is retained explicitly throughout the API.

🧲 OPM-MEG support

This release extends the forward-modelling and model-comparison framework to OPM-MEG.

  • Added OPM head-model support.
  • Added device-aware handling for conventional SQUID-MEG and OPM-MEG.
  • Added OPM options to simulation setup.
  • Added OPM support to static and sliding-window model-comparison workflows.
  • Extended tests of forward modelling and inversion to cover OPM configurations.

Thanks to Matteo Maspoli for the initial OPM implementation in PR #26.

⚙️ Inversion and EBBlayer improvements

  • Updated the interface to the current EBBlayer implementation.
  • Improved handling of sliding-window inversion outputs.
  • Improved SPM parallel-pool management:
    • existing pools are reused where possible;
    • newly created pools no longer use a fixed timeout;
    • MATLAB-side errors are surfaced more clearly.
  • Fixed loading of inverse components from older MATLAB file formats.
  • Improved stability of automated SPM tests by running MATLAB Runtime without the JVM, eliminating intermittent CI segmentation faults.

🧪 Simulation improvements

Simulation functions now provide more control over synthetic data generation.

  • Added white- and pink-noise options.
  • Added control over whether SPM diagnostic figures are displayed.
  • Updated simulation utilities to support OPM-MEG workflows.

🧭 Coregistration and visualization

Several additions improve inspection and validation of MEG/MRI coregistration.

  • verify_coregistration() can now display MEG sensors.
  • 3D optical scans can be displayed alongside anatomical and sensor geometry when available.
  • coregister_3d_scan_mri() now stores the 3D-scan-to-MRI transformation and the transformed scan surface.
  • Camera view can be specified explicitly in coregistration visualizations.
  • Updated the coregistration example notebook.

📍 ROI analysis

  • Added get_roi_idx() for obtaining vertices within an atlas-defined region.
  • roi_power_comparison() now supports both threshold-based and direct ROI-selection modes.
  • Added restrict_threshold; the previous threshold-based behaviour remains the default.

📦 Installation and reproducibility

The SPM dependency is now tied to a reproducible release rather than the moving state of its repository.

  • lameg-postinstall installs the tagged DANC_spm_python v0.1.0 release.
  • The DANC SPM repository is fetched using a shallow clone of the pinned tag, avoiding download of the repository's full history.
  • MATLAB Runtime environment handling has been improved to avoid conflicts with system tools inside Conda environments.
  • Release publishing is restricted to semantic-version tags.

📚 Documentation and project infrastructure

  • Added detailed documentation for the source-data API and HDF5 schema.
  • Added CITATION.cff.
  • Added a Zenodo DOI and DOI badge.
  • Added CONTRIBUTING.md.
  • Added dedicated validation documentation for BigBrain layer-to-lamina mapping.
  • Updated project funding acknowledgements.

Full changelog

v0.1.4...v0.2.0