{"action":"created","issue":{"url":"https://api.github.com/repos/vispy/vispy/issues/957","labels_url":"https://api.github.com/repos/vispy/vispy/issues/957/labels{/name}","comments_url":"https://api.github.com/repos/vispy/vispy/issues/957/comments","events_url":"https://api.github.com/repos/vispy/vispy/issues/957/events","html_url":"https://github.com/vispy/vispy/issues/957","id":84079703,"number":957,"title":" `vispy.plot` doesn't work in WebGL with images ","user":{"login":"josephwinston","id":226217,"avatar_url":"https://avatars.githubusercontent.com/u/226217?v=3","gravatar_id":"","url":"https://api.github.com/users/josephwinston","html_url":"https://github.com/josephwinston","followers_url":"https://api.github.com/users/josephwinston/followers","following_url":"https://api.github.com/users/josephwinston/following{/other_user}","gists_url":"https://api.github.com/users/josephwinston/gists{/gist_id}","starred_url":"https://api.github.com/users/josephwinston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephwinston/subscriptions","organizations_url":"https://api.github.com/users/josephwinston/orgs","repos_url":"https://api.github.com/users/josephwinston/repos","events_url":"https://api.github.com/users/josephwinston/events{/privacy}","received_events_url":"https://api.github.com/users/josephwinston/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-06-02T15:46:45Z","updated_at":"2015-06-14T22:31:48Z","closed_at":null,"body":"At git  commit `e18e2ab1b9149268a345f7b2ad2d7787c4c64159`, using `anaconda` on an up to date OS X system.  \r\n\r\nThe following code taken from <http://vispy.org/examples/basics/plotting/volume.html> without the volume rendering fails:\r\n\r\n```python\r\nimport vispy.app\r\nvispy.app.use_app('ipynb_webgl')\r\n\r\nimport numpy as np\r\n\r\nfrom vispy import io, plot as vp\r\n\r\nfig = vp.Fig(show=False)\r\n\r\ndata = np.load(io.load_data_file('brain/mri.npz'))['data']\r\ndata = np.flipud(np.rollaxis(data, 1))\r\nvol_data = data.copy(order='C') # make c continous\r\nprint vol_data.flags\r\n\r\nclim = [32, 192]\r\n#vol_pw = fig[0, 0]\r\n#vol_pw.volume(vol_data, clim=clim)\r\n#vol_pw.camera.elevation = 30\r\n#vol_pw.camera.azimuth = 30\r\n#vol_pw.camera.scale_factor /= 1.5\r\n\r\nshape = vol_data.shape\r\nfig[1, 0].image(vol_data[:, :, shape[2] // 2], cmap='grays', clim=clim)\r\nfig[0, 1].image(vol_data[:, shape[1] // 2, :], cmap='grays', clim=clim)\r\nfig[1, 1].image(vol_data[shape[0] // 2, :, :].T, cmap='grays', clim=clim)\r\n\r\nfig.show(run=True)\r\n```\r\n\r\nThe output is:\r\n\r\n```python\r\n  C_CONTIGUOUS : True\r\n  F_CONTIGUOUS : False\r\n  OWNDATA : True\r\n  WRITEABLE : True\r\n  ALIGNED : True\r\n  UPDATEIFCOPY : False\r\n:0: FutureWarning: IPython widgets are experimental and may change in the future.\r\nWARNING: Traceback (most recent call last):\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/runpy.py\", line 162, in _run_module_as_main\r\n    \"__main__\", fname, loader, pkg_name)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/IPython/kernel/__main__.py\", line 3, in <module>\r\n    app.launch_new_instance()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/IPython/config/application.py\", line 574, in launch_instance\r\n    app.start()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/IPython/kernel/zmq/kernelapp.py\", line 373, in start\r\n    ioloop.IOLoop.instance().start()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/zmq/eventloop/ioloop.py\", line 151, in start\r\n    super(ZMQIOLoop, self).start()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/tornado/ioloop.py\", line 784, in start\r\n    self._run_callback(callback)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/tornado/ioloop.py\", line 568, in _run_callback\r\n    ret = callback()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\r\n    return fn(*args, **kwargs)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/_ipynb_webgl.py\", line 209, in _draw_event\r\n    self._vispy_canvas.events.draw()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/event.py\", line 436, in __call__\r\n    self._invoke_callback(cb, event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/event.py\", line 452, in _invoke_callback\r\n    self, cb_event=(cb, event))\r\n  << caught exception here: >>\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/event.py\", line 448, in _invoke_callback\r\n    cb(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/canvas.py\", line 189, in on_draw\r\n    self._draw_scene()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/canvas.py\", line 232, in _draw_scene\r\n    self.draw_visual(self.scene, viewport=viewport)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/canvas.py\", line 282, in draw_visual\r\n    visual.draw(scene_event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 50, in draw\r\n    self.process_system(event, 'draw')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 60, in process_system\r\n    self._systems[system_name].process(event, self)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 28, in process\r\n    _handle_exception(False, 'reminders', self, node=node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 23, in process\r\n    node.draw(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/widgets/viewbox.py\", line 324, in draw\r\n    self.scene.draw(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 50, in draw\r\n    self.process_system(event, 'draw')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 60, in process_system\r\n    self._systems[system_name].process(event, self)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 28, in process\r\n    _handle_exception(False, 'reminders', self, node=node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 23, in process\r\n    node.draw(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/visuals/image.py\", line 306, in draw\r\n    self._program.draw('triangles')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/visuals/shaders/program.py\", line 89, in draw\r\n    Program.draw(self, *args, **kwargs)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/program.py\", line 467, in draw\r\n    canvas.context.flush_commands()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/context.py\", line 170, in flush_commands\r\n    self.glir.flush(self.shared.parser)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/glir.py\", line 231, in flush\r\n    self._shared.flush(parser)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/glir.py\", line 145, in flush\r\n    parser.parse(self._filter(self.clear(), parser))\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/_ipynb_webgl.py\", line 110, in parse\r\n    self._widget.send_glir_commands(commands)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/ipython/_widget.py\", line 78, in send_glir_commands\r\n    msg = create_glir_message(commands, 'base64')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/_ipynb_util.py\", line 97, in create_glir_message\r\n    for buffer in buffers]\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/logs.py\", line 345, in _serialize_buffer\r\n    'buffer': base64.b64encode(buffer).decode('ascii')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/base64.py\", line 53, in b64encode\r\n    encoded = binascii.b2a_base64(s)[:-1]\r\nValueError: ndarray is not C-contiguous\r\nWARNING:vispy:Traceback (most recent call last):\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/runpy.py\", line 162, in _run_module_as_main\r\n    \"__main__\", fname, loader, pkg_name)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/IPython/kernel/__main__.py\", line 3, in <module>\r\n    app.launch_new_instance()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/IPython/config/application.py\", line 574, in launch_instance\r\n    app.start()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/IPython/kernel/zmq/kernelapp.py\", line 373, in start\r\n    ioloop.IOLoop.instance().start()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/zmq/eventloop/ioloop.py\", line 151, in start\r\n    super(ZMQIOLoop, self).start()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/tornado/ioloop.py\", line 784, in start\r\n    self._run_callback(callback)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/tornado/ioloop.py\", line 568, in _run_callback\r\n    ret = callback()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/tornado/stack_context.py\", line 275, in null_wrapper\r\n    return fn(*args, **kwargs)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/_ipynb_webgl.py\", line 209, in _draw_event\r\n    self._vispy_canvas.events.draw()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/event.py\", line 436, in __call__\r\n    self._invoke_callback(cb, event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/event.py\", line 452, in _invoke_callback\r\n    self, cb_event=(cb, event))\r\n  << caught exception here: >>\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/event.py\", line 448, in _invoke_callback\r\n    cb(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/canvas.py\", line 189, in on_draw\r\n    self._draw_scene()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/canvas.py\", line 232, in _draw_scene\r\n    self.draw_visual(self.scene, viewport=viewport)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/canvas.py\", line 282, in draw_visual\r\n    visual.draw(scene_event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 50, in draw\r\n    self.process_system(event, 'draw')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 60, in process_system\r\n    self._systems[system_name].process(event, self)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 28, in process\r\n    _handle_exception(False, 'reminders', self, node=node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 23, in process\r\n    node.draw(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/widgets/viewbox.py\", line 324, in draw\r\n    self.scene.draw(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 50, in draw\r\n    self.process_system(event, 'draw')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/subscene.py\", line 60, in process_system\r\n    self._systems[system_name].process(event, self)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 37, in process\r\n    self.process(event, sub_node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 28, in process\r\n    _handle_exception(False, 'reminders', self, node=node)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/scene/systems.py\", line 23, in process\r\n    node.draw(event)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/visuals/image.py\", line 306, in draw\r\n    self._program.draw('triangles')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/visuals/shaders/program.py\", line 89, in draw\r\n    Program.draw(self, *args, **kwargs)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/program.py\", line 467, in draw\r\n    canvas.context.flush_commands()\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/context.py\", line 170, in flush_commands\r\n    self.glir.flush(self.shared.parser)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/glir.py\", line 231, in flush\r\n    self._shared.flush(parser)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/gloo/glir.py\", line 145, in flush\r\n    parser.parse(self._filter(self.clear(), parser))\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/_ipynb_webgl.py\", line 110, in parse\r\n    self._widget.send_glir_commands(commands)\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/ipython/_widget.py\", line 78, in send_glir_commands\r\n    msg = create_glir_message(commands, 'base64')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/app/backends/_ipynb_util.py\", line 97, in create_glir_message\r\n    for buffer in buffers]\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/site-packages/vispy-0.5.0.dev0-py2.7.egg/vispy/util/logs.py\", line 345, in _serialize_buffer\r\n    'buffer': base64.b64encode(buffer).decode('ascii')\r\n  File \"/Users/hb55683/anaconda/lib/python2.7/base64.py\", line 53, in b64encode\r\n    encoded = binascii.b2a_base64(s)[:-1]\r\nValueError: ndarray is not C-contiguous\r\nERROR: Invoking <bound method Fig.on_draw of <Fig (ipynb_webgl) at 0x10a08c150>> for DrawEvent\r\nERROR:vispy:Invoking <bound method Fig.on_draw of <Fig (ipynb_webgl) at 0x10a08c150>> for DrawEvent\r\n```\r\nAnd the images are not correct either.  The code without the \r\n\r\n```python\r\nimport vispy.app\r\nvispy.app.use_app('ipynb_webgl')\r\n```\r\nruns as expected.\r\n\r\nLikewise so does the code found in issue #875.\r\n"},"comment":{"url":"https://api.github.com/repos/vispy/vispy/issues/comments/111880382","html_url":"https://github.com/vispy/vispy/issues/957#issuecomment-111880382","issue_url":"https://api.github.com/repos/vispy/vispy/issues/957","id":111880382,"user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=3","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"created_at":"2015-06-14T22:31:47Z","updated_at":"2015-06-14T22:31:47Z","body":"the webgl backend should *not* be used when exporting the commands\r\nwhat command are you running exactly?"}}