-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MRG: Link cameras in _LinkViewer #7962
MRG: Link cameras in _LinkViewer #7962
Conversation
@bloyl can you give it a try? |
Sorry for the delay in testing this. This is pretty cool and does what I'd like. A couple of things I noticed.
My suggestion for point 3 would be use the actual time as opposed to the index to do the linking. Additionally I would add a |
The cameras are linked but the event "the camera has been modified" is not captured simply because I don't know how to do that. And since #7517, the plotter is not updated automatically. I see 2 ways to fix this. Either capture the vtk event (interactor, camera...) or allow automatic update again.
Nice catch! I'll take care of this :)
Hm, this is not intended... I have to check the time axes somehow. @larsoner, @agramfort any idea on how to deal with this? |
Hm, this is not intended... I have to check the time axes somehow. @larsoner, @agramfort any idea on how to deal with this?
stc.times should match between linked brains
|
|
It turns out, the camera Reference: http://vtk.1045678.n5.nabble.com/Vtk-Camera-Postion-Event-td5727757.html |
mne/viz/_brain/_timeviewer.py
Outdated
# check time infos | ||
brain_times = [brain._times for brain in brains] | ||
if not all(len(x) == len(brain_times[0]) for x in brain_times): | ||
time = False | ||
if not all(all(np.equal(x, brain_times[0])) for x in brain_times): | ||
time = False | ||
|
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.
This second check throws ValueError: operands could not be broadcast
if the brain_times
are of different lengths and more than one.
why not only do the check if you have to (time == True
)
if time and not all(len(x) == len(brain_times[0]) for x in brain_times):
time = False
if time and not all(all(np.equal(x, brain_times[0])) for x in brain_times):
time = False
to test just link a plot of an evoked stc
with a cropped copy of the same stc
Other than my comment above this is working for me. Additional question, how did you make the 4 panel figure on the right? |
I use the following parameters: |
Feel free to have a look or even test it @agramfort, @larsoner |
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
This PR adds parameters to
link_brains()
to decide what to link:time
controller and/orcamera
controls.ToDo
test_3d.py
time_viewer
used as reference intoleader
It's an item of #7162
Related to #7959