Skip to content
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

Making a look up table using pyxopto #29

Open
Randall531 opened this issue Oct 21, 2024 · 1 comment
Open

Making a look up table using pyxopto #29

Randall531 opened this issue Oct 21, 2024 · 1 comment
Labels
question Further information is requested

Comments

@Randall531
Copy link

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.

@xopto
Copy link
Owner

xopto commented Oct 21, 2024

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

@xopto xopto added the question Further information is requested label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants