Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
f1a1c24
Add cortex variable
GuillaumeFavelier Sep 2, 2019
3fd096c
Fix typo
GuillaumeFavelier Sep 2, 2019
4eb2c68
Add cortex support
GuillaumeFavelier Sep 2, 2019
83339e0
Fix kwargs
GuillaumeFavelier Sep 2, 2019
3517e27
Reduce get_geo argument to style, valid color name or None
GuillaumeFavelier Sep 3, 2019
528b86c
Add transparent and verbose variables
GuillaumeFavelier Sep 3, 2019
b42b0bb
Fix initial_time
GuillaumeFavelier Sep 4, 2019
b7b3a05
Add text and colorbar
GuillaumeFavelier Sep 4, 2019
d1c46ba
Add scalars and colormap in mesh() for the pyvista backend
GuillaumeFavelier Sep 4, 2019
ea4d7ee
Import mesh_edges and smoothing_matrix
GuillaumeFavelier Sep 5, 2019
3851e0a
Fix time_idx and text_label
GuillaumeFavelier Sep 5, 2019
0b749b9
Fix some doc
GuillaumeFavelier Sep 5, 2019
2ffb506
Postpone use of geo_ variables
GuillaumeFavelier Sep 5, 2019
beb6c30
Fix some doc
GuillaumeFavelier Sep 5, 2019
9b4f230
Rework colorbar colorbar
GuillaumeFavelier Sep 5, 2019
ccfeaa3
Try new api for scalarbar
GuillaumeFavelier Sep 6, 2019
e2b3e3e
Update mayavi backend
GuillaumeFavelier Sep 6, 2019
c78dfaf
Upgrade pyvista to master
GuillaumeFavelier Sep 6, 2019
2835dd6
Add basic support for figure
GuillaumeFavelier Sep 6, 2019
c2350d2
Fix mayavi backend colorbar
GuillaumeFavelier Sep 10, 2019
38e7333
Fix text size and position
GuillaumeFavelier Sep 10, 2019
bf8c7bb
Update size parameter in text2d()
GuillaumeFavelier Sep 11, 2019
a441b6f
Update text2d() size in _Brain
GuillaumeFavelier Sep 11, 2019
430ae94
Improve figure management
GuillaumeFavelier Sep 11, 2019
4747496
Improve Figure testing
GuillaumeFavelier Sep 11, 2019
b396bf3
Fix IndexError with hi, ci
GuillaumeFavelier Sep 11, 2019
2475315
Fix variable name
GuillaumeFavelier Sep 11, 2019
c04dafc
Merge branch 'master' into brain_plot_source_estimates
GuillaumeFavelier Sep 12, 2019
d207529
Fix callable alert
GuillaumeFavelier Sep 12, 2019
dad6806
Add function signatures
GuillaumeFavelier Sep 12, 2019
a698cba
Update overview table
GuillaumeFavelier Sep 12, 2019
7438b64
TST: Produce Circle atifact for plot_xhemi example
GuillaumeFavelier Sep 12, 2019
84f4898
Fill up add_label() to start somewhere
GuillaumeFavelier Sep 12, 2019
7a9ec7a
Fix overview table
GuillaumeFavelier Sep 16, 2019
9792dd5
Merge branch 'master' into brain_plot_source_estimates
GuillaumeFavelier Sep 16, 2019
50476e1
Use binary mask for label and custom colormap
GuillaumeFavelier Sep 16, 2019
782fba6
Fix label management for mayavi
GuillaumeFavelier Sep 16, 2019
4d885df
Add screenshot() function
GuillaumeFavelier Sep 17, 2019
ae7575a
Fix default parameter for screenshot
GuillaumeFavelier Sep 17, 2019
d528927
Rescale brain overview table, add close() and test screenshot()
GuillaumeFavelier Sep 17, 2019
ad27d4a
Fix test_screenshot()
GuillaumeFavelier Sep 17, 2019
bb86df0
Fix default mode for screenshot
GuillaumeFavelier Sep 17, 2019
e4fa6c2
TST: check appveyor with smaller size
GuillaumeFavelier Sep 17, 2019
53668ea
Postpone 3 lgtm alerts for label_name
GuillaumeFavelier Sep 17, 2019
4237b42
Add add_foci() function signature
GuillaumeFavelier Sep 18, 2019
78b85fc
Fill up add_foci() and add add_text() signature
GuillaumeFavelier Sep 18, 2019
2d8d0db
Fix variable names
GuillaumeFavelier Sep 19, 2019
fb8e029
Fix close() function
GuillaumeFavelier Sep 19, 2019
452205f
Fix dependency to nibabel
GuillaumeFavelier Sep 19, 2019
856cb8e
Try subplot system
GuillaumeFavelier Sep 19, 2019
5b91886
Fix shape integration in pyvista backend
GuillaumeFavelier Sep 19, 2019
a32cac0
Restore shape coords
GuillaumeFavelier Sep 19, 2019
9b50ed6
Add basic support for hemi='split' for the pyvista backend
GuillaumeFavelier Sep 19, 2019
d04b363
Add small code refactor and fixes
GuillaumeFavelier Sep 19, 2019
7e4dac8
Merge branch 'master' into brain_plot_source_estimates
GuillaumeFavelier Sep 19, 2019
8cb29a2
TST: first try build doc with _Brain (default: pyvista)
GuillaumeFavelier Sep 20, 2019
29bd17e
TST: Trigger circleci [circle full]
GuillaumeFavelier Sep 20, 2019
765b06a
Merge branch 'master' into brain_plot_source_estimates
GuillaumeFavelier Sep 20, 2019
0440a35
Fix _Brain screenshot() in sphinx-gallery
GuillaumeFavelier Sep 20, 2019
81e2f42
Merge branch 'master' into brain_plot_source_estimates
GuillaumeFavelier Sep 23, 2019
24858d7
Refactor colormap management
GuillaumeFavelier Sep 23, 2019
777165b
Fix minor bugs
GuillaumeFavelier Sep 23, 2019
0ea585d
Switch to tagged version 0.22.2 of PyVista
GuillaumeFavelier Sep 23, 2019
f7efe90
Add support for transparent in add_data()
GuillaumeFavelier Sep 23, 2019
645d465
Add subplot system to Mayavi backend
GuillaumeFavelier Sep 23, 2019
649aa0e
Use PySurfer from now on for the mayavi backend
GuillaumeFavelier Sep 24, 2019
e1ce006
Improve camera settings
GuillaumeFavelier Sep 24, 2019
20a40ea
Add support for view + hemi=split
GuillaumeFavelier Sep 24, 2019
ecd1698
Merge branch 'master' into brain_plot_source_estimates
GuillaumeFavelier Sep 24, 2019
9c0aab8
Add add_text() function
GuillaumeFavelier Sep 25, 2019
f340d08
Add some tests
GuillaumeFavelier Sep 25, 2019
dcfb3f4
Add more tests
GuillaumeFavelier Sep 25, 2019
93f5e78
TST: Build documentation [circle full]
GuillaumeFavelier Sep 25, 2019
2deee16
Check how CIs react to hotfix
GuillaumeFavelier Sep 25, 2019
cb380ab
TST: Build doc [circle full]
GuillaumeFavelier Sep 26, 2019
007d2e1
Add a save_image() function
GuillaumeFavelier Sep 27, 2019
9a02f7e
TST: Try on sphinx-patch [circle full][skip azp][skip travis]
GuillaumeFavelier Sep 27, 2019
c18b5a1
TST: Hotfix for figure naming by int id [circle full][skip travis][sk…
GuillaumeFavelier Sep 27, 2019
720f2b5
Allow only one active scalar bar
GuillaumeFavelier Sep 30, 2019
23fc522
Change font and increase tick label size
GuillaumeFavelier Sep 30, 2019
15a7cc3
Tweak the tick label size
GuillaumeFavelier Sep 30, 2019
1d5670a
Work on coverage
GuillaumeFavelier Sep 30, 2019
4ee3181
Add support for colorbar parameter
GuillaumeFavelier Oct 1, 2019
726e07c
Switching to master branch
GuillaumeFavelier Oct 3, 2019
bed57ee
TST: Build doc [circle full][skip azp][skip travis]
GuillaumeFavelier Oct 3, 2019
e93322a
TST: Check CIs without skipping this time
GuillaumeFavelier Oct 3, 2019
d7d5139
Rework verbose parameter
GuillaumeFavelier Oct 3, 2019
00c6178
Rework verbose parameter in util
GuillaumeFavelier Oct 3, 2019
a667d0e
Add magic number 0.15 for default cylinder glyph radius
GuillaumeFavelier Oct 4, 2019
5ab129b
Fix text position
GuillaumeFavelier Oct 4, 2019
da4c42a
TST: Try normalized viewport coordinates
GuillaumeFavelier Oct 4, 2019
469baea
Switch back to master branch of pyvista
GuillaumeFavelier Oct 4, 2019
d0c6315
TST: Build doc [circle full]
GuillaumeFavelier Oct 4, 2019
5184394
fix import order + add authors
agramfort Oct 8, 2019
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
echo "export OPENBLAS_NUM_THREADS=4" >> $BASH_ENV
export MNE_ROOT=${PWD}/minimal_cmds
echo "export MNE_ROOT=${PWD}/minimal_cmds" >> $BASH_ENV
echo "export MNE_3D_BACKEND=pyvista" >> $BASH_ENV
echo "export PATH=~/.local/bin/:${MNE_ROOT}/bin:$PATH" >> $BASH_ENV
curl https://staff.washington.edu/larsoner/minimal_cmds.tar.gz | tar xz
echo "export LD_LIBRARY_PATH=${MNE_ROOT}/lib:$LD_LIBRARY_PATH" >> $BASH_ENV
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
- pip:
- mne
- vtk
- pyvista>=0.21.3
- https://github.com/pyvista/pyvista/zipball/master
- mayavi
- PySurfer[save_movie]
- dipy --only-binary dipy
Expand Down
1 change: 0 additions & 1 deletion examples/visualization/plot_xhemi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
data_dir = mne.datasets.sample.data_path()
subjects_dir = data_dir + '/subjects'
stc_path = data_dir + '/MEG/sample/sample_audvis-meg-eeg'

stc = mne.read_source_estimate(stc_path, 'sample')

# First, morph the data to fsaverage_sym, for which we have left_right
Expand Down
40 changes: 26 additions & 14 deletions mne/viz/_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def plot_evoked_field(evoked, surf_maps, time=None, time_label='t = %0.0f ms',

if '%' in time_label:
time_label %= (1e3 * evoked.times[time_idx])
renderer.text2d(x=0.01, y=0.01, text=time_label, width=0.4)
renderer.text2d(x=0.01, y=0.01, text=time_label)
renderer.set_camera(azimuth=10, elevation=60)
renderer.show()
return renderer.scene()
Expand Down Expand Up @@ -1639,6 +1639,7 @@ def plot_source_estimates(stc, subject=None, surface='inflated', hemi='lh',
An instance of :class:`surfer.Brain` from PySurfer or
matplotlib figure.
""" # noqa: E501
from .backends.renderer import get_3d_backend
# import here to avoid circular import problem
from ..source_estimate import SourceEstimate
_validate_type(stc, SourceEstimate, "stc", "Surface Source Estimate")
Expand Down Expand Up @@ -1666,7 +1667,10 @@ def plot_source_estimates(stc, subject=None, surface='inflated', hemi='lh',
time_unit=time_unit, background=background,
spacing=spacing, time_viewer=time_viewer,
colorbar=colorbar, transparent=transparent)
from surfer import Brain, TimeViewer
if get_3d_backend() == "mayavi":
from surfer import Brain, TimeViewer
else:
from ._brain import _Brain as Brain
_check_option('hemi', hemi, ['lh', 'rh', 'split', 'both'])

time_label, times = _handle_time(time_label, time_unit, stc.times)
Expand All @@ -1687,24 +1691,32 @@ def plot_source_estimates(stc, subject=None, surface='inflated', hemi='lh',
background=background, foreground=foreground,
figure=figure, subjects_dir=subjects_dir,
views=views)

ad_kwargs, sd_kwargs = _get_ps_kwargs(
initial_time, diverging, scale_pts[1], transparent)
del initial_time, transparent
center = 0. if diverging else None
for hemi in hemis:
hemi_idx = 0 if hemi == 'lh' else 1
data = getattr(stc, hemi + '_data')
vertices = stc.vertices[hemi_idx]
if len(data) > 0:
kwargs = {
"array": data, "colormap": colormap,
"vertices": vertices,
"smoothing_steps": smoothing_steps,
"time": times, "time_label": time_label,
"alpha": alpha, "hemi": hemi,
"colorbar": colorbar, "initial_time": initial_time,
"transparent": transparent, "center": center,
"verbose": False
}
if get_3d_backend() == "mayavi":
kwargs["min"] = scale_pts[0]
kwargs["mid"] = scale_pts[1]
kwargs["max"] = scale_pts[2]
else:
kwargs["fmin"] = scale_pts[0]
kwargs["fmid"] = scale_pts[1]
kwargs["fmax"] = scale_pts[2]
with warnings.catch_warnings(record=True): # traits warnings
brain.add_data(data, colormap=colormap, vertices=vertices,
smoothing_steps=smoothing_steps, time=times,
time_label=time_label, alpha=alpha, hemi=hemi,
colorbar=colorbar,
min=scale_pts[0], max=scale_pts[2], **ad_kwargs)
if 'mid' not in ad_kwargs: # PySurfer < 0.9
brain.scale_data_colormap(fmin=scale_pts[0], fmid=scale_pts[1],
fmax=scale_pts[2], **sd_kwargs)
brain.add_data(**kwargs)
if time_viewer:
TimeViewer(brain)
return brain
Expand Down
Loading