question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

discrepancy when plotting vertex time course with pyvista backend

See original GitHub issue

Describe the bug

The MNE time course looks different when plotting a vertex within the brain visualization GUI via the pyvista backend (top figure shown below) compared to manually plotting the vertex using SourceEstimate.data (bottom figure shown below).

Steps to reproduce

See https://gist.github.com/rythorpe/3c57fdb572bc17bb1f3e4bb70b3e1104 using the somato dataset. Selecting the exact vertex within the brain visualization window can be tricky (unless there is a more controlled way to to this through the API?).

Expected results

I expected the vertex time courses rendered in the GUI to match those plotted manually with matplotlib. Furthermore, I expected the vertex of maximal activity (blue trace shown below) to reflect the largest peak (compared to the orange trace) in the GUI.

Actual results

Note that the blue trace represents the time course of the right hemisphere vertex retrieved with SourceEstimate.get_peak() and that the vertex IDs are the same in each figure.

Screenshot from 2021-01-27 15-00-04

Screenshot from 2021-01-27 14-59-26

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jasmainakcommented, Jan 28, 2021

What is the motivation behind plotting the time course for smoothed data by default?

The source space is a decimated surface, so to get a proper visualization you need to smooth the result. You could also plot directly on the source space but since it’s so decimated it will look very weird

0reactions
rythorpecommented, Jan 28, 2021

Thanks for the help @larsoner and @jasmainak!

Read more comments on GitHub >

github_iconTop Results From Across the Web

plot — PyVista 0.37.0 documentation
Jupyter notebook plotting backend to use. One of the following: 'none' : Do not display in the notebook. 'static ...
Read more >
mne-python/_brain.py at main - GitHub
Cannot retrieve contributors at this time ... :meth:`mne.viz.plot_source_estimates` with the PyVista backend ... """Plot the vertex time course. Parameters.
Read more >
What's new — MNE 0.21.2 documentation
Fix bug with mne.viz.plot_source_estimates() when using the PyVista backend where singleton time points were not handled properly by Eric ...
Read more >
Tutorial: PyVista - YouTube
Bane SullivanSlack channel, see softwareunderground.org/slack: t21-tue-pyvistaThe instructions and example code are hosted on GitHub here: ...
Read more >
Why jupyter notebook or lab doesn't show an interactive ...
I am unable to interact with pyvista plots either on jupyter ... and the plot became interactive in VS Code, but only if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found