Rendering images without a round-trip to the kernel

I often work with large 3D and 4D imagery, on the order of 1024x1024x512 pixels. The gold standard for visualizing dense imagery like this is ImageJ which provides very performant scrolling through z slices.

neuroglancer also solves this problem, but on a much larger scale, and is overkill for this application and somewhat cumbersome.

I would like to replicate this functionality inline in a notebook. My first attempt to use ipympl and hook mpl_connect scroll events to plt.imshow was unusably slow, presumably due to the extra roundtrip to the kernel compared to native matplotlib.

any ideas?

itkwidgets might have the performance features you need.

A alpha version that supports jupyterlab 3 (no nodejs build step) is available via:

pip install 'itkwidgets[lab]>=1.0a8'
1 Like