Ruyi-Zha/naf_cbct

Render code question

Closed this issue · 2 comments

Hey,

I read your render code at https://github.com/Ruyi-Zha/naf_cbct/blob/main/src/render/render.py.

I want to know that why the dimension of 'raw' at line 27 is not a 3D CT volume? I check its dimension is (1024, 192, 1). Could we do render 2D projections from 3D CT volume directly by using your render.py code?

Also why do you choose the n_samples=192 https://github.com/Ruyi-Zha/naf_cbct/blob/main/config/chest_50.yaml, is it just a random number?

Thanks for your time!

Hi, thanks for your interest.

raw = run_network(pts, net, netchunk) returns the density (or attenuation coefficient) at the position pts. The dimension is (1024, 192, 1) because we query 192 points along 1024 sampled rays.

Technically we can render 2D projections from a 3D CT volume with acc, _ = raw2outputs(raw, z_vals, rays_d, raw_noise_std) in line 43, by querying points along all rays. However, I suggest you use the TIGRE toolbox since it is easier to use. You can check how to do that with generateData.py.

n_samples=192 is empirically set up such that it is larger than CT dimension (128).

Thanks! I'll try to implement as you suggest.