Skip to content

Commit

Permalink
Fix cell vertex ids (#7665)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeFavelier authored and larsoner committed Apr 23, 2020
1 parent 49284ff commit c80483f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mne/viz/_brain/_timeviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,9 @@ def on_pick(self, vtk_picker, event):
elif self._mouse_no_mvt:
hemi = mesh._hemi
pos = vtk_picker.GetPickPosition()
cell = mesh.faces[cell_id][1:]
vtk_cell = mesh.GetCell(cell_id)
cell = [vtk_cell.GetPointId(point_id) for point_id
in range(vtk_cell.GetNumberOfPoints())]
vertices = mesh.points[cell]
idx = np.argmin(abs(vertices - pos), axis=0)
vertex_id = cell[idx[0]]
Expand Down

0 comments on commit c80483f

Please sign in to comment.