[yt-users] Volume rendering

Андрей Парамонов paramon at acdlabs.ru
Tue Nov 28 01:36:26 PST 2017


Hello!

I've recently discovered yt, and I found the rendering examples really 
encouraging. I'm now trying to visualize a large 3D dataset via volume 
rendering technique. I have come up with the following script that is 
intended to plot a part of the dataset:

---

import yt
from yt.config import ytcfg

import h5py

f = h5py.File('ims-p.hdf5')
intens = f['intensity'][:256,:256,:256]
print(intens.shape)
ds = yt.load_uniform_grid({'Intensity': intens}, intens.shape)
print(ds)
sc = yt.create_scene(ds, ('Intensity'), lens_type = 'perspective')
sc[0].set_log(True)
sc[0].tfh.plot('transfer_function.png', profile_field = 'Intensity')
sc.camera.resolution = 1024

sc.annotate_axes(alpha = 0.1)
sc.annotate_domain(ds, color = [1, 1, 1, 0.1])
sc.save_annotated('vr_grids.png', sigma_clip = 4)

---

I get some really fascinating rendering (attached), and now I want to 
tweak it. I would be really happy if you could help me with the 
following questions:

1) What is the best way to configure the camera viewpoint so the 
complete data cube fits into the view? How to quickly render the domain 
axes without performing the costly volume rendering (to find the 
"optimal" viewpoint experimentally)?

2) What is the best way to specify axes scales, so that rendered volume 
appears as cuboid, not cube? I want the resulting cuboid to be scaled as 
3:2:2. How to specify resulting image size, e.g. how to get image of 
1600x1200 pixels?

3) In my dataset, the grid is not in fact uniform, but rather X 
coordinates are specified by (non-decreasing) array rettime, Y 
coordinates are specified by (non-decreasing) array mz. What is the best 
way to pass this information (to load_uniform_grid)?

4) Is it possible to use inverse transfer function model, i.e. white 
background?

5) My complete dataset is rather large and doesn't readily fit into RAM. 
However it seems that for ray-tracing algorithm, it shouldn't be 
required that all data is available simultaneously. Is it possible to 
feed dataset by chunks?

Your help is greatly appreciated!

Best wishes,
Andrey Paramonov

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vr_grids.png
Type: image/png
Size: 358984 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20171128/65ab545c/attachment-0001.png>


More information about the yt-users mailing list