Closed wmvanvliet closed 6 years ago
In the mne-python coreg-GUI you can click on the head to set fiducials, you should be able to find all the necessary mayavi functions there.
This is already built into mayavi. I'm pretty sure you just need to click and then press "p".
Here's a very simple example to show how you can also define a mayavi callback to do this that you can extend to use the index directly in your code:
from mayavi import mlab
from surfer import Brain
b = Brain("fsaverage", "lh", "inflated")
f = mlab.figure("fsaverage")
f.on_mouse_pick(lambda p: print(p.point_id), button="Right")
After executing this, right-clicking on a vertex should result in its index being printed to stdout. I'm not sure if there's a simpler way to get the figure handle. It's buried in a private attribute in the Brain
object (in the b._figures
nested list), so going through mlab
to get it seemed to make sense.
Closing as I don't see a need for any more functionality in pysurfer itself but others can comment/reopen if they want to add something.
I never knew! Thanks for the tips!
I really wish I had the ability to click on the brain and get the vertex number and the corresponding index of the data matrix. Sometimes I see something interesting on the cortex and would like to quickly get to the corresponding row in the data matrix.