Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing DICOM images will cause crash #12

Open
edmundlaugasson opened this issue Jun 13, 2023 · 12 comments
Open

Importing DICOM images will cause crash #12

edmundlaugasson opened this issue Jun 13, 2023 · 12 comments

Comments

@edmundlaugasson
Copy link

edmundlaugasson commented Jun 13, 2023

Having 474 *.dcm (including DICOMDIR file) files (teeth images) unpacked in folder and trying to import. Opened app via CLI. First and after dashed line last rows after crash (program window will be automatically closed):

flatpak run br.gov.cti.invesalius
Gtk-Message: 17:54:45.534: Failed to load module "xapp-gtk3-module"
Gtk-Message: 17:54:45.534: Failed to load module "canberra-gtk-module"
session mode:  0
(app.py:2): Gtk-CRITICAL **: 17:54:47.550: gtk_widget_set_size_request: assertion 'height >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.644: gtk_widget_set_size_request: assertion 'width >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.644: gtk_widget_set_size_request: assertion 'width >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.645: gtk_widget_set_size_request: assertion 'height >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.645: gtk_widget_set_size_request: assertion 'width >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.646: gtk_widget_set_size_request: assertion 'width >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.667: gtk_widget_set_size_request: assertion 'height >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.810: gtk_widget_set_size_request: assertion 'width >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.812: gtk_widget_set_size_request: assertion 'height >= -1' failed
(app.py:2): Gtk-CRITICAL **: 17:54:47.812: gtk_widget_set_size_request: assertion 'width >= -1' failed
>>> menu Change image spacing
>>> menu Porous volume creation
>>> menu Remove non-visible faces
>>> menu Remove tiny objects
Checking updates...
-------------
>>>> [<invesalius.reader.dicom_grouper.PatientGroup object at 0x7f863b39ed00>]
2023-06-13 17:54:58.854 (  13.617s) [        455BE740]vtkOpenGLRenderWindow.c:493    ERR| vtkXOpenGLRenderWindow (0x55bd95daf800): GLEW could not be initialized: Missing GL version

At the same time e.g. Weasis can browse and show these DICOM images, also series scrolling works.

@tfmoraes
Copy link
Collaborator

Hi @edmundlaugasson. VTK needs OpenGL > 3. If you GPU driver doesn't support a newer version of OpenGL you can use software rendering, this way:

export LIBGL_ALWAYS_SOFTWARE=1
export __GLX_VENDOR_LIBRARY_NAME=mesa #if you are using nvidia driver
python app.py

@edmundlaugasson
Copy link
Author

edmundlaugasson commented Jun 14, 2023

Using Arch Linux and it has very latest version of official nVidia software, which supports OpenGL, also very latest, currently

glxinfo | grep "OpenGL version"
OpenGL version string: 4.6.0 NVIDIA 530.41.03

Such hacking might be solution but is quite overwhelming for most users. Such detection should happen automatically and program should run without manual hacking.

@tfmoraes
Copy link
Collaborator

I think you don't have the Nvidia driver installed in your flatpak or the flatpak one is not updated with the system one, they have to be in the same version. Try to install the driver on flatpak:

$ flatpak install org.freedesktop.Platform.GL.nvidia-530-41-03

or update flatpak softwares:

$ flatpak update

You can use GPU-Viewer to see if Nvidia is working on flatpak:

flatpak install io.github.arunsivaramanneo.GPUViewer

@edmundlaugasson
Copy link
Author

edmundlaugasson commented Jun 14, 2023

Thank you for hints!
My humble opinion is that nVidia software installation in flatpak should happen automatically as dependency when appropriate hardware detected as it happens with other programs.

@tfmoraes
Copy link
Collaborator

I don't remember if I installed the nvidia driver or flatpak installed automatically to me. But flatpak always update the nvidia driver to match the system one.

@edmundlaugasson
Copy link
Author

Actually in that computer is nVidia software as flatpak installed. Seems like this is not the cause of issue.

@tfmoraes
Copy link
Collaborator

Try to use GPU-Viewer to see if Nvidia is working correctly on flatpak:

flatpak install io.github.arunsivaramanneo.GPUViewer

Other possible problem is you are forcing to use wayland. VTK with wxPython doesn't work on wayland, but works on xwayland.

@edmundlaugasson
Copy link
Author

edmundlaugasson commented Jun 19, 2023

This installed ~330 MB of GNOME 43, which is outdated as [GNOME 44 is already in March 2023 out](https://release.gnome.org/ - filed an issue about that ) and then ~341MB of GNOME Locale 43, which is also outdated.... I'm using KDE.... But this app shows fine and still using X11. I understand the app InVesalius itself is faulty, because Weasis (also a Flatpak app) can show same DICOM-images freely without issues. I also checked Flatpak permissions with Flatseal and all needed permissions were given by default. If you store images outside home folder or removable device, you need to add it via Flatseal.

@tfmoraes
Copy link
Collaborator

I pushed a new update. It'll take some time to update in the Flathub. Maybe it will fix your problem.

This is strange. I created invesalius flatpak using gnome 44 runtime.

About the GPU-Viewer if you go to OpenGL tab it's showing Nvidia? This is what is showing here:

Captura de tela de 2023-06-19 20-32-36

@edmundlaugasson
Copy link
Author

edmundlaugasson commented Jun 20, 2023

My GPU-Viewer OpenGL-related output:
Screenshot_20230620_231042
Have to mention, that currently do not have those 474 images as these belong to another person. Anyway, perhaps I can try with sample DICOM-images available online but not sure whether I can find series of images to test also series scrolling.

@tfmoraes
Copy link
Collaborator

We have some DICOM images here https://invesalius.github.io/download.html

@edmundlaugasson
Copy link
Author

We have some DICOM images here https://invesalius.github.io/download.html

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants