napari / napari

napari: a fast, interactive, multi-dimensional image viewer for python
https://napari.org
BSD 3-Clause "New" or "Revised" License
2.21k stars 422 forks source link

Crash when switching to 3D #4899

Closed AlexSauer closed 2 years ago

AlexSauer commented 2 years ago

🐛 Bug

To Reproduce

Steps to reproduce the behavior:

  1. Installed a new and clean environment and installed napari from conda (see below)
  2. I try to run the following code:
import numpy as np
import napari

base = np.linspace(-2, 2, 100)
x, y, z = np.meshgrid(base, base, base)
ball = np.sqrt(x**2 + y**2 + z**2) < 1
napari.view_image(ball)
napari.run()
  1. Napari opens and the 2D view look fine, however when I switch to 3D rendering I get the following error:
WARNING: Error drawing visual <Volume at 0x7fe690ef7af0>
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/app/backends/_qt.py:903, in CanvasBackendDesktop.paintGL(self=<vispy.app.backends._qt.CanvasBackendDesktop object>)
    901 # (0, 0, self.width(), self.height()))
    902 self._vispy_canvas.set_current()
--> 903 self._vispy_canvas.events.draw(region=None)
        self._vispy_canvas = <VispyCanvas (PyQt5) at 0x7fe6aba82800>
        self._vispy_canvas.events.draw = <vispy.util.event.EventEmitter object at 0x7fe6abaa5b40>
        self = <vispy.app.backends._qt.CanvasBackendDesktop object at 0x7fe6abab0820>
        self._vispy_canvas.events = <vispy.util.event.EmitterGroup object at 0x7fe6abaa5ae0>
    905 # Clear the alpha channel with QOpenGLWidget (Qt >= 5.4), otherwise the
    906 # window is translucent behind non-opaque objects.
    907 # Reference:  MRtrix3/mrtrix3#266
    908 if QT5_NEW_API or PYSIDE6_API or PYQT6_API:

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:453, in EventEmitter.__call__(self=<vispy.util.event.EventEmitter object>, *args=(), **kwargs={'region': None})
    450 if self._emitting > 1:
    451     raise RuntimeError('EventEmitter loop detected!')
--> 453 self._invoke_callback(cb, event)
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
        self = <vispy.util.event.EventEmitter object at 0x7fe6abaa5b40>
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>
    454 if event.blocked:
    455     break

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:471, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5)>>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    469     cb(event)
    470 except Exception:
--> 471     _handle_exception(self.ignore_callback_errors,
        self = <vispy.util.event.EventEmitter object at 0x7fe6abaa5b40>
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
        (cb, event) = (<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>, <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    472                       self.print_callback_errors,
    473                       self, cb_event=(cb, event))

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:469, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5)>>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    467 def _invoke_callback(self, cb, event):
    468     try:
