Open Randall531 opened 1 month ago
The dataset submodule can be used to render example Python scripts for various configurations and then customize the code: https://xopto.github.io/pyxopto/docs/html/source/dataset/description.html Utilities for sampling of scattering phase function parameters in native or gamma-delta space are available in xopto.pf.util submodule. Utilities for random sampling of parameters and creating statistical models are available in xopto.util.sampler submodule.
The general idea is to create a single Mc instance and then update the instance/model parameters before each call to the run method. For a simple 2D lookup table of a semi-infinite sample this would require updating of the absorption and scattering coefficients:
g = 0.8
for mu in mua_values:
for musr in musr_values:
mc_instance.layers[1].mua = mu
mc_instance.layers[1].mus = musr/(1.0 - g)
results = mc.run(10e6)
# extract and save the desired data such as reflectance, transmittance, fluence, trace - see the examples
I’m working on creating a Look-Up Table for a Monte Carlo simulation to model light propagation in tissue. This has been done before using MATLAB, now I’m looking to transition to Python and considering using the pyxopto library for the simulation. Has anyone tried doing something similar before? Appreciate any insights or advice to direct me to my goal.