-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unevenly spaced coordinates for volume rendering #11
Comments
Hi, thanks for your kind words, nice to hear it's being used (or planned to be)in different sciences. Would binning the data to a regular grid work? How are the samples distributed? If you have many per gridcell you could take a look at vaex. import vaex
ds = vaex.from_arrays(x=x, y=y, z=z)
vol = ds.count(binby=['x', 'y', 'z'], shape=128) And volshow that. Vaex can process about 1 billion samples a second, it the mother project of ipyvolume. |
Sorry, here is the fixed link to xarray: http://xarray.pydata.org/en/stable |
The samples are distributed regularly, on a grid, but unevenly (i.e closer grid spacing near the surface.) The thing I don't understand from your example is, where do I input the actual data? In my example |
The video link is now also working, so i understand it better now. |
Thanks @maartenbreddels for these tips! I am an experienced numpy/scipy user and am familiar with various approaches for interpolating and regridding data. What I am asking with my issue is whether you think ipyvolume should do these things for the user automatically, using the api I suggested above. Your response suggests that the answer is "no"; such features are outside the scope of what you aim to provide. |
Ah ok, I misunderstood you then. Well, i'm not against supporting this, although I wouldn't directly add it in volshow now. I did think of having say 'incubator.py' module, where a function that does this could go without problem (with the regridding), and where when things are more mature/sorted out/merged etc could then move to the pylab.py file. Another thing might be to have a per science module, 'astro.py', 'earth.py', 'bio.py' etc where more science specific things could do. But I think this example is quite general. I also think it must be possible to do this without regridding/interpolating, so in the long term I do see this as something that volshow could support. Until (or if) that happens, I'm happy to accept a PR with an incubator.py file that does sth like you propose, volshow_rectilinear(data, x=x, y=y, z=z) using scipy to regrid the data. |
@maartenbreddels thanks for your explanation above. However I would like to confirm some information. Now, it is only necessary to have a 3d numpy array to plot using |
Hi @victortxa, please open a new issue the next time. I am not sure I understand your question, but ipyvolume does both volume rendering (volshow, displayed 3d cubes/arrays) and glyphs (a shape/symbol at a specific location). Currently it does not do arbitrary objects, like meshes, but pythreejs would solve think I'd think. |
With python 3.10, ipyvolume=='0.6.0-alpha.10' I cannot show a volume from xarray dataarray
I obtain the following error message
ds is a regular grid 64x64x64
|
I just discovered ipyvolume and think it is fantastic! Thanks for this contribution to the python visualization world.
I work in ocean modeling, and I often want to visualize the output of my simulations using volume rendering. I have been using paraview (example), but it is pretty heavy duty and doesn't integrate well with the rest of my analysis pipeline. I would be thrilled to be able to stay in a notebook environment.
Ipyvolume could really fill a missing need for me if it supported unevenly spaced coordinates (as in a VTK rectilinear grid). I would like to be able to do something like this:
where
x
,y
, andz
, are one-dimensional coordinate variables. (Even better would be to be able to pass and xarray DataArray, which has the coordinates built in.)Would this be a difficult feature to add?
The text was updated successfully, but these errors were encountered: