-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
adding basic auto-scaling functionality for raw and epochs classes #3198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mne/viz/utils.py
Outdated
|
|
||
| _channel_types = ['eeg', 'seeg', 'eog', 'ecg', 'emg', 'ref_meg', 'stim', | ||
| 'resp', 'misc', 'chpi', 'syst', 'ias', 'exci', 'bio'] | ||
| _meg_types = ['mag', 'grad'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be (already?) in mne.channels?
|
have a look at the _picks_by_type function in pick.py and maybe _PICK_TYPES_DATA_DICT, _PICK_TYPES_KEYS and _DATA_CH_TYPES_SPLIT in pick.py |
22e9f42 to
31b68c0
Compare
5538cd7 to
9ceb761
Compare
|
Think I addressed people's comments. Using percentile now instead of absolute median deviation, also updated dictionaries to be 2.6 compatible |
|
Also hanging participle has been fixed @kingjr, I'll make sure to bring my copy of Strunk and White for my next PR :) |
|
(LMK if there's anything else you'd like me to change here) |
|
+1 to merge on my side |
mne/viz/utils.py
Outdated
| return fig | ||
|
|
||
|
|
||
| def compute_scalings(scalings, inst): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
Otherwise LGTM |
|
just made edits from above and included the 100mb size max etc, let me know if that looks OK. I'll try to find an example to show this now, and will create a change to whatsnew etc next |
f8eeeda to
9297b5a
Compare
|
ok - also rebased onto master, updated whats new / a doc, and push that. There was an example showing plotting from raw array data, which is a good use case for this PR. That said, I think it'd be great to have an actual "visualization tutorial", maybe a project for the summer? Once these PRs are taken care of (including the CFC one), I'd like to help build some documentation along those lines. |
|
there is now tutorials for viz see:
http://martinos.org/mne/dev/tutorials.html
and for Raw
http://martinos.org/mne/dev/auto_tutorials/plot_visualize_raw.html
can you add a note there?
|
|
ah that's great - I'll add tomorrow On Wed, May 4, 2016 at 11:36 PM, Alexandre Gramfort <
|
9297b5a to
9241afb
Compare
|
looking at this now - I realized that I didn't see it before because there are two tutorials folders...one in |
|
Argh, it does seem like the ones in |
|
Is that something you'd like me to take care of in this PR? |
|
No, that should probably be separate
|
|
ok cool, will hold off on doing anything else in this PR until somebody On Thu, May 5, 2016 at 7:24 PM, Eric Larson notifications@github.com
|
|
|
||
| - Add option for ``first_samp`` in :func:`mne.make_fixed_length_events` by `Jon Houck`_ | ||
|
|
||
| - Add ability to auto-scale channel types for `mne.viz.plot_raw` and `mne.viz.plot_epochs` and corresponding object plotting methods by `Chris Holdgraf`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:func: in front (see other lines above for examples)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 then +1 for merge
the files in tutorials are python files that are rendered with sphinx it's on purpose. |
Why not have one or the other? I don't see any reason why these couldn't be made into proper Python https://github.com/mne-tools/mne-python/blob/master/doc/tutorials/report.rst The only one that seems like it can't is the MNE command-line tools one, and we can move that elsewhere. |
|
At the very least I think we should just move those files to the root |
|
I'll fix the :func: in master -- thanks @choldgraf! |
|
Merged by rebase with minor fix |
|
After going to edit the doc, I see what you're saying @agramfort, I'm going to leave it alone :) |
|
wahoo! thanks all |
This is a first-pass PR at adding auto-scaling functionality for plotting raw / epoched data. The basic change is to include a "compute_scalings" function in the viz.utils module. This takes a scalings dictionary, and for any value that is 'auto', it will use the data instance provided to auto-calculate the scaling. Alternatively you can supply only the string "auto" and it'll auto-compute for all channel types in the data. Then it goes on to plotting as normal.
There are some weird things that I did to make iterating through channel types easier (e.g., I've got a hard-coded list of channel types but maybe that exists elsewhere, I also wrote a function to return a list of the channel type for all channels, as well as a dictionary of channel type: ixs, but maybe that's already been done elsewhere?)
Suggestions etc are welcome! Here's the basic idea of what this does:
originally comes from #2253