The Monte Carlo technique is a flexible method for simulating light propagation in tissue. The simulation is based on the random walks that photons make as they travel through tissue, which are chosen by statistically sampling the probability distributions for step size and angular deflection per scattering event. After propagating many photons, the net distribution of all the photon paths yields an accurate approximation to reality.
There are a variety of ways to implement Monte Carlo simulations of light transport. One approach is to predict steady-state light distributions. Below we provide a steady-state model (MCML) for multi-layered media that is well developed and documented and has been used by many groups. The other approach is to predict time-resolved light distributions.
Download a book chapter on the Monte Carlo method: Jacques2011_MonteCarlo_Welch&VanGemert.pdf [5.9MB].
Despite appearances to the contrary (e.g., MCML), Monte Carlo code does not need to be long and complicated. To emphasize this idea of the inherent simplicity of the Monte Carlo approach, I have written three short programs. Enjoy!
small_mc.cabove, and shows how simply time resolved simulations can be done.
Simple steady-state Monte Carlo in spherical, cylindrical and planar coordinates. (ANSI standard C.) Used in the article:
Uses the subroutine mcsub.c to simulate
Originally described in the article:
A Monte Carlo subroutine written in C that can be called by another C program, for example callmcsub.c.
The subroutine mcsub.c simulates
Also includes MATLAB program for viewing results of simulation.
mcxyz.c is a computer simulation of light transport in a heterogenous medium with varying absorption and scattering properties.
The medium is defined as a cube with cube-shaped voxels, typically a 400x400x400 voxel cube. Each voxel is assigned an integer value which identifies a particular type of tissue with unique optical properties of µa, µs, and g. The simulation yields a map of the relative fluence rate φ [W/cm2 per W delivered] or [cm-2] throughout the cube.
The software also includes a MATLAB program that generates the input files to mcxyz.c:
mcxyz.c can read input files generated by alternative software that follows the same simple format used by the MATLAB program. So the MATLAB program is a current working version that could be replaced by alternative software.
The movement of polarized light is treated as the propagation of a Stokes Vector of intensity, [I Q U V]T, for each of 4 sources of light, H, V, P, and R (H = linearly polarized parallel to scattering plane, V = linearly polarized perpendicular to scattering plane, P = linearly polarized at +45°, R = right circular polarized). Hence, 16 output files are generates, HI, HQ, HU, HV, PI, PQ, PU, PV, etc., where each is the x-y map of escaping reflectance from a planar slab of tissue of specified thickness.
MCML is a steady-state Monte Carlo simulation program for multi-layered turbid media with an infinitely narrow photon beam as the light source. Each layer has its own optical properties of absorption, scattering, anisotropy, and refractive index. The simulation is 3D, but the results are stored in an r-z array in cylindrical coordinates denoting radial and depth positions. Outputs include the radial position and angular dependence of local reflectance and transmittance, and the internal distribution of energy deposition and fluence rate within the multilayered medium. The program can be easily modified.
The simulation is specified by an input text file called, for example, "sample.mci", which can be altered by any simple text editor. The output is another text file called, for example, "sample.mco". (The names are arbitrary.)
This program was originally implemented by Marleen Keijzer, Scott Prahl, and Steven Jacques in Pascal. A later version was written in Standard ANSI C by Lihong Wang and Steven Jacques implementing multiply layered tissue, which has been distributed on the Internet since 1992 and successfully modified by many groups.
Some references on this method are:
The details of the light propagation model are given in Prahl et al. 1989 which can be downloaded. This paper is a terse but complete description of the Monte Carlo simulation and convolution. The report by Wang et al. 1995 is the latest summary of the current MCML method.
You can download the MCML source code as ASCII text files, as an encoded source.tar.gz file, and as pre-compiled versions for the PC, Macintosh and SUN. A full 117-page manual and a brief ASCII manual are also provided.
Download original precompiled PC version of MCML: precompiled mcml.exe for PC
Lihong Wang's source code site: ASCII source code
A MATLAB program called lookmcml.m will read the output file of MCML, using a subroutine called getmcml.m and a colormap called makec2f.m. These can be downloaded at:
CUDAMCML is an excellent implementation of MCML that takes advantage of the presence of NVIDIA graphics cards to run much faster.
The details of the light propagation model are given in E. Alerstam, T. Svensson, and S. Andersson-Engels J. Biomedical Optics Letters 13, 060504 (2008) .
You can download the GPU MCML source code from the Lund University Biophotonics site
CONV is a convolution program which uses the MCML output file to convolve for photon beams of variable size or shape (Gaussian or flat field). CONV can provide a variety of output formats (reflectance, transmission, iso-fluence contours, etc.) which are compatible with standard graphics applications.
© 2007 Scott Prahl