mne-tools / mne-tools/mne-python

BUG: CTF and proj (re)application

Open
#5,342 11 comments 0 reactions 1 assignee View on GitHub

@larsoner is already working on this.

Since Oct 4, 2018.

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

Description

In principle we should be able to:

  1. apply compensation or proj
  2. compute forward on full set of channels
  3. pick channels in data (maybe dropping compensation channels)
  4. compute inverse without reapplying proj or compensation (#2310)

So we need to:

  1. Always keep info['comps'].
  2. Always keep info['projs'] complete with the set of channels that were used when they were applied, i.e., do not subselect channels if proj['active'].
  3. If projs are applied to raw, for epochs(..., picks=[1], proj=True), raise an error telling people to use proj=False because they should not reapply?
  4. Check for correspondence between comps and proj and data channels in the forward object during inverse application.

This non-reduction of the projs, however, would create some things to think about:

  • In master, if you apply projs, then subselect channels, then compute the inverse, the projection operator is reapplied (I think?). This is a bit weird because it means that there were actually two spatial operators that got applied, but only the last (with fewer channels) gets applied to the lead fields.
  • Currently we get the rank for inverse computation by subtracting the number of projectors, but this will only work if all channels are kept. We could still use n_proj -- we would just underestimate the rank, which is at least safer than overestimating it (and blowing up near-zero singular values).

This would probably take a lot of careful coding and testing to get right, but it should be doable. It seems like the cleanest option. @agramfort do you see any problems with this approach?

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.