Skip to content

Commit

Permalink
FIX: Add support for hemi=both in _TimeViewer (#7253)
Browse files Browse the repository at this point in the history
* Add support for both in _TimeViewer

* Port slider position patch from #7227
  • Loading branch information
GuillaumeFavelier authored and agramfort committed Jan 24, 2020
1 parent 9181122 commit 0e66401
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions mne/viz/_brain/_timeviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def __init__(self, brain):

for hemi in self.brain._hemis:
ci = 0 if hemi == 'lh' else 1
# with both, all hemis are on the same view
if self.brain._hemi == 'both':
ci = 0
for ri, view in enumerate(self.brain._views):
self.plotter.subplot(ri, ci)
name = "orientation_" + str(ri) + "_" + str(ci)
Expand Down Expand Up @@ -426,19 +429,6 @@ def set_slider_style(self, slider, show_label=True):
if not show_label:
slider_rep.ShowSliderLabelOff()

# add support for split window
shape = self.plotter.shape
pointa = slider_rep.GetPoint1Coordinate().GetValue()
pointb = slider_rep.GetPoint2Coordinate().GetValue()
pointa = _normalize(pointa, shape)
pointb = _normalize(pointb, shape)
slider_rep.GetPoint1Coordinate().\
SetCoordinateSystemToNormalizedDisplay()
slider_rep.GetPoint1Coordinate().SetValue(pointa[0], pointa[1])
slider_rep.GetPoint2Coordinate().\
SetCoordinateSystemToNormalizedDisplay()
slider_rep.GetPoint2Coordinate().SetValue(pointb[0], pointb[1])


def _set_text_style(text_actor):
if text_actor is not None:
Expand Down

0 comments on commit 0e66401

Please sign in to comment.