ipyvolume
ipyvolume copied to clipboard
[WIP] FEATURE: Multivolume rendering for multi-dimensional data
Extending volume rendering code to accomodate multi-dimensional data. Accepts either 3D or 4D data (3 spatial dimensions, plus color channels).
Example:
import numpy as np
import ipyvolume as ipv
aquarius = ipv.datasets.aquariusA2.fetch() # 3D data
data = np.moveaxis(np.array([aquarius.data, aquarius.data.T]), 0, -1) # pseudo-4D data
ipv.quickvolshow(data)
Unlike the existing brightness and opacity sliders, the colorpicker widget uses a python callback. This means the colorpicker widget won't work if there isn't a live python kernel (eg: if the ipyvolume widget is embedded in a html document). This is a disadvantage - is it possible to implement in javascript? I've seen this previous discussion but am unsure if there's been progress there.
Note: Any comments about the code generating the linear ramp transfer functions should go in the discussion at https://github.com/maartenbreddels/ipyvolume/pull/178
What is the reason for doing this in volshow, why not simply a loop/multiple calls?
Because it's a pain in the butt, that's why. I want to write a single funciton call, rather than a bunch of boilerplate every time I need to visualize an array. I'm generally working with multidimensional data in a 4D or 5D numpy array. That's also true for most other people working with microscopy images, hyperspectral astronomical data, medical imaging, etc. So there are a lot of use cases for extending this.
I think it may make volshow's behaviour too complex, and maybe less flexible even.
What flexibility do you think is lost? You can still pass in a single 3D arrray and have it work the same as before. (In fairness, this PR mucks around with the default transfer function, but that's the only change, and even that might not stay like that for long)
Has this been abandoned?
Hi @evolu8, this fell off my radar after the discussion about the different types of transfer function widgets in https://github.com/maartenbreddels/ipyvolume/pull/178. Did you want to take a crack at this?