Skip to content

Commit

Permalink
FIX: MIP is much better
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Jul 28, 2020
1 parent 372879a commit 4ab26c5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mne/viz/_brain/_brain.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ def remove_labels(self):
def add_volume(self, stc_vol, src_vol, trans):
from ...utils import Bunch
from ...source_estimate import VolVectorSourceEstimate
import pyvista as pv
from matplotlib.colors import ListedColormap
assert isinstance(stc_vol, VolVectorSourceEstimate)
assert src_vol.kind == 'volume'
use = src_vol[0]
Expand All @@ -605,7 +607,6 @@ def add_volume(self, stc_vol, src_vol, trans):
src_mri_t = use['src_mri_t']['trans'].copy()
src_mri_t[:3] *= mult
assert np.allclose(src_mri_t[:3, :3], np.diag([src_mri_t[0, 0]] * 3))
import pyvista as pv
grid = pv.UniformGrid()
grid.dimensions = n_pts + 1 # inject data on the cells
origin = src_mri_t[:3, 3]
Expand All @@ -618,7 +619,9 @@ def add_volume(self, stc_vol, src_vol, trans):
scalars[self._data[hemi]['vertices']] = subvals
grid.cell_arrays['values'] = scalars
self._data[hemi]['grid_actor'] = self._renderer.plotter.add_volume(
grid)
grid, mapper='gpu', blending='maximum', culling='back',
show_scalar_bar=False, clim=self._cmap_range,
cmap=ListedColormap(self._data['ctable'] / 255.))
self._data[hemi]['grid'] = grid

self.set_time_interpolation(self.time_interpolation)
Expand Down Expand Up @@ -1091,6 +1094,10 @@ def update_lut(self, fmin=None, fmid=None, fmax=None):
else:
scalar_bar = None
_set_colormap_range(actor, ctable, scalar_bar, rng)
# XXX add here
# grid_actor = hemi_data.get('grid_actor')
# if grid_actor is not None:
# _set_colormap_range(grid_actor, ctable, None, rng)
glyph_actor = hemi_data.get('glyph_actor')
if glyph_actor is not None:
_set_colormap_range(glyph_actor, ctable, None, rng)
Expand Down

0 comments on commit 4ab26c5

Please sign in to comment.