Skip to content

Commit 2cbfde3

Browse files
committed
Add STC mesh controls
1 parent b410a9c commit 2cbfde3

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

mne/gui/_dipolefit.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,12 @@ def _configure_dock(self):
537537
self._set_status("Setting up controls...")
538538
r = self._renderer
539539

540+
# Add some controls for the STC viewer, but not all of them.
541+
if self._stc_brain is not None:
542+
self._stc_brain._configure_dock_colormap_widget(name="STC Color Limits")
543+
540544
# Visibility and opacity controls for the various meshes, one row per mesh.
545+
r._dock_add_stretch()
541546
layout = r._dock_add_group_box("Meshes", collapse=True)
542547
grid = r._layout_create("grid")
543548
r._layout_add_widget(layout, grid)
@@ -633,6 +638,7 @@ def _save(fname):
633638
)
634639
self._save_button.set_enabled(False)
635640
r._dock_add_stretch()
641+
r._dock_finalize()
636642

637643
def toggle_mesh(self, name, show=None):
638644
"""Toggle a mesh on or off.

mne/viz/_brain/_brain.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,6 @@ def setup_time_viewer(self, time_viewer=True, show_traces=True):
557557
raise ValueError("No data to visualize. See ``add_data``.")
558558
self.time_viewer = time_viewer
559559
self.orientation = list(_lh_views_dict.keys())
560-
self.default_smoothing_range = [-1, 15]
561560

562561
# Default configuration
563562
self.visibility = False
@@ -1012,7 +1011,7 @@ def fplus():
10121011
self.widgets["smoothing"] = self._renderer._dock_add_spin_box(
10131012
name="Smoothing",
10141013
value=self._data["smoothing_steps"],
1015-
rng=self.default_smoothing_range,
1014+
rng=[-1, 15],
10161015
callback=self.set_data_smoothing,
10171016
double=False,
10181017
layout=layout,

mne/viz/evoked_field.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,12 @@ def _configure_dock(self):
438438
"""Configure the widgets shown in the dock on the left."""
439439
r = self._renderer
440440

441-
if not hasattr(r, "_dock"):
441+
existing_dock = hasattr(r, "_dock")
442+
if not existing_dock:
442443
r._dock_initialize()
443444

444445
# Fieldline configuration
445-
layout = r._dock_add_group_box("Fieldlines", collapse=True)
446+
layout = r._dock_add_group_box("Fieldlines", collapse=False)
446447

447448
r._dock_add_label(value="max value", align=True, layout=layout)
448449

@@ -514,7 +515,7 @@ def _set_contour_line_width(line_width):
514515
self._widgets["contour_line_width"] = r._dock_add_slider(
515516
name="Thickness",
516517
value=self._contour_line_width,
517-
rng=[0, 10],
518+
rng=[0, 5],
518519
callback=_set_contour_line_width,
519520
double=True,
520521
layout=layout,
@@ -532,7 +533,9 @@ def _set_contour_line_opacity(opacity):
532533
double=True,
533534
layout=layout,
534535
)
535-
r._dock_finalize()
536+
537+
if not existing_dock:
538+
r._dock_finalize()
536539

537540
def _on_time_change(self, event):
538541
"""Respond to time_change UI event."""

0 commit comments

Comments
 (0)