Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions mne/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ def coregistration(tabbed=False, split=True, width=None, inst=None,
different color.

.. versionadded:: 0.16
interaction : str | None
Can be 'terrain' (default None), use terrain-style interaction (where
"up" is the Z/superior direction), or 'trackball' to use
orientationless interactions.
%(scene_interaction_None)s
Defaults to ``'terrain'``.

.. versionadded:: 0.16
.. versionchanged:: 1.0
Default interaction mode if ``None`` and no config setting found
changed from ``'trackball'`` to ``'terrain'``.
scale : float | None
The scaling for the scene.

Expand Down Expand Up @@ -133,7 +134,6 @@ def coregistration(tabbed=False, split=True, width=None, inst=None,
'project_eeg': project_eeg,
'scale_by_distance': scale_by_distance,
'mark_inside': mark_inside,
'interaction': interaction,
'scale': scale,
'advanced_rendering': advanced_rendering,
}
Expand All @@ -144,7 +144,7 @@ def coregistration(tabbed=False, split=True, width=None, inst=None,
to_raise = val is not None
if to_raise:
warn(f"The parameter {key} is not supported with"
" the pyvistaqt 3d backend. It will be ignored.")
" the pyvistaqt 3d backend. It will be ignored.")
config = get_config(home_dir=os.environ.get('_MNE_FAKE_HOME_DIR'))
if guess_mri_subject is None:
guess_mri_subject = config.get(
Expand Down Expand Up @@ -177,7 +177,7 @@ def coregistration(tabbed=False, split=True, width=None, inst=None,
scale_by_distance = (config.get('MNE_COREG_SCALE_BY_DISTANCE', '') ==
'true')
if interaction is None:
interaction = config.get('MNE_COREG_INTERACTION', 'trackball')
interaction = config.get('MNE_COREG_INTERACTION', 'terrain')
if mark_inside is None:
mark_inside = config.get('MNE_COREG_MARK_INSIDE', '') == 'true'
if scale is None:
Expand All @@ -196,7 +196,7 @@ def coregistration(tabbed=False, split=True, width=None, inst=None,
info_file=inst, subject=subject, subjects_dir=subjects_dir,
head_resolution=head_high_res, orient_glyphs=orient_to_surface,
trans=trans, size=(width, height), show=show, standalone=standalone,
verbose=verbose
interaction=interaction, verbose=verbose
)


Expand Down
8 changes: 7 additions & 1 deletion mne/gui/_coreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class CoregistrationUI(HasTraits):
Display the window as soon as it is ready. Defaults to True.
standalone : bool
If True, start the Qt application event loop. Default to False.
%(scene_interaction)s
Defaults to ``'terrain'``.

.. versionadded:: 1.0
%(verbose)s
"""

Expand All @@ -95,7 +99,8 @@ def __init__(self, info_file, subject=None, subjects_dir=None,
head_transparency=None, hpi_coils=None,
head_shape_points=None, eeg_channels=None, orient_glyphs=None,
sensor_opacity=None, trans=None, size=None, bgcolor=None,
show=True, standalone=False, verbose=None):
show=True, standalone=False, interaction='terrain',
verbose=None):
from ..viz.backends.renderer import _get_renderer

def _get_default(var, val):
Expand Down Expand Up @@ -156,6 +161,7 @@ def _get_default(var, val):
self._renderer = _get_renderer(
size=self._defaults["size"], bgcolor=self._defaults["bgcolor"])
self._renderer._window_close_connect(self._clean)
self._renderer.set_interaction(interaction)

# setup the model
self._info = info
Expand Down
20 changes: 20 additions & 0 deletions mne/utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1906,6 +1906,26 @@
Using multiple views (list) is not supported for mpl backend.
"""

# Coregistration
scene_interaction_common = """\
How interactions with the scene via an input device (e.g., mouse or
trackpad) modify the camera position. If ``'terrain'``, one axis is
fixed, enabling "turntable-style" rotations. If ``'trackball'``,
movement along all axes is possible, which provides more freedom of
movement, but you may incidentally perform unintentional rotations along
some axes.\
"""
docdict['scene_interaction'] = f"""
interaction : 'trackball' | 'terrain'
{scene_interaction_common}
"""
docdict['scene_interaction_None'] = f"""
interaction : 'trackball' | 'terrain' | None
{scene_interaction_common}
If ``None``, the setting stored in the MNE-Python configuration file is
used.
"""

# STC label time course
docdict['eltc_labels'] = """
labels : Label | BiHemiLabel | list | tuple | str
Expand Down
7 changes: 2 additions & 5 deletions mne/viz/_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,7 @@ def plot_alignment(info=None, trans=None, subject=None, subjects_dir=None,
If ``None``, creates a new 600x600 pixel figure with black background.

.. versionadded:: 0.16
interaction : str
Can be "trackball" (default) or "terrain", i.e. a turntable-style
camera.
%(scene_interaction)s

.. versionadded:: 0.16
%(verbose)s
Expand Down Expand Up @@ -697,8 +695,7 @@ def plot_alignment(info=None, trans=None, subject=None, subjects_dir=None,
# initialize figure
renderer = _get_renderer(fig, name=f'Sensor alignment: {subject}',
bgcolor=(0.5, 0.5, 0.5), size=(800, 800))
if interaction == 'terrain':
renderer.set_interaction('terrain')
renderer.set_interaction(interaction)

# plot head
_, _, head_surf = _plot_head_surface(
Expand Down