You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In mne-python, we rely on ipywidgets and ipyvtklink to design apps for MEG and EEG processing and visualization.
AFAIK, ipyvtklink uses ipyevents to get the mouse event locations. Then it does a little bit of offset computation to adjust the given coordinates from the canvas size (which depends on the notebook) to the render window size (which is fixed by the Renderer at init), correct?
Well, in our last application, we embed the ViewInteractiveWidget in a HBox for a new design:
output.mp4
What happens when all the group boxes are folded, the values given by ipyevents for boundingRectHeight and boundingRectTop used for offset calculation are correct because the image and its bounding box have the same size.
But we use viewer.layout.object_fit='contain' to preserve the aspect ratio and when the group boxes are unfolded, the bounding box of the image is stretched with the accordion and now, I think the sizes sent by ipyevents do not match anymore.
This is a problem for us because we need the correct position of the event for picking:
output.mp4
Is there a way to update the offset calculation so that GetEventPosition() returns the correct value when object_fit='contain'?
The text was updated successfully, but these errors were encountered:
In
mne-python
, we rely onipywidgets
andipyvtklink
to design apps for MEG and EEG processing and visualization.AFAIK,
ipyvtklink
usesipyevents
to get the mouse event locations. Then it does a little bit of offset computation to adjust the given coordinates from the canvas size (which depends on the notebook) to the render window size (which is fixed by the Renderer at init), correct?Well, in our last application, we embed the
ViewInteractiveWidget
in aHBox
for a new design:output.mp4
What happens when all the group boxes are folded, the values given by
ipyevents
forboundingRectHeight
andboundingRectTop
used for offset calculation are correct because the image and its bounding box have the same size.But we use
viewer.layout.object_fit='contain'
to preserve the aspect ratio and when the group boxes are unfolded, the bounding box of the image is stretched with the accordion and now, I think the sizes sent byipyevents
do not match anymore.This is a problem for us because we need the correct position of the event for picking:
output.mp4
Is there a way to update the offset calculation so that
GetEventPosition()
returns the correct value whenobject_fit='contain'
?The text was updated successfully, but these errors were encountered: