Skip to content

Feat: Integrate Real Subject Leadfields#9

Merged
orabe merged 3 commits into
mainfrom
data/leadfield
Jun 16, 2025
Merged

Feat: Integrate Real Subject Leadfields#9
orabe merged 3 commits into
mainfrom
data/leadfield

Conversation

@orabe

@orabe orabe commented Jun 16, 2025

Copy link
Copy Markdown
Collaborator

Closes #4

This pull request addresses issue #4 by integrating the the use of leadfields generated from real individual subject anatomical data, beyond the reliance on the fsaverage template.

Key Changes Implemented:

  • Subject-Specific Leadfield Loading:
    • Modified the DataSimulator and Benchmark classes to dynamically load and utilize leadfield matrices corresponding to individual subjects.
    • Introduced a new subject parameter in the data_param_grid (as seen in examples/run_experiments.py). The benchmarking loop now iterates over a list of specified subject IDs (e.g., ["subject_01", "subject_02", "fsaverage"]), loading the appropriate leadfield for each.
  • Configuration Updates:
    • Updated configuration to allow specifying paths to these individual leadfield files. (#TODO: Details on where to place/configure these paths should be documented).
  • Leadfield Comparison & Visualization:
    • Added functions to compare key properties between individual subject leadfields and the fsaverage leadfield.
  • Data Handling:
    • Ensured that data loading and processing can handle different leadfield dimensions .

How to Use:

  1. Ensure individual subject leadfield files are available and correctly pathed in the configuration.
  2. Update the data_param_grid in experiment scripts to include the subject parameter with a list of desired subject IDs (including fsaverage if comparison is needed).
    data_param_grid = {
        # ... other parameters ...
        "subject": ["subject_01", "subject_02", "fsaverage"],
    }
  3. Run the experiments as usual. The framework will now loop through the specified subjects.

Affected Files:

  • calibrain/data_simulation.py
  • calibrain/benchmark.py
  • examples/run_experiments.py

orabe added 3 commits May 26, 2025 22:25
- Visualize leadfield matrix.
- Updated the experiment configuration in `run_experiments.py` to change parameters for subject and noise levels, and adjusted leadfield loading paths.
- Ensured that leadfield matrices are handled correctly for EEG channels.
@orabe orabe self-assigned this Jun 16, 2025
@orabe orabe added enhancement New feature or request simulation labels Jun 16, 2025
@orabe orabe merged commit c691b57 into main Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request simulation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Real Subject Leadfields instead of fsaverage

1 participant