-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
picking vertex in brain object to see time course #7235
Comments
At least in principle there is vtkChart:
I'm actually not sure the extent to which this will be possible. Picking with the mouse is usually done by rendering tricks or casting a ray (I think VTK does the latter). I'm not sure there is a way to ask for "all mesh vertices currently visible). And given a non-zero alpha, this isn't even necessarily well defined. So for a first pass I say we just make it so that clicking on a point in the mesh does mesh vertex picking and does a vtkChart plot of the time course. (If off the mesh, don't change the point currently used. This way clicking always will show the time course, and if you don't want it to change, click in the empty space around the mesh. Either that or use ctrl-click for picking or something.) I leave it as an exercise to @GuillaumeFavelier to figure out where this plot should live :) Maybe a |
why not extend the functionality of 4D viewer with cortical ribbon first? |
It's nicer to view surface source estimate data on the surface |
That's a nice idea and thank you so much for the pointers @larsoner, I have somewhere to start now. |
And for mouse click vertex picking in mayavi (so you can translate to PyVista) see https://github.com/mne-tools/mne-python/blob/master/mne/gui/_fiducials_gui.py#L359 |
Vertex picking is available by default in PyVista: |
Would this allow to spit out MNI coordinates at the pick (or the label of a pre-defined atlas)? |
Also, a very small add-on: labels for the 3 clim-scales would be helpful. |
I think any data associated to the point data/vertex id could be retrieved that way in theory. |
I discovered |
fmax/fmid/fmin labels were present in previous version but were dropped in favour of a more compact UI. |
ToDo (suggested in #7247 (comment))
|
+10 to embedding a mpl figure rather than figuring out vtkChartXY, it gives us more flexibility going forward, e.g., including showing time-frequency images eventually, and will unify the user experience of 2D plots around MPL and its standard interactions (like zooming and view resetting). The "only" tricky parts of this approach will be: |
@larsoner Why would we have to set up our own Qt window? At least in interactive matplotlib mode - it might be easier and more flexible to open a separate matplotlib window per click/interaction. |
I don't think that would work as well. The design I'm advocating is basically a variant of what we already do in the volume plotter. You could apply your argument to that as well -- that we shouldn't render the time trace(s) in the same window as the brain volume rendering -- and I don't think it would be as nice as experience as having them contained in the same window. |
Yes, that's true - separate window can feel more clunky, but the benefit is that the user can place it however he wants. And although volume source plotter shows traces in the same window - many other mne interfaces open separate windows (time-frequency - when interacting with topomap [also tfr heatmap IIRC], evokeds - when selecting time window, ica source signal viewer when clicking on ic label, ica plot components opens properties windows). With separate windows you can also compare various traces without the need to implement specific option for that - you click on two vertices / channels and see corresponding signals in two separate windows. |
Honestly I thought the same at first but it seems only a few lines of code were necessary to add this: vlayout = self.plotter.frame.layout()
vlayout.addWidget(self.mpl_canvas)
vlayout.setStretch(0, 2)
vlayout.setStretch(1, 1) |
@GuillaumeFavelier - that's cool! |
It's possible too. How would you pass this option though? We already use |
|
@larsoner Sure! |
I would be great to get a plot of a time course of a vertex on a 3D brain object.
a suggestion from @SophieHerbst is also to have a short cut to pick automatically the vertex with the highest amplitude in the current view.
@GuillaumeFavelier
The text was updated successfully, but these errors were encountered: