This project has moved and is read-only. For the latest updates, please go here.

Loading MC simulation results for future pmc runs

Mar 24, 2015 at 10:02 PM
Hi - thanks for all of the examples in the MATLAB version, I have found them very helpful for learning to use the code.

One question I had was how you can load a simulation into memory. If I run a simulation and then say use the pmc to modify it, the examples are clear.

But - if I run a long simulation and then want to store it, I am not sure how I can run the "parent simulation" and then simply load the results later for pmc.

The data is stored (the 'Results' folder) but I just dont know how to access it. Thanks so much.
Mar 26, 2015 at 12:00 AM
Hi,

If you look at vts_mc_demo.m Example 5, the first part of that example runs a simulation. Specifying options.Databases = {Vts.MonteCarloDatabaseType.DiffuseReflectance}; generates a DiffuseReflectanceDatabase database in the 'results' folder. On Line 167 "output = VtsMonteCarlo.RunSimulation(si);" runs the simulation that creates the database. Then line 170 "ppi = PostProcessorInput();" sets up to post-process that database and subsequent lines define where to find the database "ppi.InputFolder" and the R(rho) detector. Then "ppoutput = Vts.MonteCarlo.RunPostProcessor(ppi,si);" runs the post-processor. The end of this example shows how the R(rho) generated "on-the-fly", i.e. while the database is being generated, and that created by the post-processor are identical plots, as they should be. This example does not use perturbation Monte Carlo (pMC).

Example 6 shows an example of how to run pMC with perturbed optical properties. Same concept as above, but here you specify that the Options.Databases = {Vts.MonteCarlo.DatabaseType.pMCDiffuseReflectance} which generates two database files in 'results': DiffuseReflectanceDatabase and CollisionInfoDatabase. To run pMC post-processor, you would also need to specify the perturbed optical properties for the single layer of tissue.

So if you ran a long simulation, the database results would be stored in the subfolder "results" for example. Then you would use the calls to the PostProcessorInput to read the database(s) to generate the results you'd like.

Let me know if you have more questions.

Carole