--> 469         cb(event)
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
    470     except Exception:
    471         _handle_exception(self.ignore_callback_errors,
    472                           self.print_callback_errors,
    473                           self, cb_event=(cb, event))

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:218, in SceneCanvas.on_draw(self=<VispyCanvas (PyQt5)>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    215 # Now that a draw event is going to be handled, open up the
    216 # scheduling of further updates
    217 self._update_pending = False
--> 218 self._draw_scene()
        self = <VispyCanvas (PyQt5) at 0x7fe6aba82800>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:277, in SceneCanvas._draw_scene(self=<VispyCanvas (PyQt5)>, bgcolor=<class 'numpy.ndarray'> (4,) float32)
    275     bgcolor = self._bgcolor
    276 self.context.clear(color=bgcolor, depth=True)
--> 277 self.draw_visual(self.scene)
        self = <VispyCanvas (PyQt5) at 0x7fe6aba82800>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:315, in SceneCanvas.draw_visual(self=<VispyCanvas (PyQt5)>, visual=<SubScene>, event=None)
    313         else:
    314             if hasattr(node, 'draw'):
--> 315                 node.draw()
        node = <Volume at 0x7fe690ef7af0>
    316                 prof.mark(str(node))
    317 else:

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/visuals.py:103, in VisualNode.draw(self=<Volume>)
    101 if self.picking and not self.interactive:
    102     return
--> 103 self._visual_superclass.draw(self)
        self = <Volume at 0x7fe690ef7af0>
        self._visual_superclass = <class 'vispy.visuals.volume.VolumeVisual'>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/visuals/visual.py:451, in Visual.draw(self=<Volume>)
    449 self._configure_gl_state()
    450 try:
--> 451     self._program.draw(self._vshare.draw_mode,
        self._vshare.draw_mode = 'triangle_strip'
        self = <Volume at 0x7fe690ef7af0>
        self._vshare = <vispy.visuals.visual.VisualShare object at 0x7fe6911527d0>
        self._program = <vispy.visuals.shaders.program.ModularProgram object at 0x7fe69117db10>
        self._vshare.index_buffer = <IndexBuffer size=14 last_dim=1>
    452                        self._vshare.index_buffer)
    453 except Exception:
    454     logger.warning("Error drawing visual %r" % self)

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/visuals/shaders/program.py:102, in ModularProgram.draw(self=<vispy.visuals.shaders.program.ModularProgram object>, *args=('triangle_strip', <IndexBuffer size=14 last_dim=1>), **kwargs={})
    100 self.build_if_needed()
    101 self.update_variables()
--> 102 Program.draw(self, *args, **kwargs)
        self = <vispy.visuals.shaders.program.ModularProgram object at 0x7fe69117db10>
        args = ('triangle_strip', <IndexBuffer size=14 last_dim=1>)
        kwargs = {}

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/program.py:526, in Program.draw(self=<vispy.visuals.shaders.program.ModularProgram object>, mode='triangle_strip', indices=<IndexBuffer size=14 last_dim=1>, check_error=True)
    522     raise TypeError("Invalid index: %r (must be IndexBuffer)" %
    523                     indices)
    525 # Process GLIR commands
--> 526 canvas.context.flush_commands()
        canvas = <VispyCanvas (PyQt5) at 0x7fe6aba82800>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/context.py:172, in GLContext.flush_commands(self=<GLContext>, event=None)
    170         fbo = 0
    171     self.shared.parser.parse([('CURRENT', 0, fbo)])
--> 172 self.glir.flush(self.shared.parser)
        self = <GLContext at 0x7fe6abaa5ab0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:582, in GlirQueue.flush(self=<vispy.gloo.glir.GlirQueue object>, parser=<vispy.gloo.glir.GlirParser object>)
    580 def flush(self, parser):
    581     """Flush all current commands to the GLIR interpreter."""
--> 582     self._shared.flush(parser)
        parser = <vispy.gloo.glir.GlirParser object at 0x7fe6abaa5e10>
        self._shared = <vispy.gloo.glir._GlirQueueShare object at 0x7fe6abaa5ed0>
        self = <vispy.gloo.glir.GlirQueue object at 0x7fe6abaa5ea0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:504, in _GlirQueueShare.flush(self=<vispy.gloo.glir._GlirQueueShare object>, parser=<vispy.gloo.glir.GlirParser object>)
    502     show = self._verbose if isinstance(self._verbose, str) else None
    503     self.show(show)
--> 504 parser.parse(self._filter(self.clear(), parser))
        self = <vispy.gloo.glir._GlirQueueShare object at 0x7fe6abaa5ed0>
        parser = <vispy.gloo.glir.GlirParser object at 0x7fe6abaa5e10>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:822, in GlirParser.parse(self=<vispy.gloo.glir.GlirParser object>, commands=[('FUNC', 'glViewport', 0, 0, 1632, 1340), ('FUNC', 'glClearColor', 0.0, 0.0, 0.0, 1.0), ('FUNC', 'glClear', 17664), ('FUNC', 'glDisable', 'cull_face'), ('FUNC', 'glEnable', 'depth_test'), ('FUNC', 'glEnable', 'blend'), ('FUNC', 'glBlendFuncSeparate', 'src_alpha', 'one_minus_src_alpha', 'zero', 'one'), ('FUNC', 'glBlendEquationSeparate', 'func_add', 'func_add'), ('CREATE', 43, 'Program'), ('CREATE', 54, 'VertexShader'), ('DATA', 54, 0, 'uniform mat4 u_matrix;\n\nvec4 affine_transform_ma...ransform_map_chain_11(vec4(v_position, 1.0));\n}\n\n'), ('ATTACH', 43, 54), ('CREATE', 55, 'FragmentShader'), ('DATA', 55, 0, 'uniform mat4 u_matrix;\n\nvec4 affine_transform_ma...)/2.0;\n\n    apply_alpha();\npicking_filter();\n\n}\n\n'), ('ATTACH', 43, 55), ('LINK', 43), ('DELETE', 54), ('DELETE', 55), ('UNIFORM', 43, 'u_alpha', 'float', <class 'numpy.ndarray'> (1,) float32), ('UNIFORM', 43, 'u_enabled', 'int', <class 'numpy.ndarray'> (1,) int32), ...])
    819     self._objects.pop(id_)
    821 for command in commands:
--> 822     self._parse(command)
        command = ('DATA', 55, 0, 'uniform mat4 u_matrix;\n\nvec4 affine_transform_map(vec4 pos) {\n    return u_matrix * pos;\n}\n\n\nvec4 transform_map_chain(vec4 pos) {\n    vec4 result_1 = affine_transform_map(pos);\n    return result_1;\n}\n\nvec4 transform_map_chain_1(vec4 pos) {\n    vec4 result_1 = transform_map_chain(pos);\n    return result_1;\n}\n\nuniform mat4 u_inv_matrix;\n\nvec4 affine_transform_imap(vec4 pos) {\n    return u_inv_matrix * pos;\n}\n\n\nvec4 transform_imap_chain(vec4 pos) {\n    vec4 result_1 = affine_transform_imap(pos);\n    return result_1;\n}\n\nuniform mat4 u_matrix_1;\n\nvec4 affine_transform_map_1(vec4 pos) {\n    return u_matrix_1 * pos;\n}\n\n\nuniform vec4 u_scale;\nuniform vec4 u_translate;\n\nvec4 st_transform_map(vec4 pos) {\n    return vec4(pos.xyz * u_scale.xyz + u_translate.xyz * pos.w, pos.w);\n}\n\n\nvec4 transform_map_chain_2(vec4 pos) {\n    vec4 result_1 = transform_imap_chain(pos);\n    vec4 result_2 = affine_transform_map_1(result_1);\n    vec4 result_3 = st_transform_map(result_2);\n    return result_3;\n}\n\nuniform vec4 u_scale_1;\nuniform vec4 u_translate_1;\n\nvec4 st_transform_map_1(vec4 pos) {\n    return vec4(pos.xyz * u_scale_1.xyz + u_translate_1.xyz * pos.w, pos.w);\n}\n\n\nuniform vec4 u_scale_2;\nuniform vec4 u_translate_2;\n\nvec4 st_transform_map_2(vec4 pos) {\n    return vec4(pos.xyz * u_scale_2.xyz + u_translate_2.xyz * pos.w, pos.w);\n}\n\n\nvec4 transform_map_chain_3(vec4 pos) {\n    vec4 result_1 = transform_map_chain_2(pos);\n    vec4 result_2 = st_transform_map_1(result_1);\n    vec4 result_3 = st_transform_map_2(result_2);\n    return result_3;\n}\n\nvec4 transform_map_chain_4(vec4 pos) {\n    vec4 result_1 = transform_map_chain_3(pos);\n    return result_1;\n}\n\nvec4 transform_map_chain_12(vec4 pos) {\n    vec4 result_1 = transform_map_chain_1(pos);\n    vec4 result_2 = transform_map_chain_4(result_1);\n    return result_2;\n}\n\nuniform float u_alpha;\n\nvoid apply_alpha() {\n    gl_FragColor.a = gl_FragColor.a * u_alpha;\n}\n\n\nuniform vec4 u_id_color;\nuniform int u_enabled;\n\nvoid picking_filter() {\n    if( u_enabled == 0 )\n        return;\n    if( gl_FragColor.a == 0.0 )\n        discard;\n    gl_FragColor = u_id_color;\n}\n\n\nvec4 null_transform_map(vec4 pos) {return pos;}\n\nuniform vec4 u_view;\n\nvoid clip() {\n    vec4 pos = null_transform_map(gl_FragCoord);\n    if( pos.x < u_view.x || pos.x > u_view.y ||\n        pos.y < u_view.z || pos.y > u_view.w ) {\n        discard;\n    }\n}\n\n\nvec4 transform_map_chain_14(vec4 pos) {\n    vec4 result_1 = transform_map_chain_1(pos);\n    return result_1;\n}\n\n\nfloat clip_planes(vec3 loc, vec3 vol_shape) {\n    vec3 loc_transf = transform_map_chain_14(vec4(loc * vol_shape, 1)).xyz;\n    float distance_from_clip = 3.4e38; // max float\n    ;\n    return distance_from_clip;\n}\n\n\nuniform sampler2D texture2D_LUT;\nvec4 colormap(float t) {\n{\n return texture2D(texture2D_LUT,           vec2(0.0, clamp(t, 0.0, 1.0)));\n} \n}\n\nuniform sampler3D u_texture;\n\nvec4 texture_lookup(vec3 texcoord) {\n    // no need to discard out of bounds, already checked during raycasting\n    return texture3D(u_texture, texcoord);\n}\n\n\n// uniforms\nuniform sampler3D u_volumetex;\nuniform vec3 u_shape;\nuniform vec2 clim;\nuniform float gamma;\nuniform float u_threshold;\nuniform float u_attenuation;\nuniform float u_relative_step_size;\nuniform float u_mip_cutoff;\nuniform float u_minip_cutoff;\n\n//varyings\nvarying vec3 v_position;\nvarying vec4 v_nearpos;\nvarying vec4 v_farpos;\n\n// uniforms for lighting. Hard coded until we figure out how to do lights\nconst vec4 u_ambient = vec4(0.2, 0.2, 0.2, 1.0);\nconst vec4 u_diffuse = vec4(0.8, 0.2, 0.2, 1.0);\nconst vec4 u_specular = vec4(1.0, 1.0, 1.0, 1.0);\nconst float u_shininess = 40.0;\n\n// uniforms for plane definition. Defined in data coordinates.\nuniform vec3 u_plane_normal;\nuniform vec3 u_plane_position;\nuniform float u_plane_thickness;\n\n//varying vec3 lightDirs[1];\n\n// global holding view direction in local coordinates\nvec3 view_ray;\n\nfloat rand(vec2 co)\n{\n    // Create a pseudo-random number between 0 and 1.\n    // http://stackoverflow.com/questions/4200224\n    return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat colorToVal(vec4 color1)\n{\n    return color1.r; // todo: why did I have this abstraction in visvis?\n}\n\nvec4 applyColormap(float data) {\n    data = clamp(data, min(clim.x, clim.y), max(clim.x, clim.y));\n    data = (data - clim.x) / (clim.y - clim.x);\n    vec4 color = colormap(pow(data, gamma));\n    return color;\n}\n\n\nvec4 calculateColor(vec4 betterColor, vec3 loc, vec3 step)\n{   \n    // Calculate color by incorporating lighting\n    vec4 color1;\n    vec4 color2;\n\n    // View direction\n    vec3 V = normalize(view_ray);\n\n    // calculate normal vector from gradient\n    vec3 N; // normal\n    color1 = texture_lookup(loc+vec3(-step[0],0.0,0.0) );\n    color2 = texture_lookup(loc+vec3(step[0],0.0,0.0) );\n    N[0] = colorToVal(color1) - colorToVal(color2);\n    betterColor = max(max(color1, color2),betterColor);\n    color1 = texture_lookup(loc+vec3(0.0,-step[1],0.0) );\n    color2 = texture_lookup(loc+vec3(0.0,step[1],0.0) );\n    N[1] = colorToVal(color1) - colorToVal(color2);\n    betterColor = max(max(color1, color2),betterColor);\n    color1 = texture_lookup(loc+vec3(0.0,0.0,-step[2]) );\n    color2 = texture_lookup(loc+vec3(0.0,0.0,step[2]) );\n    N[2] = colorToVal(color1) - colorToVal(color2);\n    betterColor = max(max(color1, color2),betterColor);\n    float gm = length(N); // gradient magnitude\n    N = normalize(N);\n\n    // Flip normal so it points towards viewer\n    float Nselect = float(dot(N,V) > 0.0);\n    N = (2.0*Nselect - 1.0) * N;  // ==  Nselect * N - (1.0-Nselect)*N;\n\n    // Get color of the texture (albeido)\n    color1 = betterColor;\n    color2 = color1;\n    // todo: parametrise color1_to_color2\n\n    // Init colors\n    vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 final_color;\n\n    // todo: allow multiple light, define lights on viewvox or subscene\n    int nlights = 1; \n    for (int i=0; i<nlights; i++)\n    { \n        // Get light direction (make sure to prevent zero devision)\n        vec3 L = normalize(view_ray);  //lightDirs[i]; \n        float lightEnabled = float( length(L) > 0.0 );\n        L = normalize(L+(1.0-lightEnabled));\n\n        // Calculate lighting properties\n        float lambertTerm = clamp( dot(N,L), 0.0, 1.0 );\n        vec3 H = normalize(L+V); // Halfway vector\n        float specularTerm = pow( max(dot(H,N),0.0), u_shininess);\n\n        // Calculate mask\n        float mask1 = lightEnabled;\n\n        // Calculate colors\n        ambient_color +=  mask1 * u_ambient;  // * gl_LightSource[i].ambient;\n        diffuse_color +=  mask1 * lambertTerm;\n        specular_color += mask1 * specularTerm * u_specular;\n    }\n\n    // Calculate final color by componing different components\n    final_color = color2 * ( ambient_color + diffuse_color) + specular_color;\n    final_color.a = color2.a;\n\n    // Done\n    return final_color;\n}\n\n\nvec3 intersectLinePlane(vec3 linePosition, \n                        vec3 lineVector, \n                        vec3 planePosition, \n                        vec3 planeNormal) {\n    // function to find the intersection between a line and a plane\n    // line is defined by position and vector\n    // plane is defined by position and normal vector\n    // https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection\n\n    // find scale factor for line vector\n    float scaleFactor = dot(planePosition - linePosition, planeNormal) / \n                        dot(lineVector, planeNormal);\n\n    // calculate intersection\n    return linePosition + ( scaleFactor * lineVector );\n}\n\n// for some reason, this has to be the last function in order for the\n// filters to be inserted in the correct place...\n\n\n// the tolerance for testing equality of floats with floatEqual and floatNotEqual\nconst float equality_tolerance = 1e-8;\n\nbool floatNotEqual(float val1, float val2)\n{\n    // check if val1 and val2 are not equal\n    bool not_equal = abs(val1 - val2) > equality_tolerance;\n\n    return not_equal;\n}\n\nbool floatEqual(float val1, float val2)\n{\n    // check if val1 and val2 are equal\n    bool equal = abs(val1 - val2) < equality_tolerance;\n\n    return equal;\n}\n\n\n// the background value for the iso_categorical shader\nconst float categorical_bg_value = 0;\n\nint detectAdjacentBackground(float val_neg, float val_pos)\n{\n    // determine if the adjacent voxels along an axis are both background\n    int adjacent_bg = int( floatEqual(val_neg, categorical_bg_value) );\n    adjacent_bg = adjacent_bg * int( floatEqual(val_pos, categorical_bg_value) );\n    return adjacent_bg;\n}\n\nvec4 calculateCategoricalColor(vec4 betterColor, vec3 loc, vec3 step)\n{\n    // Calculate color by incorporating ambient and diffuse lighting\n    vec4 color0 = $sample(u_volumetex, loc);\n    vec4 color1;\n    vec4 color2;\n    float val0 = colorToVal(color0);\n    float val1 = 0;\n    float val2 = 0;\n    int n_bg_borders = 0;\n\n    // View direction\n    vec3 V = normalize(view_ray);\n\n    // calculate normal vector from gradient\n    vec3 N; // normal\n    color1 = $sample( u_volumetex, loc+vec3(-step[0],0.0,0.0) );\n    color2 = $sample( u_volumetex, loc+vec3(step[0],0.0,0.0) );\n    val1 = colorToVal(color1);\n    val2 = colorToVal(color2);\n    N[0] = val1 - val2;\n    n_bg_borders += detectAdjacentBackground(val1, val2);\n\n    color1 = $sample( u_volumetex, loc+vec3(0.0,-step[1],0.0) );\n    color2 = $sample( u_volumetex, loc+vec3(0.0,step[1],0.0) );\n    val1 = colorToVal(color1);\n    val2 = colorToVal(color2);\n    N[1] = val1 - val2;\n    n_bg_borders += detectAdjacentBackground(val1, val2);\n\n    color1 = $sample( u_volumetex, loc+vec3(0.0,0.0,-step[2]) );\n    color2 = $sample( u_volumetex, loc+vec3(0.0,0.0,step[2]) );\n    val1 = colorToVal(color1);\n    val2 = colorToVal(color2);\n    N[2] = val1 - val2;\n    n_bg_borders += detectAdjacentBackground(val1, val2);\n\n    // Normalize and flip normal so it points towards viewer\n    N = normalize(N);\n    float Nselect = float(dot(N,V) > 0.0);\n    N = (2.0*Nselect - 1.0) * N;  // ==  Nselect * N - (1.0-Nselect)*N;\n\n    // Init colors\n    vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 final_color;\n\n    // todo: allow multiple light, define lights on viewvox or subscene\n    int nlights = 1;\n    for (int i=0; i<nlights; i++)\n    {\n        // Get light direction (make sure to prevent zero devision)\n        vec3 L = normalize(view_ray);  //lightDirs[i];\n        float lightEnabled = float( length(L) > 0.0 );\n        L = normalize(L+(1.0-lightEnabled));\n\n        // Calculate lighting properties\n        float lambertTerm = clamp( dot(N,L), 0.0, 1.0 );\n        if (n_bg_borders > 0) {\n            // to fix dim pixels due to poor normal estimation,\n            // we give a default lambda to pixels surrounded by background\n            lambertTerm = 0.5;\n        }\n\n        // Calculate mask\n        float mask1 = lightEnabled;\n\n        // Calculate colors\n        ambient_color +=  mask1 * u_ambient;  // * gl_LightSource[i].ambient;\n        diffuse_color +=  mask1 * lambertTerm;\n    }\n\n    // Calculate final color by componing different components\n    final_color = betterColor * ( ambient_color + diffuse_color);\n    final_color.a = betterColor.a;\n\n    // Done\n    return final_color;\n}\nvoid main() {\n    clip();\n\n\n    vec3 farpos = v_farpos.xyz / v_farpos.w;\n    vec3 nearpos = v_nearpos.xyz / v_nearpos.w;\n\n    // Calculate unit vector pointing in the view direction through this\n    // fragment.\n    view_ray = normalize(farpos.xyz - nearpos.xyz);\n\n    // Variables to keep track of where to set the frag depth.\n    // frag_depth_point is in data coordinates.\n    vec3 frag_depth_point;\n\n    // Set up the ray casting\n    // This snippet must define three variables:\n    // vec3 start_loc - the starting location of the ray in texture coordinates\n    // vec3 step - the step vector in texture coordinates\n    // int nsteps - the number of steps to make through the texture\n    \n    \n    // Compute the distance to the front surface or near clipping plane\n    float distance = dot(nearpos-v_position, view_ray);\n    distance = max(distance, min((-0.5 - v_position.x) / view_ray.x,\n                            (u_shape.x - 0.5 - v_position.x) / view_ray.x));\n    distance = max(distance, min((-0.5 - v_position.y) / view_ray.y,\n                            (u_shape.y - 0.5 - v_position.y) / view_ray.y));\n    distance = max(distance, min((-0.5 - v_position.z) / view_ray.z,\n                            (u_shape.z - 0.5 - v_position.z) / view_ray.z));\n\n    // Now we have the starting position on the front surface\n    vec3 front = v_position + view_ray * distance;\n\n    // Decide how many steps to take\n    int nsteps = int(-distance / u_relative_step_size + 0.5);\n    float f_nsteps = float(nsteps);\n    if( nsteps < 1 )\n        discard;\n\n    // Get starting location and step vector in texture coordinates\n    vec3 step = ((v_position - front) / u_shape) / f_nsteps;\n    // 0.5 offset needed to get back to correct texture coordinates (vispy#2239)\n    vec3 start_loc = (front + 0.5) / u_shape;\n\n    // set frag depth to the cube face; this can be overridden by projection snippets\n    frag_depth_point = front;\n\n\n    // For testing: show the number of steps. This helps to establish\n    // whether the rays are correctly oriented\n    //gl_FragColor = vec4(0.0, f_nsteps / 3.0 / u_shape.x, 1.0, 1.0);\n    //return;\n\n    \n        float maxval = u_mip_cutoff; // The maximum encountered value\n        int maxi = -1;  // Where the maximum value was encountered\n        \n\n    // This outer loop seems necessary on some systems for large\n    // datasets. Ugly, but it works ...\n    vec3 loc = start_loc;\n    int iter = 0;\n\n    // keep track if the texture is ever sampled; if not, fragment will be discarded\n    // this allows us to discard fragments that only traverse clipped parts of the texture\n    bool texture_sampled = false;\n\n    while (iter < nsteps) {\n        for (iter=iter; iter<nsteps; iter++)\n        {\n            // Only sample volume if loc is not clipped by clipping planes\n            float distance_from_clip = clip_planes(loc, u_shape);\n            if (distance_from_clip >= 0)\n            {\n                // Get sample color\n                vec4 color = texture_lookup(loc);\n                float val = color.r;\n                texture_sampled = true;\n\n                \n        if( val > maxval ) {\n            maxval = val;\n            maxi = iter;\n        }\n        \n            }\n            // Advance location deeper into the volume\n            loc += step;\n        }\n    }\n\n    if (!texture_sampled)\n        discard;\n\n    \n        // Refine search for max value, but only if anything was found\n        if ( maxi > -1 ) {\n            // Calculate starting location of ray for sampling\n            vec3 start_loc_refine = start_loc + step * (float(maxi) - 0.5);\n            loc = start_loc_refine;\n\n            // Variables to keep track of current value and where max was encountered\n            vec3 max_loc_tex = start_loc_refine;\n\n            vec3 small_step = step * 0.1;\n            for (int i=0; i<10; i++) {\n                float val = texture_lookup(loc).r;\n                if ( val > maxval) {\n                    maxval = val;\n                    max_loc_tex = start_loc_refine + (small_step * i);\n                }\n                loc += small_step;\n            }\n            frag_depth_point = max_loc_tex * u_shape;\n            gl_FragColor = applyColormap(maxval);\n        }\n        else {\n            discard;\n        }\n        \n\n    // set frag depth\n    vec4 frag_depth_vector = vec4(frag_depth_point, 1);\n    vec4 iproj = transform_map_chain_12(frag_depth_vector);\n    iproj.z /= iproj.w;\n    gl_FragDepth = (iproj.z+1.0)/2.0;\n\n    apply_alpha();\npicking_filter();\n\n}\n\n')
        self = <vispy.gloo.glir.GlirParser object at 0x7fe6abaa5e10>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:792, in GlirParser._parse(self=<vispy.gloo.glir.GlirParser object>, command=('DATA', 55, 0, 'uniform mat4 u_matrix;\n\nvec4 affine_transform_ma...)/2.0;\n\n    apply_alpha();\npicking_filter();\n\n}\n\n'))
    790     ob.set_attribute(*args)
    791 elif cmd == 'DATA':  # VertexBuffer, IndexBuffer, Texture, Shader
--> 792     ob.set_data(*args)
        args = (0, 'uniform mat4 u_matrix;\n\nvec4 affine_transform_map(vec4 pos) {\n    return u_matrix * pos;\n}\n\n\nvec4 transform_map_chain(vec4 pos) {\n    vec4 result_1 = affine_transform_map(pos);\n    return result_1;\n}\n\nvec4 transform_map_chain_1(vec4 pos) {\n    vec4 result_1 = transform_map_chain(pos);\n    return result_1;\n}\n\nuniform mat4 u_inv_matrix;\n\nvec4 affine_transform_imap(vec4 pos) {\n    return u_inv_matrix * pos;\n}\n\n\nvec4 transform_imap_chain(vec4 pos) {\n    vec4 result_1 = affine_transform_imap(pos);\n    return result_1;\n}\n\nuniform mat4 u_matrix_1;\n\nvec4 affine_transform_map_1(vec4 pos) {\n    return u_matrix_1 * pos;\n}\n\n\nuniform vec4 u_scale;\nuniform vec4 u_translate;\n\nvec4 st_transform_map(vec4 pos) {\n    return vec4(pos.xyz * u_scale.xyz + u_translate.xyz * pos.w, pos.w);\n}\n\n\nvec4 transform_map_chain_2(vec4 pos) {\n    vec4 result_1 = transform_imap_chain(pos);\n    vec4 result_2 = affine_transform_map_1(result_1);\n    vec4 result_3 = st_transform_map(result_2);\n    return result_3;\n}\n\nuniform vec4 u_scale_1;\nuniform vec4 u_translate_1;\n\nvec4 st_transform_map_1(vec4 pos) {\n    return vec4(pos.xyz * u_scale_1.xyz + u_translate_1.xyz * pos.w, pos.w);\n}\n\n\nuniform vec4 u_scale_2;\nuniform vec4 u_translate_2;\n\nvec4 st_transform_map_2(vec4 pos) {\n    return vec4(pos.xyz * u_scale_2.xyz + u_translate_2.xyz * pos.w, pos.w);\n}\n\n\nvec4 transform_map_chain_3(vec4 pos) {\n    vec4 result_1 = transform_map_chain_2(pos);\n    vec4 result_2 = st_transform_map_1(result_1);\n    vec4 result_3 = st_transform_map_2(result_2);\n    return result_3;\n}\n\nvec4 transform_map_chain_4(vec4 pos) {\n    vec4 result_1 = transform_map_chain_3(pos);\n    return result_1;\n}\n\nvec4 transform_map_chain_12(vec4 pos) {\n    vec4 result_1 = transform_map_chain_1(pos);\n    vec4 result_2 = transform_map_chain_4(result_1);\n    return result_2;\n}\n\nuniform float u_alpha;\n\nvoid apply_alpha() {\n    gl_FragColor.a = gl_FragColor.a * u_alpha;\n}\n\n\nuniform vec4 u_id_color;\nuniform int u_enabled;\n\nvoid picking_filter() {\n    if( u_enabled == 0 )\n        return;\n    if( gl_FragColor.a == 0.0 )\n        discard;\n    gl_FragColor = u_id_color;\n}\n\n\nvec4 null_transform_map(vec4 pos) {return pos;}\n\nuniform vec4 u_view;\n\nvoid clip() {\n    vec4 pos = null_transform_map(gl_FragCoord);\n    if( pos.x < u_view.x || pos.x > u_view.y ||\n        pos.y < u_view.z || pos.y > u_view.w ) {\n        discard;\n    }\n}\n\n\nvec4 transform_map_chain_14(vec4 pos) {\n    vec4 result_1 = transform_map_chain_1(pos);\n    return result_1;\n}\n\n\nfloat clip_planes(vec3 loc, vec3 vol_shape) {\n    vec3 loc_transf = transform_map_chain_14(vec4(loc * vol_shape, 1)).xyz;\n    float distance_from_clip = 3.4e38; // max float\n    ;\n    return distance_from_clip;\n}\n\n\nuniform sampler2D texture2D_LUT;\nvec4 colormap(float t) {\n{\n return texture2D(texture2D_LUT,           vec2(0.0, clamp(t, 0.0, 1.0)));\n} \n}\n\nuniform sampler3D u_texture;\n\nvec4 texture_lookup(vec3 texcoord) {\n    // no need to discard out of bounds, already checked during raycasting\n    return texture3D(u_texture, texcoord);\n}\n\n\n// uniforms\nuniform sampler3D u_volumetex;\nuniform vec3 u_shape;\nuniform vec2 clim;\nuniform float gamma;\nuniform float u_threshold;\nuniform float u_attenuation;\nuniform float u_relative_step_size;\nuniform float u_mip_cutoff;\nuniform float u_minip_cutoff;\n\n//varyings\nvarying vec3 v_position;\nvarying vec4 v_nearpos;\nvarying vec4 v_farpos;\n\n// uniforms for lighting. Hard coded until we figure out how to do lights\nconst vec4 u_ambient = vec4(0.2, 0.2, 0.2, 1.0);\nconst vec4 u_diffuse = vec4(0.8, 0.2, 0.2, 1.0);\nconst vec4 u_specular = vec4(1.0, 1.0, 1.0, 1.0);\nconst float u_shininess = 40.0;\n\n// uniforms for plane definition. Defined in data coordinates.\nuniform vec3 u_plane_normal;\nuniform vec3 u_plane_position;\nuniform float u_plane_thickness;\n\n//varying vec3 lightDirs[1];\n\n// global holding view direction in local coordinates\nvec3 view_ray;\n\nfloat rand(vec2 co)\n{\n    // Create a pseudo-random number between 0 and 1.\n    // http://stackoverflow.com/questions/4200224\n    return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nfloat colorToVal(vec4 color1)\n{\n    return color1.r; // todo: why did I have this abstraction in visvis?\n}\n\nvec4 applyColormap(float data) {\n    data = clamp(data, min(clim.x, clim.y), max(clim.x, clim.y));\n    data = (data - clim.x) / (clim.y - clim.x);\n    vec4 color = colormap(pow(data, gamma));\n    return color;\n}\n\n\nvec4 calculateColor(vec4 betterColor, vec3 loc, vec3 step)\n{   \n    // Calculate color by incorporating lighting\n    vec4 color1;\n    vec4 color2;\n\n    // View direction\n    vec3 V = normalize(view_ray);\n\n    // calculate normal vector from gradient\n    vec3 N; // normal\n    color1 = texture_lookup(loc+vec3(-step[0],0.0,0.0) );\n    color2 = texture_lookup(loc+vec3(step[0],0.0,0.0) );\n    N[0] = colorToVal(color1) - colorToVal(color2);\n    betterColor = max(max(color1, color2),betterColor);\n    color1 = texture_lookup(loc+vec3(0.0,-step[1],0.0) );\n    color2 = texture_lookup(loc+vec3(0.0,step[1],0.0) );\n    N[1] = colorToVal(color1) - colorToVal(color2);\n    betterColor = max(max(color1, color2),betterColor);\n    color1 = texture_lookup(loc+vec3(0.0,0.0,-step[2]) );\n    color2 = texture_lookup(loc+vec3(0.0,0.0,step[2]) );\n    N[2] = colorToVal(color1) - colorToVal(color2);\n    betterColor = max(max(color1, color2),betterColor);\n    float gm = length(N); // gradient magnitude\n    N = normalize(N);\n\n    // Flip normal so it points towards viewer\n    float Nselect = float(dot(N,V) > 0.0);\n    N = (2.0*Nselect - 1.0) * N;  // ==  Nselect * N - (1.0-Nselect)*N;\n\n    // Get color of the texture (albeido)\n    color1 = betterColor;\n    color2 = color1;\n    // todo: parametrise color1_to_color2\n\n    // Init colors\n    vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 specular_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 final_color;\n\n    // todo: allow multiple light, define lights on viewvox or subscene\n    int nlights = 1; \n    for (int i=0; i<nlights; i++)\n    { \n        // Get light direction (make sure to prevent zero devision)\n        vec3 L = normalize(view_ray);  //lightDirs[i]; \n        float lightEnabled = float( length(L) > 0.0 );\n        L = normalize(L+(1.0-lightEnabled));\n\n        // Calculate lighting properties\n        float lambertTerm = clamp( dot(N,L), 0.0, 1.0 );\n        vec3 H = normalize(L+V); // Halfway vector\n        float specularTerm = pow( max(dot(H,N),0.0), u_shininess);\n\n        // Calculate mask\n        float mask1 = lightEnabled;\n\n        // Calculate colors\n        ambient_color +=  mask1 * u_ambient;  // * gl_LightSource[i].ambient;\n        diffuse_color +=  mask1 * lambertTerm;\n        specular_color += mask1 * specularTerm * u_specular;\n    }\n\n    // Calculate final color by componing different components\n    final_color = color2 * ( ambient_color + diffuse_color) + specular_color;\n    final_color.a = color2.a;\n\n    // Done\n    return final_color;\n}\n\n\nvec3 intersectLinePlane(vec3 linePosition, \n                        vec3 lineVector, \n                        vec3 planePosition, \n                        vec3 planeNormal) {\n    // function to find the intersection between a line and a plane\n    // line is defined by position and vector\n    // plane is defined by position and normal vector\n    // https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection\n\n    // find scale factor for line vector\n    float scaleFactor = dot(planePosition - linePosition, planeNormal) / \n                        dot(lineVector, planeNormal);\n\n    // calculate intersection\n    return linePosition + ( scaleFactor * lineVector );\n}\n\n// for some reason, this has to be the last function in order for the\n// filters to be inserted in the correct place...\n\n\n// the tolerance for testing equality of floats with floatEqual and floatNotEqual\nconst float equality_tolerance = 1e-8;\n\nbool floatNotEqual(float val1, float val2)\n{\n    // check if val1 and val2 are not equal\n    bool not_equal = abs(val1 - val2) > equality_tolerance;\n\n    return not_equal;\n}\n\nbool floatEqual(float val1, float val2)\n{\n    // check if val1 and val2 are equal\n    bool equal = abs(val1 - val2) < equality_tolerance;\n\n    return equal;\n}\n\n\n// the background value for the iso_categorical shader\nconst float categorical_bg_value = 0;\n\nint detectAdjacentBackground(float val_neg, float val_pos)\n{\n    // determine if the adjacent voxels along an axis are both background\n    int adjacent_bg = int( floatEqual(val_neg, categorical_bg_value) );\n    adjacent_bg = adjacent_bg * int( floatEqual(val_pos, categorical_bg_value) );\n    return adjacent_bg;\n}\n\nvec4 calculateCategoricalColor(vec4 betterColor, vec3 loc, vec3 step)\n{\n    // Calculate color by incorporating ambient and diffuse lighting\n    vec4 color0 = $sample(u_volumetex, loc);\n    vec4 color1;\n    vec4 color2;\n    float val0 = colorToVal(color0);\n    float val1 = 0;\n    float val2 = 0;\n    int n_bg_borders = 0;\n\n    // View direction\n    vec3 V = normalize(view_ray);\n\n    // calculate normal vector from gradient\n    vec3 N; // normal\n    color1 = $sample( u_volumetex, loc+vec3(-step[0],0.0,0.0) );\n    color2 = $sample( u_volumetex, loc+vec3(step[0],0.0,0.0) );\n    val1 = colorToVal(color1);\n    val2 = colorToVal(color2);\n    N[0] = val1 - val2;\n    n_bg_borders += detectAdjacentBackground(val1, val2);\n\n    color1 = $sample( u_volumetex, loc+vec3(0.0,-step[1],0.0) );\n    color2 = $sample( u_volumetex, loc+vec3(0.0,step[1],0.0) );\n    val1 = colorToVal(color1);\n    val2 = colorToVal(color2);\n    N[1] = val1 - val2;\n    n_bg_borders += detectAdjacentBackground(val1, val2);\n\n    color1 = $sample( u_volumetex, loc+vec3(0.0,0.0,-step[2]) );\n    color2 = $sample( u_volumetex, loc+vec3(0.0,0.0,step[2]) );\n    val1 = colorToVal(color1);\n    val2 = colorToVal(color2);\n    N[2] = val1 - val2;\n    n_bg_borders += detectAdjacentBackground(val1, val2);\n\n    // Normalize and flip normal so it points towards viewer\n    N = normalize(N);\n    float Nselect = float(dot(N,V) > 0.0);\n    N = (2.0*Nselect - 1.0) * N;  // ==  Nselect * N - (1.0-Nselect)*N;\n\n    // Init colors\n    vec4 ambient_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 diffuse_color = vec4(0.0, 0.0, 0.0, 0.0);\n    vec4 final_color;\n\n    // todo: allow multiple light, define lights on viewvox or subscene\n    int nlights = 1;\n    for (int i=0; i<nlights; i++)\n    {\n        // Get light direction (make sure to prevent zero devision)\n        vec3 L = normalize(view_ray);  //lightDirs[i];\n        float lightEnabled = float( length(L) > 0.0 );\n        L = normalize(L+(1.0-lightEnabled));\n\n        // Calculate lighting properties\n        float lambertTerm = clamp( dot(N,L), 0.0, 1.0 );\n        if (n_bg_borders > 0) {\n            // to fix dim pixels due to poor normal estimation,\n            // we give a default lambda to pixels surrounded by background\n            lambertTerm = 0.5;\n        }\n\n        // Calculate mask\n        float mask1 = lightEnabled;\n\n        // Calculate colors\n        ambient_color +=  mask1 * u_ambient;  // * gl_LightSource[i].ambient;\n        diffuse_color +=  mask1 * lambertTerm;\n    }\n\n    // Calculate final color by componing different components\n    final_color = betterColor * ( ambient_color + diffuse_color);\n    final_color.a = betterColor.a;\n\n    // Done\n    return final_color;\n}\nvoid main() {\n    clip();\n\n\n    vec3 farpos = v_farpos.xyz / v_farpos.w;\n    vec3 nearpos = v_nearpos.xyz / v_nearpos.w;\n\n    // Calculate unit vector pointing in the view direction through this\n    // fragment.\n    view_ray = normalize(farpos.xyz - nearpos.xyz);\n\n    // Variables to keep track of where to set the frag depth.\n    // frag_depth_point is in data coordinates.\n    vec3 frag_depth_point;\n\n    // Set up the ray casting\n    // This snippet must define three variables:\n    // vec3 start_loc - the starting location of the ray in texture coordinates\n    // vec3 step - the step vector in texture coordinates\n    // int nsteps - the number of steps to make through the texture\n    \n    \n    // Compute the distance to the front surface or near clipping plane\n    float distance = dot(nearpos-v_position, view_ray);\n    distance = max(distance, min((-0.5 - v_position.x) / view_ray.x,\n                            (u_shape.x - 0.5 - v_position.x) / view_ray.x));\n    distance = max(distance, min((-0.5 - v_position.y) / view_ray.y,\n                            (u_shape.y - 0.5 - v_position.y) / view_ray.y));\n    distance = max(distance, min((-0.5 - v_position.z) / view_ray.z,\n                            (u_shape.z - 0.5 - v_position.z) / view_ray.z));\n\n    // Now we have the starting position on the front surface\n    vec3 front = v_position + view_ray * distance;\n\n    // Decide how many steps to take\n    int nsteps = int(-distance / u_relative_step_size + 0.5);\n    float f_nsteps = float(nsteps);\n    if( nsteps < 1 )\n        discard;\n\n    // Get starting location and step vector in texture coordinates\n    vec3 step = ((v_position - front) / u_shape) / f_nsteps;\n    // 0.5 offset needed to get back to correct texture coordinates (vispy#2239)\n    vec3 start_loc = (front + 0.5) / u_shape;\n\n    // set frag depth to the cube face; this can be overridden by projection snippets\n    frag_depth_point = front;\n\n\n    // For testing: show the number of steps. This helps to establish\n    // whether the rays are correctly oriented\n    //gl_FragColor = vec4(0.0, f_nsteps / 3.0 / u_shape.x, 1.0, 1.0);\n    //return;\n\n    \n        float maxval = u_mip_cutoff; // The maximum encountered value\n        int maxi = -1;  // Where the maximum value was encountered\n        \n\n    // This outer loop seems necessary on some systems for large\n    // datasets. Ugly, but it works ...\n    vec3 loc = start_loc;\n    int iter = 0;\n\n    // keep track if the texture is ever sampled; if not, fragment will be discarded\n    // this allows us to discard fragments that only traverse clipped parts of the texture\n    bool texture_sampled = false;\n\n    while (iter < nsteps) {\n        for (iter=iter; iter<nsteps; iter++)\n        {\n            // Only sample volume if loc is not clipped by clipping planes\n            float distance_from_clip = clip_planes(loc, u_shape);\n            if (distance_from_clip >= 0)\n            {\n                // Get sample color\n                vec4 color = texture_lookup(loc);\n                float val = color.r;\n                texture_sampled = true;\n\n                \n        if( val > maxval ) {\n            maxval = val;\n            maxi = iter;\n        }\n        \n            }\n            // Advance location deeper into the volume\n            loc += step;\n        }\n    }\n\n    if (!texture_sampled)\n        discard;\n\n    \n        // Refine search for max value, but only if anything was found\n        if ( maxi > -1 ) {\n            // Calculate starting location of ray for sampling\n            vec3 start_loc_refine = start_loc + step * (float(maxi) - 0.5);\n            loc = start_loc_refine;\n\n            // Variables to keep track of current value and where max was encountered\n            vec3 max_loc_tex = start_loc_refine;\n\n            vec3 small_step = step * 0.1;\n            for (int i=0; i<10; i++) {\n                float val = texture_lookup(loc).r;\n                if ( val > maxval) {\n                    maxval = val;\n                    max_loc_tex = start_loc_refine + (small_step * i);\n                }\n                loc += small_step;\n            }\n            frag_depth_point = max_loc_tex * u_shape;\n            gl_FragColor = applyColormap(maxval);\n        }\n        else {\n            discard;\n        }\n        \n\n    // set frag depth\n    vec4 frag_depth_vector = vec4(frag_depth_point, 1);\n    vec4 iproj = transform_map_chain_12(frag_depth_vector);\n    iproj.z /= iproj.w;\n    gl_FragDepth = (iproj.z+1.0)/2.0;\n\n    apply_alpha();\npicking_filter();\n\n}\n\n')
        ob = <GlirFragmentShader 55 at 0x7fe691152e90>
    793 elif cmd == 'SIZE':  # VertexBuffer, IndexBuffer,
    794     ob.set_size(*args)  # Texture[1D, 2D, 3D], RenderBuffer

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:931, in GlirShader.set_data(self=<GlirFragmentShader 55>, offset=0, code='#version 120\n\nuniform mat4 u_matrix;\n\nvec4 affin...0)/2.0;\n\n    apply_alpha();\npicking_filter();\n\n}\n')
    929 errors = gl.glGetShaderInfoLog(self._handle)
    930 errormsg = self._get_error(code, errors, 4)
--> 931 raise RuntimeError("Shader compilation error in %s:\n%s" %
        errormsg = "    on line 329: '<' : syntax error: syntax error\n      vec4 color0 = $sample(u_volumetex, loc);"
        self = <GlirFragmentShader 55 at 0x7fe691152e90>
        (self._target, errormsg) = (GL_FRAGMENT_SHADER, "    on line 329: '<' : syntax error: syntax error\n      vec4 color0 = $sample(u_volumetex, loc);")
        self._target = GL_FRAGMENT_SHADER
    932                    (self._target, errormsg))

RuntimeError: Shader compilation error in GL_FRAGMENT_SHADER:
    on line 329: '<' : syntax error: syntax error
      vec4 color0 = $sample(u_volumetex, loc);
WARNING: Error drawing visual <Volume at 0x7fe690ef7af0>
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/app/backends/_qt.py:903, in CanvasBackendDesktop.paintGL(self=<vispy.app.backends._qt.CanvasBackendDesktop object>)
    901 # (0, 0, self.width(), self.height()))
    902 self._vispy_canvas.set_current()
--> 903 self._vispy_canvas.events.draw(region=None)
        self._vispy_canvas = <VispyCanvas (PyQt5) at 0x7fe6aba82800>
        self._vispy_canvas.events.draw = <vispy.util.event.EventEmitter object at 0x7fe6abaa5b40>
        self = <vispy.app.backends._qt.CanvasBackendDesktop object at 0x7fe6abab0820>
        self._vispy_canvas.events = <vispy.util.event.EmitterGroup object at 0x7fe6abaa5ae0>
    905 # Clear the alpha channel with QOpenGLWidget (Qt >= 5.4), otherwise the
    906 # window is translucent behind non-opaque objects.
    907 # Reference:  MRtrix3/mrtrix3#266
    908 if QT5_NEW_API or PYSIDE6_API or PYQT6_API:

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:453, in EventEmitter.__call__(self=<vispy.util.event.EventEmitter object>, *args=(), **kwargs={'region': None})
    450 if self._emitting > 1:
    451     raise RuntimeError('EventEmitter loop detected!')
--> 453 self._invoke_callback(cb, event)
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
        self = <vispy.util.event.EventEmitter object at 0x7fe6abaa5b40>
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>
    454 if event.blocked:
    455     break

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:471, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5)>>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    469     cb(event)
    470 except Exception:
--> 471     _handle_exception(self.ignore_callback_errors,
        self = <vispy.util.event.EventEmitter object at 0x7fe6abaa5b40>
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
        (cb, event) = (<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>, <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    472                       self.print_callback_errors,
    473                       self, cb_event=(cb, event))

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:469, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5)>>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    467 def _invoke_callback(self, cb, event):
    468     try:
--> 469         cb(event)
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe6aba82800>>
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
    470     except Exception:
    471         _handle_exception(self.ignore_callback_errors,
    472                           self.print_callback_errors,
    473                           self, cb_event=(cb, event))

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:218, in SceneCanvas.on_draw(self=<VispyCanvas (PyQt5)>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    215 # Now that a draw event is going to be handled, open up the
    216 # scheduling of further updates
    217 self._update_pending = False
--> 218 self._draw_scene()
        self = <VispyCanvas (PyQt5) at 0x7fe6aba82800>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:277, in SceneCanvas._draw_scene(self=<VispyCanvas (PyQt5)>, bgcolor=<class 'numpy.ndarray'> (4,) float32)
    275     bgcolor = self._bgcolor
    276 self.context.clear(color=bgcolor, depth=True)
--> 277 self.draw_visual(self.scene)
        self = <VispyCanvas (PyQt5) at 0x7fe6aba82800>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:315, in SceneCanvas.draw_visual(self=<VispyCanvas (PyQt5)>, visual=<SubScene>, event=None)
    313         else:
    314             if hasattr(node, 'draw'):
--> 315                 node.draw()
        node = <Volume at 0x7fe690ef7af0>
    316                 prof.mark(str(node))
    317 else:

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/visuals.py:103, in VisualNode.draw(self=<Volume>)
    101 if self.picking and not self.interactive:
    102     return
--> 103 self._visual_superclass.draw(self)
        self = <Volume at 0x7fe690ef7af0>
        self._visual_superclass = <class 'vispy.visuals.volume.VolumeVisual'>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/visuals/visual.py:451, in Visual.draw(self=<Volume>)
    449 self._configure_gl_state()
    450 try:
--> 451     self._program.draw(self._vshare.draw_mode,
        self._vshare.draw_mode = 'triangle_strip'
        self = <Volume at 0x7fe690ef7af0>
        self._vshare = <vispy.visuals.visual.VisualShare object at 0x7fe6911527d0>
        self._program = <vispy.visuals.shaders.program.ModularProgram object at 0x7fe69117db10>
        self._vshare.index_buffer = <IndexBuffer size=14 last_dim=1>
    452                        self._vshare.index_buffer)
    453 except Exception:
    454     logger.warning("Error drawing visual %r" % self)

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/visuals/shaders/program.py:102, in ModularProgram.draw(self=<vispy.visuals.shaders.program.ModularProgram object>, *args=('triangle_strip', <IndexBuffer size=14 last_dim=1>), **kwargs={})
    100 self.build_if_needed()
    101 self.update_variables()
--> 102 Program.draw(self, *args, **kwargs)
        self = <vispy.visuals.shaders.program.ModularProgram object at 0x7fe69117db10>
        args = ('triangle_strip', <IndexBuffer size=14 last_dim=1>)
        kwargs = {}

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/program.py:526, in Program.draw(self=<vispy.visuals.shaders.program.ModularProgram object>, mode='triangle_strip', indices=<IndexBuffer size=14 last_dim=1>, check_error=True)
    522     raise TypeError("Invalid index: %r (must be IndexBuffer)" %
    523                     indices)
    525 # Process GLIR commands
--> 526 canvas.context.flush_commands()
        canvas = <VispyCanvas (PyQt5) at 0x7fe6aba82800>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/context.py:172, in GLContext.flush_commands(self=<GLContext>, event=None)
    170         fbo = 0
    171     self.shared.parser.parse([('CURRENT', 0, fbo)])
--> 172 self.glir.flush(self.shared.parser)
        self = <GLContext at 0x7fe6abaa5ab0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:582, in GlirQueue.flush(self=<vispy.gloo.glir.GlirQueue object>, parser=<vispy.gloo.glir.GlirParser object>)
    580 def flush(self, parser):
    581     """Flush all current commands to the GLIR interpreter."""
--> 582     self._shared.flush(parser)
        parser = <vispy.gloo.glir.GlirParser object at 0x7fe6abaa5e10>
        self._shared = <vispy.gloo.glir._GlirQueueShare object at 0x7fe6abaa5ed0>
        self = <vispy.gloo.glir.GlirQueue object at 0x7fe6abaa5ea0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:504, in _GlirQueueShare.flush(self=<vispy.gloo.glir._GlirQueueShare object>, parser=<vispy.gloo.glir.GlirParser object>)
    502     show = self._verbose if isinstance(self._verbose, str) else None
    503     self.show(show)
--> 504 parser.parse(self._filter(self.clear(), parser))
        self = <vispy.gloo.glir._GlirQueueShare object at 0x7fe6abaa5ed0>
        parser = <vispy.gloo.glir.GlirParser object at 0x7fe6abaa5e10>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:822, in GlirParser.parse(self=<vispy.gloo.glir.GlirParser object>, commands=[('FUNC', 'glClearColor', 0.0, 0.0, 0.0, 1.0), ('FUNC', 'glClear', 17664), ('SIZE', 40, 96), ('DATA', 40, 0, <class 'numpy.ndarray'> (8, 1) [('f0', '<f4', (3,))]), ('SIZE', 44, 56), ('DATA', 44, 0, <class 'numpy.ndarray'> (14,) uint32), ('FUNC', 'glDisable', 'cull_face'), ('FUNC', 'glEnable', 'depth_test'), ('FUNC', 'glEnable', 'blend'), ('FUNC', 'glBlendFuncSeparate', 'src_alpha', 'one_minus_src_alpha', 'zero', 'one'), ('FUNC', 'glBlendEquationSeparate', 'func_add', 'func_add'), ('DRAW', 43, 'triangle_strip', (44, 'UNSIGNED_INT', 14))])
    819     self._objects.pop(id_)
    821 for command in commands:
--> 822     self._parse(command)
        command = ('SIZE', 40, 96)
        self = <vispy.gloo.glir.GlirParser object at 0x7fe6abaa5e10>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:778, in GlirParser._parse(self=<vispy.gloo.glir.GlirParser object>, command=('SIZE', 40, 96))
    776 if ob is None:
    777     if id_ not in self._invalid_objects:
--> 778         raise RuntimeError('Cannot %s object %i because it '
        'Cannot %s object %i because it '
                                       'does not exist' % (cmd, id_) = 'Cannot SIZE object 40 because it does not exist'
        cmd = 'SIZE'
        id_ = 40
        (cmd, id_) = ('SIZE', 40)
    779                            'does not exist' % (cmd, id_))
    780     return
    781 # Triage over command. Order of commands is set so most
    782 # common ones occur first.

RuntimeError: Cannot SIZE object 40 because it does not exist
WARNING: Error drawing visual <Volume at 0x7fdfee71c4c0>
^C---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/app/backends/_qt.py:903, in CanvasBackendDesktop.paintGL(self=<vispy.app.backends._qt.CanvasBackendDesktop object>)
    901 # (0, 0, self.width(), self.height()))
    902 self._vispy_canvas.set_current()
--> 903 self._vispy_canvas.events.draw(region=None)
        self._vispy_canvas = <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>
        self._vispy_canvas.events.draw = <vispy.util.event.EventEmitter object at 0x7fe009b9dc30>
        self = <vispy.app.backends._qt.CanvasBackendDesktop object at 0x7fe009ba8790>
        self._vispy_canvas.events = <vispy.util.event.EmitterGroup object at 0x7fe009b9dbd0>
    905 # Clear the alpha channel with QOpenGLWidget (Qt >= 5.4), otherwise the
    906 # window is translucent behind non-opaque objects.
    907 # Reference:  MRtrix3/mrtrix3#266
    908 if QT5_NEW_API or PYSIDE6_API or PYQT6_API:

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:453, in EventEmitter.__call__(self=<vispy.util.event.EventEmitter object>, *args=(), **kwargs={'region': None})
    450 if self._emitting > 1:
    451     raise RuntimeError('EventEmitter loop detected!')
--> 453 self._invoke_callback(cb, event)
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
        self = <vispy.util.event.EventEmitter object at 0x7fe009b9dc30>
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>>
    454 if event.blocked:
    455     break

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:471, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5)>>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    469     cb(event)
    470 except Exception:
--> 471     _handle_exception(self.ignore_callback_errors,
        self = <vispy.util.event.EventEmitter object at 0x7fe009b9dc30>
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>>
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
        (cb, event) = (<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>>, <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    472                       self.print_callback_errors,
    473                       self, cb_event=(cb, event))

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/util/event.py:469, in EventEmitter._invoke_callback(self=<vispy.util.event.EventEmitter object>, cb=<bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5)>>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    467 def _invoke_callback(self, cb, event):
    468     try:
--> 469         cb(event)
        cb = <bound method SceneCanvas.on_draw of <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>>
        event = <DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>
    470     except Exception:
    471         _handle_exception(self.ignore_callback_errors,
    472                           self.print_callback_errors,
    473                           self, cb_event=(cb, event))

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:218, in SceneCanvas.on_draw(self=<VispyCanvas (PyQt5)>, event=<DrawEvent blocked=False handled=False native=None region=None source=None sources=[] type=draw>)
    215 # Now that a draw event is going to be handled, open up the
    216 # scheduling of further updates
    217 self._update_pending = False
--> 218 self._draw_scene()
        self = <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:277, in SceneCanvas._draw_scene(self=<VispyCanvas (PyQt5)>, bgcolor=<class 'numpy.ndarray'> (4,) float32)
    275     bgcolor = self._bgcolor
    276 self.context.clear(color=bgcolor, depth=True)
--> 277 self.draw_visual(self.scene)
        self = <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/canvas.py:315, in SceneCanvas.draw_visual(self=<VispyCanvas (PyQt5)>, visual=<SubScene>, event=None)
    313         else:
    314             if hasattr(node, 'draw'):
--> 315                 node.draw()
        node = <Volume at 0x7fdfee71c4c0>
    316                 prof.mark(str(node))
    317 else:

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/scene/visuals.py:103, in VisualNode.draw(self=<Volume>)
    101 if self.picking and not self.interactive:
    102     return
--> 103 self._visual_superclass.draw(self)
        self = <Volume at 0x7fdfee71c4c0>
        self._visual_superclass = <class 'vispy.visuals.volume.VolumeVisual'>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/visuals/visual.py:451, in Visual.draw(self=<Volume>)
    449 self._configure_gl_state()
    450 try:
--> 451     self._program.draw(self._vshare.draw_mode,
        self._vshare.draw_mode = 'triangle_strip'
        self = <Volume at 0x7fdfee71c4c0>
        self._vshare = <vispy.visuals.visual.VisualShare object at 0x7fdfee742f50>
        self._program = <vispy.visuals.shaders.program.ModularProgram object at 0x7fdfee76e290>
        self._vshare.index_buffer = <IndexBuffer size=14 last_dim=1>
    452                        self._vshare.index_buffer)
    453 except Exception:
    454     logger.warning("Error drawing visual %r" % self)

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/visuals/shaders/program.py:102, in ModularProgram.draw(self=<vispy.visuals.shaders.program.ModularProgram object>, *args=('triangle_strip', <IndexBuffer size=14 last_dim=1>), **kwargs={})
    100 self.build_if_needed()
    101 self.update_variables()
--> 102 Program.draw(self, *args, **kwargs)
        self = <vispy.visuals.shaders.program.ModularProgram object at 0x7fdfee76e290>
        args = ('triangle_strip', <IndexBuffer size=14 last_dim=1>)
        kwargs = {}

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/program.py:526, in Program.draw(self=<vispy.visuals.shaders.program.ModularProgram object>, mode='triangle_strip', indices=<IndexBuffer size=14 last_dim=1>, check_error=True)
    522     raise TypeError("Invalid index: %r (must be IndexBuffer)" %
    523                     indices)
    525 # Process GLIR commands
--> 526 canvas.context.flush_commands()
        canvas = <VispyCanvas (PyQt5) at 0x7fe009b7a8f0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/context.py:172, in GLContext.flush_commands(self=<GLContext>, event=None)
    170         fbo = 0
    171     self.shared.parser.parse([('CURRENT', 0, fbo)])
--> 172 self.glir.flush(self.shared.parser)
        self = <GLContext at 0x7fe009b9dba0>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:582, in GlirQueue.flush(self=<vispy.gloo.glir.GlirQueue object>, parser=<vispy.gloo.glir.GlirParser object>)
    580 def flush(self, parser):
    581     """Flush all current commands to the GLIR interpreter."""
--> 582     self._shared.flush(parser)
        parser = <vispy.gloo.glir.GlirParser object at 0x7fe009b9df00>
        self._shared = <vispy.gloo.glir._GlirQueueShare object at 0x7fe009b9dfc0>
        self = <vispy.gloo.glir.GlirQueue object at 0x7fe009b9df90>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:504, in _GlirQueueShare.flush(self=<vispy.gloo.glir._GlirQueueShare object>, parser=<vispy.gloo.glir.GlirParser object>)
    502     show = self._verbose if isinstance(self._verbose, str) else None
    503     self.show(show)
--> 504 parser.parse(self._filter(self.clear(), parser))
        self = <vispy.gloo.glir._GlirQueueShare object at 0x7fe009b9dfc0>
        parser = <vispy.gloo.glir.GlirParser object at 0x7fe009b9df00>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:822, in GlirParser.parse(self=<vispy.gloo.glir.GlirParser object>, commands=[('FUNC', 'glClearColor', 0.0, 0.0, 0.0, 1.0), ('FUNC', 'glClear', 17664), ('SIZE', 40, 96), ('DATA', 40, 0, <class 'numpy.ndarray'> (8, 1) [('f0', '<f4', (3,))]), ('SIZE', 44, 56), ('DATA', 44, 0, <class 'numpy.ndarray'> (14,) uint32), ('FUNC', 'glDisable', 'cull_face'), ('FUNC', 'glEnable', 'depth_test'), ('FUNC', 'glEnable', 'blend'), ('FUNC', 'glBlendFuncSeparate', 'src_alpha', 'one_minus_src_alpha', 'zero', 'one'), ('FUNC', 'glBlendEquationSeparate', 'func_add', 'func_add'), ('DRAW', 43, 'triangle_strip', (44, 'UNSIGNED_INT', 14))])
    819     self._objects.pop(id_)
    821 for command in commands:
--> 822     self._parse(command)
        command = ('SIZE', 40, 96)
        self = <vispy.gloo.glir.GlirParser object at 0x7fe009b9df00>

File ~/anaconda3/envs/naparienv/lib/python3.10/site-packages/vispy/gloo/glir.py:778, in GlirParser._parse(self=<vispy.gloo.glir.GlirParser object>, command=('SIZE', 40, 96))
    776 if ob is None:
    777     if id_ not in self._invalid_objects:
--> 778         raise RuntimeError('Cannot %s object %i because it '
        'Cannot %s object %i because it '
                                       'does not exist' % (cmd, id_) = 'Cannot SIZE object 40 because it does not exist'
        cmd = 'SIZE'
        id_ = 40
        (cmd, id_) = ('SIZE', 40)
    779                            'does not exist' % (cmd, id_))
    780     return
    781 # Triage over command. Order of commands is set so most
    782 # common ones occur first.

Expected behavior

The image should be rendered in 3D.

Environment

name: naparienv
channels:
  - conda-forge
  - defaults
dependencies:
  - alabaster=0.7.12=py_0
  - aom=3.4.0=hb486fe8_1
  - appdirs=1.4.4=pyh9f0ad1d_0
  - appnope=0.1.3=pyhd8ed1ab_0
  - asciitree=0.3.3=py_2
  - asttokens=2.0.5=pyhd8ed1ab_0
  - attrs=22.1.0=pyh71513ae_1
  - babel=2.10.3=pyhd8ed1ab_0
  - backcall=0.2.0=pyh9f0ad1d_0
  - backports=1.0=py_2
  - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
  - blosc=1.21.1=h97e831e_3
  - bokeh=2.4.3=py310h2ec42d9_0
  - brotli=1.0.9=h5eb16cf_7
  - brotli-bin=1.0.9=h5eb16cf_7
  - brotlipy=0.7.0=py310h1961e1f_1004
  - brunsli=0.1=h046ec9c_0
  - build=0.7.0=pyhd8ed1ab_0
  - bzip2=1.0.8=h1de35cc_0
  - c-ares=1.18.1=h0d85af4_0
  - c-blosc2=2.2.0=h2699725_0
  - ca-certificates=2022.6.15=h033912b_0
  - cachey=0.2.1=pyh9f0ad1d_0
  - certifi=2022.6.15=py310h2ec42d9_0
  - cffi=1.15.0=py310hc55c11b_1
  - cfitsio=4.1.0=h2c97ad1_0
  - charls=2.3.4=he49afe7_0
  - charset-normalizer=2.1.0=pyhd8ed1ab_0
  - click=8.1.3=py310h2ec42d9_0
  - cloudpickle=2.1.0=pyhd8ed1ab_0
  - colorama=0.4.5=pyhd8ed1ab_0
  - commonmark=0.9.1=py_0
  - cryptography=37.0.4=py310h52c3658_0
  - cytoolz=0.11.0=py310hca72f7f_0
  - dask=2022.7.1=pyhd8ed1ab_0
  - dask-core=2022.7.1=pyhd8ed1ab_0
  - dataclasses=0.8=pyhc8e2a94_3
  - dav1d=1.0.0=hac89ed1_1
  - debugpy=1.6.0=py310h9d931ec_0
  - decorator=5.1.1=pyhd8ed1ab_0
  - distributed=2022.7.1=pyhd8ed1ab_0
  - docstring_parser=0.13=pyhd8ed1ab_0
  - docutils=0.19=py310h2ec42d9_0
  - entrypoints=0.4=pyhd8ed1ab_0
  - executing=0.9.1=pyhd8ed1ab_0
  - expat=2.4.8=h96cf925_0
  - fasteners=0.17.3=pyhd8ed1ab_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=hab24e00_0
  - fontconfig=2.14.0=h676cef8_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - freetype=2.10.4=h4cff582_1
  - freetype-py=2.3.0=pyhd8ed1ab_0
  - fsspec=2022.7.1=pyhd8ed1ab_0
  - future=0.18.2=py310h2ec42d9_5
  - gettext=0.21.0=h7535e17_0
  - giflib=5.2.1=hbcb3906_2
  - glib=2.69.1=h8346a28_1
  - gst-plugins-base=1.14.0=h4180768_2
  - gstreamer=1.14.0=h0fc69c2_2
  - heapdict=1.0.1=py_0
  - hsluv=5.0.2=pyh44b312d_0
  - icu=58.2=h0a44026_1000
  - idna=3.3=pyhd8ed1ab_0
  - imagecodecs=2022.7.27=py310h4208eff_1
  - imageio=2.21.0=pyhfa7a67d_0
  - imagesize=1.4.1=pyhd8ed1ab_0
  - importlib-metadata=4.11.4=py310h2ec42d9_0
  - importlib_resources=5.9.0=pyhd8ed1ab_0
  - ipykernel=6.15.1=pyh736e0ef_0
  - ipython=8.4.0=py310h2ec42d9_0
  - ipython_genutils=0.2.0=py_1
  - jedi=0.18.1=py310h2ec42d9_1
  - jinja2=3.1.2=pyhd8ed1ab_1
  - jpeg=9e=hac89ed1_2
  - jsonschema=4.9.0=pyhd8ed1ab_0
  - jupyter_client=7.3.4=pyhd8ed1ab_0
  - jupyter_core=4.11.1=py310h2ec42d9_0
  - jxrlib=1.1=h35c211d_2
  - kiwisolver=1.4.4=py310habb735a_0
  - krb5=1.19.3=hb49756b_0
  - lcms2=2.12=h577c468_0
  - lerc=4.0.0=hb486fe8_0
  - libaec=1.0.6=he49afe7_0
  - libavif=0.10.1=hac89ed1_1
  - libblas=3.9.0=15_osx64_openblas
  - libbrotlicommon=1.0.9=h5eb16cf_7
  - libbrotlidec=1.0.9=h5eb16cf_7
  - libbrotlienc=1.0.9=h5eb16cf_7
  - libcblas=3.9.0=15_osx64_openblas
  - libclang=12.0.0=default_hbc2896b_2
  - libcurl=7.83.1=h372c54d_0
  - libcxx=14.0.6=hce7ea42_0
  - libdeflate=1.12=hac89ed1_0
  - libedit=3.1.20191231=h0678c8f_2
  - libev=4.33=haf1e3a3_1
  - libffi=3.3=hb1e8313_2
  - libgfortran=5.0.0=9_3_0_h6c81a4c_23
  - libgfortran5=9.3.0=h6c81a4c_23
  - libiconv=1.17=hac89ed1_0
  - liblapack=3.9.0=15_osx64_openblas
  - libllvm12=12.0.1=hd011deb_2
  - libnghttp2=1.47.0=h942079c_0
  - libopenblas=0.3.20=openmp_h4e9756f_1
  - libpng=1.6.37=h5a3d3bf_3
  - libpq=12.9=h1c9f633_3
  - libsodium=1.0.18=hbcb3906_1
  - libssh2=1.10.0=h52ee1ee_2
  - libtiff=4.4.0=h4aaeabe_2
  - libwebp=1.2.3=hf64df63_1
  - libwebp-base=1.2.3=hac89ed1_2
  - libxcb=1.13=h0d85af4_1004
  - libxml2=2.9.14=hbf8cd5e_0
  - libxslt=1.1.35=h5b33f42_0
  - libzlib=1.2.12=hfe4f2af_2
  - libzopfli=1.0.3=h046ec9c_0
  - llvm-openmp=14.0.4=ha654fa7_0
  - locket=1.0.0=pyhd8ed1ab_0
  - lz4=4.0.0=py310h2e8d50f_2
  - lz4-c=1.9.3=he49afe7_1
  - magicgui=0.5.1=pyhd8ed1ab_0
  - markupsafe=2.1.1=py310h1961e1f_1
  - matplotlib-inline=0.1.3=pyhd8ed1ab_0
  - msgpack-python=1.0.4=py310habb735a_0
  - napari=0.4.14=pyhd8ed1ab_0
  - napari-console=0.0.4=pyhd8ed1ab_1
  - napari-plugin-engine=0.2.0=pyhd8ed1ab_2
  - napari-svg=0.1.6=pyhd8ed1ab_0
  - ncurses=6.3=hca72f7f_3
  - nest-asyncio=1.5.5=pyhd8ed1ab_0
  - networkx=2.8.5=pyhd8ed1ab_0
  - npe2=0.5.2=pyhd8ed1ab_0
  - nspr=4.33=he9d5cce_0
  - nss=3.78=ha8197d3_0
  - numcodecs=0.10.2=py310h154be8b_0
  - numpy=1.23.1=py310ha3f357c_0
  - numpydoc=1.4.0=pyhd8ed1ab_1
  - openjpeg=2.4.0=h6e7aa92_1
  - openssl=1.1.1q=hfe4f2af_0
  - packaging=21.3=pyhd8ed1ab_0
  - pandas=1.4.3=py310h3099161_0
  - parso=0.8.3=pyhd8ed1ab_0
  - partd=1.2.0=pyhd8ed1ab_0
  - pcre=8.45=he49afe7_0
  - pep517=0.12.0=py310h2ec42d9_2
  - pexpect=4.8.0=pyh9f0ad1d_2
  - pickleshare=0.7.5=py_1003
  - pillow=9.2.0=py310hb3240ae_0
  - pint=0.19.2=pyhd8ed1ab_0
  - pip=22.1.2=py310hecd8cb5_0
  - pkgutil-resolve-name=1.3.10=pyhd8ed1ab_0
  - ply=3.11=py_1
  - pooch=1.6.0=pyhd8ed1ab_0
  - prompt-toolkit=3.0.30=pyha770c72_0
  - psutil=5.9.1=py310h6c45266_0
  - psygnal=0.3.5=py310habb735a_0
  - pthread-stubs=0.4=hc929b4f_1001
  - ptyprocess=0.7.0=pyhd3deb0d_0
  - pure_eval=0.2.2=pyhd8ed1ab_0
  - pycparser=2.21=pyhd8ed1ab_0
  - pydantic=1.9.1=py310h6c45266_0
  - pygments=2.12.0=pyhd8ed1ab_0
  - pyopengl=3.1.6=pyhd8ed1ab_1
  - pyopenssl=22.0.0=pyhd8ed1ab_0
  - pyparsing=3.0.9=pyhd8ed1ab_0
  - pyqt=5.15.7=py310he9d5cce_0
  - pyrsistent=0.18.1=py310h1961e1f_1
  - pysocks=1.7.1=py310h2ec42d9_5
  - python=3.10.4=hdfd78df_0
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python_abi=3.10=2_cp310
  - pytomlpp=1.0.11=py310h6be76da_0
  - pytz=2022.1=pyhd8ed1ab_0
  - pywavelets=1.3.0=py310h7f5fb2b_1
  - pyyaml=6.0=py310h1961e1f_4
  - pyzmq=23.2.0=py310h85fb675_0
  - qt-main=5.15.2=h719ae48_4
  - qt-webengine=5.15.9=h90a370e_4
  - qtconsole-base=5.3.1=pyha770c72_0
  - qtpy=2.1.0=pyhd8ed1ab_0
  - qtwebkit=5.212=h24dc246_4
  - readline=8.1.2=hca72f7f_1
  - requests=2.28.1=pyhd8ed1ab_0
  - rich=12.5.1=pyhd8ed1ab_0
  - scikit-image=0.19.3=py310h3099161_0
  - scipy=1.9.0=py310h70707f4_0
  - setuptools=61.2.0=py310hecd8cb5_0
  - shellingham=1.4.0=pyh44b312d_0
  - sip=6.6.2=py310hd4537e4_0
  - six=1.16.0=pyh6c4a22f_0
  - snappy=1.1.9=h6e38e02_1
  - snowballstemmer=2.2.0=pyhd8ed1ab_0
  - sortedcontainers=2.4.0=pyhd8ed1ab_0
  - sphinx=5.1.1=pyhd8ed1ab_1
  - sphinxcontrib-applehelp=1.0.2=py_0
  - sphinxcontrib-devhelp=1.0.2=py_0
  - sphinxcontrib-htmlhelp=2.0.0=pyhd8ed1ab_0
  - sphinxcontrib-jsmath=1.0.1=py_0
  - sphinxcontrib-qthelp=1.0.3=py_0
  - sphinxcontrib-serializinghtml=1.1.5=pyhd8ed1ab_2
  - sqlite=3.39.0=h707629a_0
  - stack_data=0.3.0=pyhd8ed1ab_0
  - superqt=0.3.3=pyhd8ed1ab_0
  - tblib=1.7.0=pyhd8ed1ab_0
  - tifffile=2022.7.31=pyhd8ed1ab_0
  - tk=8.6.12=h5d9f67b_0
  - toml=0.10.2=pyhd8ed1ab_0
  - tomli=2.0.1=pyhd8ed1ab_0
  - toolz=0.12.0=pyhd8ed1ab_0
  - tornado=6.1=py310h1961e1f_3
  - tqdm=4.64.0=pyhd8ed1ab_0
  - traitlets=5.3.0=pyhd8ed1ab_0
  - typer=0.6.1=pyhd8ed1ab_0
  - typing-extensions=4.3.0=hd8ed1ab_0
  - typing_extensions=4.3.0=pyha770c72_0
  - tzdata=2022a=hda174b7_0
  - urllib3=1.26.11=pyhd8ed1ab_0
  - vispy=0.11.0=py310hdaa9052_0
  - wcwidth=0.2.5=pyh9f0ad1d_2
  - wheel=0.37.1=pyhd3eb1b0_0
  - wrapt=1.14.1=py310h6c45266_0
  - xorg-libxau=1.0.9=h35c211d_0
  - xorg-libxdmcp=1.1.3=h35c211d_0
  - xz=5.2.5=hca72f7f_1
  - yaml=0.2.5=h0d85af4_2
  - zarr=2.12.0=pyhd8ed1ab_0
  - zeromq=4.3.4=he49afe7_1
  - zfp=0.5.5=h4a89273_8
  - zict=2.2.0=pyhd8ed1ab_0
  - zipp=3.8.1=pyhd8ed1ab_0
  - zlib=1.2.12=h4dc903c_2
  - zlib-ng=2.0.6=hac89ed1_0
  - zstd=1.5.2=ha9df2e0_2
  - pip:
    - pyqt5-sip==12.11.0
AlexSauer commented 2 years ago

The problem seems to be related to #4891 as using pip to install napari gives the version 0.4.16 and things seem to work fine now.

liu-ziyang commented 2 years ago

I am going to close this issue as it is related to an older version, feel free to reopen if anyone found it with latest release