-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
Allow both 'auto' and None as texture_format when choosing VisPy node #6652
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6652 +/- ##
==========================================
- Coverage 92.32% 92.27% -0.05%
==========================================
Files 605 605
Lines 54227 54231 +4
==========================================
- Hits 50064 50044 -20
- Misses 4163 4187 +24 ☔ View full report in Codecov by Sentry. |
Not possibly, but it is exactly this error. |
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/opening-image-in-napari-linux/91950/3 |
Thank you so much for adding a fix! I will try it now. |
I just tried running it (unfortunately i do not have direkt desktop access so I had to use x11 forwarding & xquartz to test this) and im running into this error now:
|
That looks like a driver issue Also, have you gotten napari to work via X11 and xquartz? I always get OpenGL issue and blank screen. |
OpenGL does not work well with x11 screen forwarding. To use napari remote, I use nomachine/anydesk. |
Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com>
for more information, see https://pre-commit.ci
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/error-running-napari-on-hpc-could-not-load-qt-platform-plugins/92012/10 |
…#6652) # Description In #6411, we missed these lines: https://github.com/napari/napari/blob/4f4c063ae5dd79d6d188e201d44b8d57eba71909/napari/_vispy/layers/image.py#L25-L32 These were added in #3990 because 'auto' has a slightly different meaning in VisPy than *really* fully auto: it chooses the default texture dtype for the input NumPy array's dtype. For float arrays, this is float. However, if your OpenGL implementation doesn't support float textures, VisPy will raise. Instead, passing `texture_format=None` when creating the ImageNode tells VisPy to transform the data to whatever texture format it sees fit. In #6411, when getting the VisPy node for a given dtype, we only check for `texture_format != 'auto'` as the "catch-all" texture format. But, in fact, if we are on a machine that doesn't support float32 textures, by this point in the code the format has been changed to None, incorrectly triggering these lines: https://github.com/napari/napari/blob/89f8194d3fa4eef620755804806ac69ef684df63/napari/_vispy/layers/image.py#L59-L73 and causing a ValueError. This PR fixes that by also checking for None in that same clause. This PR also adds a test by monkeypatching the function that checks for float32 texture support. # References #3988 #3990 --------- Co-authored-by: Juan Nunez-Iglesias <jni@fastmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
In #6411, we missed these lines:
napari/napari/_vispy/layers/image.py
Lines 25 to 32 in 4f4c063
These were added in #3990 because 'auto' has a slightly different meaning in VisPy than really fully auto: it chooses the default texture dtype for the input NumPy array's dtype. For float arrays, this is float. However, if your OpenGL implementation doesn't support float textures, VisPy will raise.
Instead, passing
texture_format=None
when creating the ImageNode tells VisPy to transform the data to whatever texture format it sees fit.In #6411, when getting the VisPy node for a given dtype, we only check for
texture_format != 'auto'
as the "catch-all" texture format. But, in fact, if we are on a machine that doesn't support float32 textures, by this point in the code the format has been changed to None, incorrectly triggering these lines:napari/napari/_vispy/layers/image.py
Lines 59 to 73 in 89f8194
and causing a ValueError.
This PR fixes that by also checking for None in that same clause.
This PR also adds a test by monkeypatching the function that checks for float32 texture support.
References
#3988
#3990