mne-tools / mne-tools/mne-python

Support for regression using VolSourceEstimate

Open
#9,137 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ENH
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Describe the new feature or enhancement

Currently the linear_regression function only accepts SourceEstimate, but gives an error if attempting to use VolSourceEstimate. As far as I'm aware there shouldn't be any reason why this can't work for volume source estimates as well.

Describe your proposed implementation

Adding VolSourceEstimate to the relevant type checking lines in https://github.com/mne-tools/mne-python/blob/main/mne/stats/regression.py#L21 enables the linear_regression function to accept VolSourcEstimates as input:

Line 75:
elif isinstance(inst, list) and isinstance(inst[0], (SourceEstimate, VolSourceEstimate)):

Line 91:
if not isinstance(out_, (SourceEstimate, VolSourceEstimate, Evoked)):

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mne/stats/regression.py at the linear_regression type checks around lines 75 and 91. Reproduce the current rejection with a VolSourceEstimate, then verify that linear_regression accepts it wherever SourceEstimate is accepted. The issue does not name a test file, so inspect the existing regression coverage before adding or updating a focused test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.