MRG: Recreate our helmet graphic#8116
Conversation
|
The camera settings are better IMO. It's good enough for me but I let you try @larsoner I use a fixed width for the tubes, it would be better to find a suitable value automatically. The coincident topology still needs to be fixed. |
|
Indeed it is getting closer: |
|
For coindicent topology, can we have something like |
|
I added
That I don't know. I did some experiments locally and it does not seem necessary but it may be in the future once we have a definitive solution. Also about Mayavi, I did not find any alternative to ...
'resolve_coincident_topology': 'polygon_offset',
'resolve_coincident_topology_': 1,
'resolve_coincident_topology_polygon_offset_faces': 1,
'resolve_coincident_topology_z_shift': 0.01,
... |
|
This is what I use: # And the field lines on top
renderer.contour(surface=surf, scalars=data, contours=n_contours,
vmin=-vmax, vmax=vmax, opacity=alpha,
colormap=colormap_lines, kind='tube',
width=0.0005) |
|
Do the lines also require a |
|
(The tubes presumably do not because they actually protrude from the surface; the lines OTOH will be coincident) |
|
Okay, feel free to choose either one based on which one you think looks better / more like the original. I guess the only remaining issue is the Mayavi coincident topology, right? |
Yes indeed |
|
pip-pre errors/segfaults are numpy/numpy#17198 and can be ignored for now |
|
Update after #8182 :
|
|
Also we should consider making PyVista the default backend. It's an item of #7162 |
|
@agramfort I opened #8220 :) |
| @verbose | ||
| def plot_evoked_field(evoked, surf_maps, time=None, time_label='t = %0.0f ms', | ||
| n_jobs=1, fig=None, verbose=None): | ||
| n_jobs=1, fig=None, vmax=None, n_contours=21, |
There was a problem hiding this comment.
My bad, it's actually 10 but 21 was the default number of contours used in the function. I will change that
|
ok merge when green then !
… |
|
I pushed a commit to tweak the distance too:
WDYT @larsoner ? |
|
perfect on my side ! |
|
Thanks @GuillaumeFavelier ! |
* upstream/master: (489 commits) MRG, DOC: Fix ICA docstring, add whitening (mne-tools#8227) MRG: Extract measurement date and age for NIRX files (mne-tools#7891) Nihon Kohden EEG file reader WIP (mne-tools#6017) BUG: Fix scaling for src_mri_t in coreg (mne-tools#8223) MRG: Set pyvista as default 3d backend (mne-tools#8220) MRG: Recreate our helmet graphic (mne-tools#8116) [MRG] Adding get_montage for montage to BaseRaw objects (mne-tools#7667) ENH: Allow setting tqdm backend (mne-tools#8177) [MRG, IO] Persyst reader into Raw object (mne-tools#8176) MRG, BUG: Fix errors in IO/loading/projectors (mne-tools#8210) MAINT: vectorize _read_annotations_edf (mne-tools#8214) FIX : events_from_annotation when annotations.orig_time is None and f… (mne-tools#8209) FIX: do not project to sphere; DOC - explain how to get EEGLAB-like topoplots (mne-tools#7455) [MRG, DOC] Added linear algebra of transform to doc (mne-tools#7087) FIX: Travis failure on python3.8.1 (mne-tools#8207) BF: String formatting in exception message (mne-tools#8206) BUG: Fix STC limit bug (mne-tools#8202) MRG, DOC: fix ica tutorial (mne-tools#8175) CSP component order selection (mne-tools#8151) MRG, ENH: Add on_missing to plot_events (mne-tools#8198) ...
* WIP: Recreate our helmet * Fix roll * Use https://github.com/mne-tools/mne-python/pull/7147\#issuecomment-566963090 * Change width slightly * Add polygon_offset parameter to surface() * Add polygon_offset parameter to mesh() * Use polygon_offset to resolve coincident topology * Fix contour() * Use lines instead of tubes * Fix pickable issue * Fix cropped helmet with pyvista Co-authored-by: Guillaume Favelier <guillaume.favelier@gmail.com>












I tried to recreate our helmet:
Using Mayavi I get this output for the new example:
If I switch to PyVista, I get:
Problems thus far:
plot_evoked_fieldcould set thepolygon_offsetit could be fixed?@GuillaumeFavelier can you look into these when you get a chance? Feel free to push directly here