I have need for a containerized mne install complete with 3d graphics support (for full Qa reporting etc) and optionally with freesurfer (for bem creation etc).
Is there interest in something like this? Has anyone already done it?
I have played alittle bit with it, with middling success. Mostly due to the opengl stuff I think. If there is interest I can push it to github repo and iterate more publicly on it.
I think that computation and 2D plotting work, but 3d plotting is broken. I have in mind to rebuild mesa with the opengl drivers, but I’d like to rule out other issues first. such as the vtk issue discussed at PyVista within a Docker Container — PyVista 0.29.0 documentation. Though I hoped that the vtk in the mne server_environment.yml sorted that issue.
Thanks for starting this @bloyl, I think it’s an interesting project
The version of VTK used in server_environment.yml should rely on osmesa for rendering if mesalib is available in the environment. It was designed to be used with the “off_screen”, PyVista-based notebook 3d backend.
From what I see in your README.md, you try to use PyVista with PyQt5:
$ docker run -it mne_docker python work/plot_eeg_on_scalp.py
Opening raw data file /home/jovyan/mne_data/MNE-sample-data/MEG/sample/sample_audvis_raw.fif...
Read a total of 3 projection items:
PCA-v1 (1 x 102) idle
PCA-v2 (1 x 102) idle
PCA-v3 (1 x 102) idle
Range : 25800 ... 192599 = 42.956 ... 320.670 secs
Ready.
Using outer_skin.surf for head surface.
Using pyvista 3d backend.
...
Is that your intention?
The rest of the log seems related to an issue with Qt itself:
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
And I remember seeing this on CircleCI for example. IIRC, it’s because it needs a (virtual) screen to open windows, e.g. xvfb but I am not 100% sure.
From what I see in your README.md , you try to use PyVista with PyQt5:
Is that your intention?
I have 2 use cases
To be able to use jupyter with 3d and 2d plotting interactively
To be able to use non interactive scripts to do analysis, which includes off screen 2d/3d plotting to files and to mne.Report objects. I think this is identical to a true headless HPC type of install.
I think I’m going to focus on getting jupyter up and running.
@GuillaumeFavelier what would you suggest is the best setup for jupyter, mne and pyvista all happily getting along?
FYI the current docker file uses:
stock Xvfb
MNE 0.22 installed via the server_environmnet.yml file
To be able to use non interactive scripts to do analysis, which includes off screen 2d/3d plotting
As of now, I don’t think PyVistaQt supports this. It would require some work to switch our backend to PyVista instead. Technically, the code to achieve this is already there in the notebook backend…
To be able to use jupyter with 3d and 2d plotting interactively
I would start by using ipyvtk Dockerfile as a minimal working example then try to integrate mne-python in a second step: