MRG: Add support for auto_scaling in time_viewer#7218
MRG: Add support for auto_scaling in time_viewer#7218larsoner merged 9 commits intomne-tools:masterfrom
Conversation
|
Let's go for 2) for now |
Codecov Report
@@ Coverage Diff @@
## master #7218 +/- ##
=========================================
Coverage ? 89.77%
=========================================
Files ? 445
Lines ? 80065
Branches ? 12803
=========================================
Hits ? 71880
Misses ? 5375
Partials ? 2810 |
|
What do you think @agramfort , @larsoner ? |
|
I suspect |
|
There is a one-sided vs two-sided colormap problem here. Running: import os
import mne
from mne.datasets import sample
data_path = sample.data_path()
sample_dir = os.path.join(data_path, 'MEG', 'sample')
subjects_dir = os.path.join(data_path, 'subjects')
fname_stc = os.path.join(sample_dir, 'sample_audvis-meg')
stc = mne.read_source_estimate(fname_stc, subject='sample')
initial_time = 0.1
with mne.viz.use_3d_backend('pyvista'):
brain = stc.plot(subjects_dir=subjects_dir, initial_time=initial_time,
clim=dict(kind='value', pos_lims=[3, 6, 9]),
time_viewer=True)I get something correct: Until I hit "t", then I get something that scales in one-sided mode, which is incorrect: Can you fix this, and check that this mode works both in two-sided/divergent mode ( |
|
The user given There is also the shortcut I hope this fixed the issues you encountered @larsoner |
|
If possible, I would prefer to merge this after #7219 and resolve the conflicts in here. |
|
Looks like there are no merge conflicts, okay to test and merge @GuillaumeFavelier ? |
I'm not sure if it should change the mode, though. If you initially plot in two-sided mode, it probably shouldn't switch to one-sided (and vice-versa). Currently it seems to, at least for the example where I plot data that are all positive in two-sided mode. Passing the correct |
|
|
||
| time_label, times = _handle_time(time_label, time_unit, stc.times) | ||
| # convert control points to locations in colormap | ||
| user_colormap = colormap # save the original colormap |
There was a problem hiding this comment.
I thought that moving this line down below the call to _limits_to_control_points would fix the colormap-switching behavior, but it didn't (it did the weird positive-only limits for mne colormap` behavior). I can live with the current iteration, then
|
This also seems to work well in testing and I see no merge conflicts so I'll put it in. Thanks @GuillaumeFavelier |
|
amazing !
… |
* Add basic auto-scaling * Improve backup * Add time interpolation * Use action event UX * Improve coverage * Add shortcut to restore clim * Fix tests * Avoid confusing names
* Add basic auto-scaling * Improve backup * Add time interpolation * Use action event UX * Improve coverage * Add shortcut to restore clim * Fix tests * Avoid confusing names


This PR adds support for
auto_scalingto_TimeViewer. It can be enabled by pressing the shortcutt. This is still a prototype and I was wondering what would be the best UX actually:climvalues given automatically, they snap back to the detected valuesclim, it will be updated accordinglyIt's an item of #7162