ufo-kit / syris

X-ray imaging simulation
GNU Lesser General Public License v3.0
32 stars 19 forks source link

Adding variable density across a mesh or object? #9

Open avdudchenko opened 3 years ago

avdudchenko commented 3 years ago

Hello, I would like to simulate transmission imaging of objects that have a density gradient (or concentration gradient). I originally approached this by stacking multiple objects, but this is not computationally or memory efficient.

I started to dive into the code to see if one could implement variable material properties across a mesh or object, but have not had luck figure out if this is even possible, or where to start? Any suggestions?

Thank you.

tfarago commented 3 years ago

This is indeed a nontrivial task and it is not yet supported. The straightforward way is to change the projected thickness calculation to really integration of the refractive index along the projection direction. It can then be a tricky task to specify the material properties (although simple gradient should be easy). Another option would be to not introduce material properties, but after the projected thickness calculation "correct" for different densities by re-scaling the projected thickness (if I am not mistaken, double the density=double the thickness for unchanged density).