Skip to content

get_view does not report correct camera position #11189

Closed

Description

@dlinhardt

Description of the problem

Hey!
When I grab the camera position with get_view and then put the exact parameter into show_view it will rotate to another position. So it is for me not possible to reproduce a view I graded before.
Thanks for the help!

Steps to reproduce

brain = mne.viz.Brain('sub-001', subjects_dir=freesurferPath, **brain_kwargs)

Link to data

No response

Expected results

I would expect to get the same view when I put the output of get_view back into `show_view

Actual results

e.g. this view

brain.show_view(roll=0, distance=500, azimuth=0, elevation=0, focalpoint=np.array([0,0,0]))

produces this output in get_view

brain.get_view()
Out: (-0.28054169987693117, 500.0465294401304, -85.98997441180703, 17.355482022664994, array([8.67361738e-19, 3.46944695e-18, 0.00000000e+00]))

Additional information

Platform: macOS-12.6-arm64-arm-64bit
Python: 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:41:22) [Clang 13.0.1 ]
Executable: /Users/dlinhardt/anaconda3/envs/david/bin/python
CPU: arm: 8 cores
Memory: 16.0 GB

mne: 1.1.1
numpy: 1.23.3 {blas=NO_ATLAS_INFO, lapack=lapack}
scipy: 1.9.1
matplotlib: 3.5.3 {backend=Qt5Agg}

sklearn: 1.1.2
numba: Not found
nibabel: 4.0.2
nilearn: 0.9.2
dipy: Not found
cupy: Not found
pandas: 1.4.4
pyvista: 0.36.1 {OpenGL 4.1 Metal - 76.3 via Apple M1}
pyvistaqt: 0.9.0
ipyvtklink: Not found
vtk: 9.2.0.rc2
qtpy: 2.2.0 {PyQt5=5.15.4}
ipympl: Not found
pyqtgraph: Not found
pooch: v1.6.0

mne_bids: Not found
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: Not found
mne_connectivity: Not found
mne_icalabel: Not found

Activity

  1. welcome commented on Sep 19, 2022

    @welcome

    Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

  2. larsoner commented on Sep 19, 2022

    @larsoner
    Member

    Indeed it seems like a bug -- we should convert from whatever internal representation the PyVista / VTK camera is using (as it seems like we just return it here so far) back to the representation we use with show_view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions