Comments (7)
My feeling is that we should add exclude
parameters to all these get_data()
methods if they don't have one already, retaining the current behavior; and do a deprecation cycle for transitioning to either exclude=()
or exclude="bads"
for all of them
from mne-python.
@cbrnr Note that I did not pass None
in my MWE! I did pass picks="eeg"
The doctoring says:
Note that channels in info['bads'] will be included if their names or indices are explicitly provided.
So something about this point is inconsistent between epochs and evoked at least when passing picks="eeg"
.
I think what you're mentioning here is being tracked at #12197
from mne-python.
The docstrings are identical, so I think both methods should behave identically. In addition, the docstring says:
None (default) will pick all channels.
I think this should be:
None (default) will pick all good channels.
At least that's how it currently works for Epochs
, but not for Evoked
apparently.
https://mne.tools/dev/generated/mne.Epochs.html#mne.Epochs.get_data
https://mne.tools/dev/generated/mne.Evoked.html#mne.Evoked.get_data
from mne-python.
So something about this point is inconsistent between epochs and evoked at least when passing picks="eeg".
Neither get_data
has an exclude
param, sounds like one is implicitly using exclude="bads"
and the other exclude=()
under the hood. To change the behavior of one to match the other and be consistent I think we'd need a deprecation cycle, not sure whether or not it's worth the code churn. To update the docstring of both to reflect their actual behavior it wouldn't require a deprecation cycle. Adding exclude
to both (to make the behavior more explicit and controllable) is probably worthwhile either way.
from mne-python.
Even if documented I think it would be a bit surprising if Epochs
and Evoked
used different pick defaults. So I'd document the behavior with whatever version we think makes more sense, be consistent for both methods and deprecate the inconsistent behavior. And yes, an explicit exclude
parameter would definitely make sense to me.
from mne-python.
I tested the MWE with Raw and now it seems it's actually Epochs who's the odd one:
# %%
import mne
sample_dir = mne.datasets.sample.data_path()
sample_fname = sample_dir / "MEG" / "sample" / "sample_audvis_raw.fif"
raw = mne.io.read_raw_fif(sample_fname)
raw.crop(tmax=60)
events = mne.find_events(raw, stim_channel="STI 014")
raw.pick("eeg")
epochs = mne.Epochs(raw, events=events, preload=True)
evoked = epochs.average()
# %%
for inst_type, inst in zip(["raw", "epochs", "evoked"], [raw, epochs, evoked]):
print(f"{inst_type}:")
print(f" bads: {inst.info['bads']}")
print(f" data shape: {inst.get_data(picks='eeg').shape}")
raw:
bads: ['EEG 053']
data shape: (60, 36038)
epochs:
bads: ['EEG 053']
data shape: (86, 59, 421)
evoked:
bads: ['EEG 053']
data shape: (60, 421)
from mne-python.
More digging:
BaseSpectrum.get_data()
featuresexclude="bads'
BaseTFR
ditto
from mne-python.
Related Issues (20)
- Researcher file breaks read_raw_eyelink HOT 3
- Parameter 'rank' in CSP definition did not accept str in MNE 1.7.1 HOT 2
- Docstring of `mne.viz.plot_topomap()` incorrect
- Bug in sensors naming when using mne.viz.plot_topomap HOT 1
- Default units in raw.to_data_frame() HOT 11
- DOC: Update installation instructions about Spyder
- Make full installation depend on PySide6 by default HOT 10
- Consider using absolute imports HOT 8
- Clarify and document our submodule layout principles HOT 3
- Implement virtually moving head position for evokeds HOT 3
- Dozens of symbols in `mne.utils` are unknown to my static type checker, probably due to an issue with lazy loading HOT 4
- MAINT: Release 1.8
- in mne.viz.plot_evoked_topo, the ylim parameter breaks when grads become before mags in the data
- Allow `Spectrum` objects to support complex coefficients HOT 1
- Bug reading raw BrainVision data HOT 2
- set_channel_types does not properly set the coil_type for eyetracking channels HOT 3
- Type incompatibility between sklearn's API and `SlidingEstimator` HOT 8
- Some font colors in the dark theme are not readable HOT 3
- interpolate_blinks docstring should mention the method of interpolation HOT 1
- Inconsistent handling and documentation of pupil size units HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mne-python.