mne-tools / mne-tools/mne-python
BUG: CTF and proj (re)application
Open
@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:
- apply compensation or proj
- compute forward on full set of channels
- pick channels in data (maybe dropping compensation channels)
- compute inverse without reapplying proj or compensation (#2310)
So we need to:
- Always keep
info['comps']. - Always keep
info['projs']complete with the set of channels that were used when they were applied, i.e., do not subselect channels ifproj['active']. - If projs are applied to raw, for
epochs(..., picks=[1], proj=True), raise an error telling people to useproj=Falsebecause they should not reapply? - Check for correspondence between
compsandprojand 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.