You are on page 1of 8

c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57

journal homepage: www.intl.elsevierhealth.com/journals/cmpb

Optimization of the Monte Carlo code for


modeling of photon migration in tissue

Norbert S. Żołek ∗ , Adam Liebert, Roman Maniewski


Institute of Biocybernetics and Biomedical Engineering PAS, 02-109 Warsaw, ul. Ks. Trojdena 4, Poland

a r t i c l e i n f o a b s t r a c t

Article history: The Monte Carlo method is frequently used to simulate light transport in turbid media
Received 12 December 2005 because of its simplicity and flexibility, allowing to analyze complicated geometrical struc-
Received in revised form tures. Monte Carlo simulations are, however, time consuming because of the necessity to
27 July 2006 track the paths of individual photons. The time consuming computation is mainly asso-
Accepted 27 July 2006 ciated with the calculation of the logarithmic and trigonometric functions as well as the
generation of pseudo-random numbers. In this paper, the Monte Carlo algorithm was devel-
Keywords: oped and optimized, by approximation of the logarithmic and trigonometric functions. The
Monte Carlo approximations were based on polynomial and rational functions, and the errors of these
Light transport approximations are less than 1% of the values of the original functions. The proposed algo-
Time-resolved reflectance rithm was verified by simulations of the time-resolved reflectance at several source-detector
Distribution of time of flight of separations. The results of the calculation using the approximated algorithm were compared
photons with those of the Monte Carlo simulations obtained with an exact computation of the log-
arithm and trigonometric functions as well as with the solution of the diffusion equation.
The errors of the moments of the simulated distributions of times of flight of photons (total
number of photons, mean time of flight and variance) are less than 2% for a range of optical
properties, typical of living tissues. The proposed approximated algorithm allows to speed
up the Monte Carlo simulations by a factor of 4. The developed code can be used on parallel
machines, allowing for further acceleration.
© 2006 Elsevier Ireland Ltd. All rights reserved.

1. Introduction than the average mean free path of photon in the tissue [8].
The number of the time steps, before the photon is absorbed
Monte Carlo simulations are frequently used in modeling of or scattered, becomes very big with highly scattering media.
light transport in turbid media [1–6]. The method does not To reduce the computation time, certain improvements were
require assumptions on the boundary conditions, which are proposed. In the variable stepsize technique, the stepsize is
necessary in case of the finite element and finite differences chosen to be equal to the distance at which the photon is either
solutions of the diffusion equation and radiative transport scattered or absorbed.
equation [7,4]. To reduce the number of photons required to achieve the
In Monte Carlo simulations of light transport, photons are desired accuracy of the simulation, the variance reduction
traced until they are detected or absorbed. The classical Monte technique [9–11] was proposed. In the classical Monte Carlo
Carlo method, based on the random walk, used fixed step- method, the probability of the absorption per length of the
size of the photon movement, which had to be much shorter photon’s travel is defined by the absorption coefficient. The


Corresponding author. Tel.: +48 226599143; fax: +48 226597030.
E-mail address: norbert@ibib.waw.pl (N.S. Żołek).
0169-2607/$ – see front matter © 2006 Elsevier Ireland Ltd. All rights reserved.
doi:10.1016/j.cmpb.2006.07.007
c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57 51

absorbed photon disappears. In the variance reduction tech- The path of the photon package consists of straight seg-
nique, a weight is assigned to each photon (or a photon ments between the consecutive scattering events. The dis-
package) as it enters the tissue. After each propagation step, tance between two scattering events, called the free path-
the photon’s weight is reduced, according to the probability length, is calculated using formula (1):
of absorption. A number of Monte Carlo algorithms based
on these techniques was developed [12–14], including par- − ln()
s= , (1)
allel computations [15]. In order to simulate light transport  a + s
in respect of different absorption and scattering coefficients,
scaling of results from a single Monte Carlo simulation was where  ∈ (0;1) is the uniformly distributed random number,
proposed [16–18]. However, a single Monte Carlo process is and a and s are the absorption and the scattering coeffi-
time consuming, especially with a large source-detector sepa- cients, respectively. If the photon package crosses the bound-
ration, when the considered times of flight of photons are long ary between the media with different optical properties, the
and when the reduced scattering coefficient is large. This long refraction or the reflection is taken into account. At the ini-
computation is the main disadvantage of this method. tial moment, the weight of each photon package is set to 1.
This paper describes optimization of a Monte Carlo algo- The weight decreases at each ith scattering event, according to
rithm in simulation of the time-resolved reflectance. In the the Beer–Lambert law for turbid media, which can be approx-
parts of the code that are most critical for the computation imated by the following formula:
time, approximated logarithmic and trigonometric functions
which allowed to speed up the simulations were used. The s
wi+1 = wi (2)
proposed algorithm was verified by simulations of the time-  a + s
resolved reflectance at several source-detector separations.
The results of the application of the approximated algorithm The photon package is treated as absorbed, when its weight
were compared with the results of the Monte Carlo simula- becomes lower than the prescribed threshold (in our case, the
tions obtained with an exact computation of the logarithm threshold is set to be 10−20 ).
and trigonometric functions and with the solution of the dif- At every scattering event, a new direction of the photon
fusion equation. package movement, represented by the directional cosines, is
determined. Simulation of anisotropic scattering can be done
using the Henyey–Greenstein phase function, which satisfac-
2. Monte Carlo simulations of light torily approximates anisotropic scattering in tissues [19] and
transport in turbid media allows to omit the calculation of the explicit value of the
polar deflection angle [13,11]. Only the cosine of this angle
Photon packages enter the medium under investigation at the needs to be generated using random number  and anisotropy
emission point and are traced until they are absorbed or exit factor g defined as the mean cosine of the scattering angle.
from the medium. The tissue is regarded as a structure con- The azimuthal angle is determined by the random number
sisting of layers parallel to the surface, with a fixed thickness with the uniform distribution in the range [0;2]. In the pre-
and optical properties (a , absorption coefficient; s , scatter- sented simulations, the isotropic scattering is assumed with
ing coefficient; n, refractive index) in each layer. This assump- the cosine of the polar deflection angle represented by the ran-
tion is fulfilled for measurements on head, in which the skin, dom number between −1 and 1.
skull, cerebrospinal fluid and grey matter layers should be con-
sidered. The radial symmetry (around the axis perpendicular
to the surface) of the structure (Fig. 1) allows to assume that the 3. Code optimization
detector forms a ring located around the emission point. Infor-
mation about the time, spent by the photon package in the For further optimization, weighted Monte Carlo code of light
tissue, is collected in respect to each detected photon package. transport in layered media – MCML [13] – was used. In the first
After simulation of many photon packages, the distribution of step the code was modified in such a way that the analysis of
times of flight of photons (DTOF) is calculated. times of the flight of photons is possible. Then the analysis of
the computation was performed, showing that the calculation
of the directional cosines of the azimuthal and polar deflec-
tion angles as well as the free pathlength and generation of the
random numbers were the most time consuming operations.
The tests on MCML code (Table 1) showed that most of the
computation time was taken for calculation of the new photon
package direction after the scattering event (37% of the total
simulation time) and for calculation of the free pathlength of
the photon package (34% of the total simulation time), which is
in agreement with Ref. [14]. These estimations suggest that an
acceleration of Monte Carlo calculations needs faster approx-
Fig. 1 – Layered structure and path of an exemplary photon imations of the logarithmic and trigonometric functions than
package. The azimuthal angle (˛) and polar deflection angle those used in the most programming languages and applica-
(ˇ) at single scattering event are shown. tion of the fastest pseudo-random number generator.
52 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57

was used:
Table 1 – The percentage of the total running time used
by most time consuming computations ⎧  
⎨ a + bx2 + cx4 , for x ∈ 0;  − 0.12
Type of computations The total running time
cos(x) ≈ appcos(x) =  2 
(%) ⎩  − x, for x ∈ − 0.12;

2 2 2
Calculation of new direction after 37.45 (3)
scattering event
Calculation of free pathlength 34.57
Random number generator “ran3” 20.01
The approximating function (3) was found by searching for
Calculation of new position of 6.04
photon package the best fit to the exact values of the cosine function. With
arguments from the range of the (0 to /2 − 0.12) for calculation
Monte Carlo simulations performed for homogeneous semi-infinite of appcos only five floating point operations (three multiplica-
medium (n = 1.4, a = 0.18 cm−1 , and s = 19 cm−1 ).
tions and two additions) are required. At least the same num-
ber of operations is needed, when floating point sine/cosine
calculations are performed using lookup tables [28]. For argu-
Calculation of the new direction of the photon package ments from the range of [/2 − 0.12,/2], the cosine function
after the scattering event requires calculation of trigonomet- becomes better approximated when the linear function is
ric functions of the azimuthal and polar deflection angles. used. An analysis of the relative error of the approximation
Cosine of the polar deflection angle is generated directly from defined by:
the random number and Henyey–Greenstein phase function.
Calculation of the sine is performed using the cosine and the cos(x) − appcos(x)
square root function which, in most computers, is realized by cc = × 100% (4)
cos(x)
the hardware. Though, one cosine of the azimuthal angle has
to be calculated each time when a scattering event occurs. was carried out, showing that the error was less than 1% in the
As it was noticed, the current Java releases (Version 1.4.2 whole range of the arguments. The parameters of the poly-
and higher) are, at least, as fast as the programs written in nomial are as follows: a = 0.999, b = −0.497, and c = 0.0376. The
C/C++ [20,21] in most situations. In the optimization process accuracy of the approximation in the percentage of the exact
described here, the MCML algorithm [13] was rewritten in the values of the cosine function is shown in Fig. 2.
Java programming language using the suggestion given in Ref.
[22], and it was optimized in the most time consuming opera- 3.3. Free path calculation
tions.
In most compilers, implementation of the numerical loga-
3.1. Pseudo-random number generator rithm calculation is based on the polynomial approximation
of degree 14. The maximum error of this polynomial approx-
The pseudo-random number generator chosen here (“ranmar” imation is not larger than 2−58.45 . In our case, for arguments
[23,24]) delivers a sequence of 32-bit floating point pseudo- near zero, values of the logarithmic function are not required
random numbers, uniformly distributed in the interval [0;1). because the smallest non-zero number generated by the “ran-
The period of the generated sequence (2144 ) is longer than the mar” generator is about 5.96e−8. In the interval [5.96e−8;1], an
period needed in the practical Monte Carlo simulation of light approximation of the logarithm using a rational function can
transport. Pseudo-random generator “ran3” [25] used in MCML be applied:
code has a shorter period of 255 . Moreover, “ranmar” is about

12% faster than “ran3” [26]. With this algorithm, several inde- a + cx0.5 + ex
, for x ∈ [5.5e−8; 0.99)
pendent sequences can be initialized and used in the same ln(x) ≈ appln(x)= 1 + bx0.5 +dx + fx1.5
run. This property is especially important for parallelization x − 1, for x ∈ [0.99; 1]
of the algorithm. “Ranmar” gives an identical sequence on all (5)
machines having at least 24-bit mantissas in the floating point
representation, which may be important in comparisons of the
results between the runs performed on different machines.
The algorithm has adequate statistical properties [26], but this
class of generators is known to have poor lattice structures in
high dimensions [27]. Nevertheless, this property is negligible
in the Monte Carlo simulation of light transport because only
one adequate dimensional quality is required.

3.2. Calculation of the cosine of the azimuthal angle

In most programming languages, the cosine function is calcu-


lated using approximation by a 14-degree polynomial, with the
maximum error of 2−58 on the interval [0,/4]. For the approx-
imation of the cosine function polynomial of the order four Fig. 2 – Error of approximation of cosine function.
c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57 53

Table 2 – Parameters of function (5) in approximation of


logarithmic function for different argument values
Parameter x ∈ [5.5e−8;5.61e−3) x ∈ [5.61e−3;0.99]

a −18.7 −8.77
b 1.6e3 15.7
c −1.8e5 −42.3
d 9.3e5 15.2
e −4.8e6 51.0
f 3.5e5 −1.95

The values of the parameters of these approximations are


shown in Table 2. The relative error of the approximation,
defined by ratio:

ln(x) − appln(x)
cl = × 100% (6)
ln(x)

was less than 1% of the exact value of the approximated func-


tion in the whole range of the arguments. The accuracy of this
approximation is illustrated in Fig. 3.

4. Results of the calculation for tissue


models

Two head models were used in the analysis of the distribu-


tion of times of flight of photons: a semi-infinite homogeneous
medium and a two-layered structure simulating brain and the
overlaying tissue (skin).
In both cases, the Monte Carlo code with an exact logarith-
mic and cosine function was compared with the code based
on these function approximations given by formulae (3) and (5)
and with the solution of the diffusion equation [3]. The simu- Fig. 4 – (A) Comparison of DTOFs obtained by Monte Carlo
lated distributions of times of flight of photons were analyzed simulation with (MCa) and without (MC) approximation of
in the interval from 0 up to 2 ns, which allows to consider logarithmic and cosine functions with solution of diffusion
all the values of distribution higher than 0.1% of the maxi- equation (DF). (B) Difference between DTOF obtained by
mal value of DTOF. DTOFs obtained from diffusion equation Monte Carlo simulations with (MCa) and without (MC)
Nd (t) were normalized in such a way that they should fit to the approximation of logarithmic and cosine functions with
results of the Monte Carlo simulations NMC (t), i.e.: solution of diffusion equation (in percents of DTOF values
obtained from diffusion equation). Optical properties of the

t1

t1 medium: a = 0.18 cm−1 , s = 19 cm−1 , and n = 1.4.
Nd (t) = NMC (t), (7)
t0 t0

where t0 = 1 ns and t1 = 2 ns. the Monte Carlo simulation using the approximated logarithm
Comparison of DTOFs obtained by the Monte Carlo sim- and cosine functions and with the solution of the diffusion
ulation using an exact logarithmic and cosine function with equation is shown in Fig. 4 for the homogeneous semi-infinite
medium with assumed optical properties of the skin (n = 1.4,
a = 0.18 cm−1 , and s = 19 cm−1 [29]). The internal radius of
the detection ring was 28 mm and the ring thickness was
4 mm.
The number of the detected photons as a function of the
optical properties is shown in Fig. 5. Comparison of the mean
time of flight and variance of DTOFs is shown in Figs. 6 and 7,
respectively, in respect of different optical properties of the
modeled structure. In Figs. 5A, 6A and 7A, the absorption coef-
ficient was set to 0.1 cm−1 . In Figs. 5B, 6B and 7B, the scattering
coefficient was 10 cm−1 .
A similar analysis was performed for the two-layered
structure. A simplified model of the head was considered,
Fig. 3 – Error of approximation of logarithmic function. containing only the skin layer overlaying the brain tissue.
54 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57

The optical properties of the upper and lower layers were


n = 1.4, a = 0.18 cm−1 , s = 19 cm−1 and n = 1.4, a = 0.33 cm−1 ,
s = 22 cm−1 , respectively, which reflects typical optical prop-
erties of the skin and the brain tissue [29]. The thickness of
the scalp layer was assumed to be 1 cm.
A semi-analytical solution of the diffusion equation for the
two-layered structure was taken from Ref. [14]. Fig. 8 shows the
same level of accuracy for the Monte Carlo simulations. The
difference noted between the solution of the diffusion equa-
tion and the result of the Monte Carlo simulation is quite small
for a long time of flight, when the diffusion equation satisfac-
torily approximates the radiative transport.
Considering the speed of the Monte Carlo simulations (see
Fig. 9), it was found that after approximation of the logarith-
mic and cosine functions the calculations took half of the
time needed without the approximations. Our test reveals that
the Java version of the MCML code, analyzed here, is about
two times faster than the original MCML code. This relation-
ship holds for different numbers of simulated photons as it is
shown in Fig. 9. The original MCML code was compiled using
cygwin gcc with options -march=pentium4 -msse2 -mfpmath=sse
-O3 -s -mno-cygwin. MCML rewritten in Java was compiled with
options -g:none –O and run with option -server. The tests of the
speed were performed on PC computer with Intel Pentium 4,
3 GHz under Windows XP Pro (Microsoft, USA).

Fig. 6 – Mean time of flight of photons (A) for different


values of absorption coefficient and reduced scattering
coefficient fixed to s = 10 cm−1 . (B) For different values of
reduced scattering coefficient and absorption coefficient
fixed to a = 0.1 cm−1 obtained by Monte Carlo simulation
with (MCa) and without (MC) approximation of logarithmic
and cosine functions with solution of diffusion equation
(DF).

The multithreaded version of the code was tested on a par-


allel machine. Although the random number generator does
not give important speeding up in the computation time (see
Fig. 9), each “ranmar” random number generator seed pro-
vides a unique sequence of the pseudo-random numbers. This
feature of the random number generator allows for paral-
lelization of Monte Carlo algorithm. The tests performed on
SUN Enterprise 10,000 with 16 processors show that the par-
allelization gives a linear shortening of the simulation time
depending on the number of the processors, which is in agree-
ment with results obtained in Ref. [15].

5. Discussion

It can be seen that the distributions of times of flight of


Fig. 5 – Normalized number of photons (A) for different photons obtained from the solution of the diffusion equation
values of absorption coefficient and reduced scattering and the Monte Carlo simulation using an exact Monte Carlo
coefficient fixed to s = 10 cm−1 . (B) For different values of simulation and a Monte Carlo simulation with approximated
reduced scattering coefficient and absorption coefficient both the logarithm and the cosine shown in Fig. 4A are
fixed to a = 0.1 cm−1 obtained by Monte Carlo simulation very similar. The observed difference between the simulated
with (MCa) and without (MC) approximation of logarithmic DTOFs is relatively small (Fig. 4B). The differences between
and cosine functions with solution of diffusion equation the moments obtained from the Monte Carlo simulations and
(DF). the diffusion equation are caused by the limited integration
c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57 55

by the digital integration. Because of the noise in the simu-


lated DTOFs, the integration is limited to those values of DTOF
for which the amplitude is larger than 0.1% of the maximum
in the DTOF. This procedure leads to underestimation of the
evaluated moments.
The results of the simulations could be obtained about
four times faster, when the proposed approximations of the
logarithmic and cosine functions were used in the Monte
Carlo algorithm and the code was compiled in Java (Fig. 9).
The Java language, as it was reported in the benchmark
tests comparing the speed of the integer and the floating
point operations of different programming languages and
different compilers [20], is about two times faster than the
C language compiled using the GNU C compiler. The version
of Java used here (v.1.4.2) is much faster than the older one
(v.1.3.1), especially in the arithmetic calculations, but it is
slower in calculations of the trigonometric functions. The fast
approximations of the trigonometric functions proposed by

Fig. 7 – Variance of distribution of times of flight of photons


in homogeneous structure (A) for different values of
absorption coefficient and reduced scattering coefficient
fixed to s = 10 cm−1 . (B) For different values of reduced
scattering coefficient and absorption coefficient fixed to
a = 0.1 cm−1 obtained by Monte Carlo simulation with
(MCa) and without (MC) approximation of logarithmic and
cosine functions with solution of diffusion equation (DF).

range for the calculation of the moments, which may lead


to different results for DTOFs of different signal to noise
ratio [3]. Also the inaccurate approximation of the radiative
transfer by the diffusion equation for short times of flight
of photons contributes to the observed discrepancies. The
differences between the solution of the diffusion equation
and the Monte Carlo simulations are larger when the absorp-
tion coefficients are high (a  0.3 cm−1 ) in comparison with
the reduced scattering coefficient (Figs. 5A, 6A and 7A),
i.e. in conditions which do not match with the diffusion
approximation assumptions (s  a ). Similarly, such large
differences can be noted also when the scattering coefficients
are small (s  5 cm−1 ) in comparison with the absorption
coefficient (Figs. 5B, 6B and 7B). In these cases, the diffusion
equation fails to describe properly the light transport in Fig. 8 – (A) Comparison of DTOFs obtained by Monte Carlo
tissue. simulation with (MCa) and without (MC) approximation of
The differences noted between the moments of the DTOFs logarithmic and cosine functions with solution of diffusion
(the mean time of flight and variance) obtained from the equation (DF). (B) Difference between DTOF obtained by
Monte Carlo simulations and the diffusion equation may be Monte Carlo simulations with (MCa) and without (MC)
caused by the limited integration range for calculation of the approximation of logarithmic and cosine functions with
moments. The mean time of the flight and the variance of solution of diffusion equation (in percents of DTOF values
DTOF of photons were obtained analytically from the diffusion obtained from diffusion equation). Optical properties:
theory, using the assumed absorption and reduced scatter- n = 1.4, a = 0.18 cm−1 , and s = 19 cm−1 in upper layer of
ing coefficients [3]. In the analysis of DTOFs obtained from thickness 1cm, and n = 1.4, a = 0.33 cm−1 , and s = 22 cm−1
the Monte Carlo simulations, the moments were calculated in lower infinite compartment.
56 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57

6. Conclusions

Optimization of the crucial elements of the Monte Carlo simu-


lation of light transport in layered tissues has been presented.
Approximation of the trigonometric and logarithmic functions
by polynomial and rational functions with errors less than 1%
of the original functions together with the use of the fast ran-
dom number generator and the Java programming language
provides shortening of time of the simulations by a factor
of four. An adequate accuracy of the optimized Monte Carlo
code was confirmed by the simulations performed in the semi-
infinite and layered models with the optical properties typical
of living tissues. The speed of the code on parallel machines
Fig. 9 – Comparison of computation time of Monte Carlo is directly proportional to the number of the processors used,
simulations performed for homogeneous semi-infinite which may lead to an additional reduction of the computation
medium (n = 1.4, a = 0.18 cm−1 , and s = 19 cm−1 ). MC, time.
simulation without optimizations; MCr, simulation without
optimizations with “ranmar” random number generator;
MCj, simulation without optimization, code compiled in
Acknowledgment
Java with “ranmar” random number generator; MCc, code
This study has been partly supported by research project num-
with optimized cosine function; MCl, code with optimized
ber 3T11E00627 financed by the State Committee for Scientific
logarithmic function; MCa, full optimization.
Research of Republic of Poland.

references
us allowed to compensate for this property of the new Java
version.
If a higher accuracy is required, it is possible to approximate
[1] J. Steinbrink, H. Wabnitz, H. Obrig, A. Villringer, H.
the cosine function by a polynomial of order 6 or 8. In these
Rinneberg, Determining changes in nir absorption using a
cases, the approximation error is lower than 0.01% and 0.001% layered model of the human head, Phys. Med. Biol. 46 (2001)
of the cosine value, respectively. The logarithmic function can 879–896.
be approximated by a more complicated rational function in [2] M.H. Niemz, Laser-tissue Interactions: Fundamentals and
the form of Applications (Biological and Medical Physics, Biomedical
Engineering), Springer-Verlag, 2003.
⎧ [3] A. Liebert, H. Wabnitz, D. Grosenick, M. Moller, R. Macdonald,

⎨ a + cx 0.5 + ex + gx1.5 + ix 2+ kx 2.5 , for x ∈ [5.5e − 8; 0.01)
0.5 1.5 2 2.5
H. Rinneberg, Evaluation of optical properties of highly
1 + bx + dx + fx + hx + jx
scattering media by moments of distributions of times of

⎩ a + cx 0.5 + ex + gx1.5 ,
0.5 1.5
for x ∈ [0.01; 1) flight of photons, Appl. Opt. 42 (28) (2003) 5785–5792.
1 + bx + fx + hx
[4] E. Okada, M. Firbank, M. Schweiger, S.R. Arridge, M. Cope,
(8)
D.T. Delpy, Theoretical and experimental investigation of
near-infrared light propagation in a model of the adult head,
Appl. Opt. 36 (1997) 21–31.
For this approximation, the error is not larger than 0.2% of [5] J.M. Maarek, G. Jarry, B. de Cosnac, A. Lansiart, H. Bui Mong,
the logarithm value in the interval [5.9e−8;1]. These more time A simulation method for the study of laser transillumination
of biological tissues, Ann. Biomed. Eng. 12 (3) (1984) 281–304.
consuming approximations are still faster than the original
[6] S.T. Flock, M.S. Patterson, B.C. Wilson, D.R. Wyman, Monte
calculation of the logarithm and cosine functions in the Java
carlo modeling of light propagation in highly scattering
language. tissue. i. Model predictions and comparison with diffusion
We developed a fast Monte Carlo code for which the errors theory, IEEE Trans. Biomed. Eng. 36 (12) (1989) 1162–1168.
of the analyzed moments of the simulated DTOFs are less than [7] A.H. Hielscher, R.E. Alcouffe, R.L. Barbour, Comparison of
2% for a range of optical properties, typical of living tissues. finite-difference transport and diffusion calculations for
Speed of this code is very important in many applications. photon migration in homogeneous and heterogeneous
tissues, Phys. Med. Biol. 43 (1998) 1285–1302.
A fast calculation of the sensitivity factors used to estimate
[8] S. Prahl, Light transport in tissue, Ph.D. Thesis, University of
changes in absorption coefficients in layered media [30] or for
Texas, Austin, 1998.
inverse problems and tomographic reconstructions [31–33] of [9] J.S. Hendricks, T.E. Booth (Eds.), Mcvp Variance Reduction
the optical properties of the non-homogeneous medium may Overview, Springer-Verlag, New York, 1983.
be crucial for a success of these techniques in clinical appli- [10] H. Kahn, Random sampling monte carlo techniques in
cations. The proposed here approximations affected only the neutron attenuation problems, Nucleonics 6 (1950) 27–37,
main engine of the code-calculation of the photon package 61–65.
[11] A.N. Witt, Multiple scattering in reflection nebulae. i. A
trajectory. Thus, such approximations can be applied also in
monte carlo approach, Astrophys. J. S35 (1977) 1–6.
the codes in which fluorescence [34] or the Doppler scattering [12] D.A. Boas, J.P. Culver, J.J. Stott, A.K. Dunn, Three dimensional
[35] are considered. monte carlo code for photon migration through complex
c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e 8 4 ( 2 0 0 6 ) 50–57 57

heterogeneous media including the adult human head, Opt. [25] D.E. Knuth, The art of computer programming,
Express 10 (3) (2002) 159–170. Addison-Wesley, Reading, Massachusetts, 1981.
[13] L. Wang, S.L. Jacques, l. Zheng, Mcml—monte carlo [26] I. Vattulainen, K. Kankaala, J. Saarinen, T. Ala-Nissila, A
modeling of light transport in multi-layered tissues, comprehesive study of some pseudorandom number
Comput. Methods Programs Biomed. 47 (1995) 131– generators, Comput. Phys. Commun. 86 (1995) 209–226.
146. [27] S. Tezuka, P. L’Ecuyer, R. Couture, On the lattice structure of
[14] L. Wang, S.L. Jacques, Monte Carlo Modeling of Light the add-with-carry and subtract-with-borrow random
Transport in Multi-layered Tissues in Standard c, University number generators, ACM Trans. Comp. Sci. 3 (4) (1993)
of Texas, Texas, 1992. 315–331.
[15] A. Colasanti, G. Guida, A. Kisslinger, R. Liuzzi, M. Quarto, P. [28] R. Davies, Really fast x86 floating point sin/cos.
Riccio, G. Roberti, F. Villani, Multiple processor version of a http://www.musicdsp.org/showone.php?id=158, 2003.
monte carlo code for photon transport in turbid media, [29] E. Okada, D. Delpy, Near-infrared light propagation in an
Comp. Phys. Commun. 132 (1) (2000) 84–93. adult head model. I. Modeling of low-level scattering in the
[16] R. Graff, M.H. Koelink, F.F.M. deMul, W.G. Zijlstra, C.M. cerebrospinal fluid layer, Appl. Opt. 42 (16) (2003) 2906–2914.
Dassel, J.G. Aarnoudse, Condensed monte carlo simulations [30] A. Liebert, H. Wabnitz, J. Steinbrink, H. Obrig, M. Moller, R.
for the description of light transport, Appl. Opt. 32 (4) (1993) Macdonald, A. Villringer, H. Rinneberg, Time-resolved
426–434. multidistance near-infrared spectroscopy of the adult head:
[17] A. Kienle, M.S. Patterson, Determination of the optical intracerebral and extracerebralabsorption changes from
properties of turbid media from single monte carlo moments of distribution of times of flight of photons, Appl.
simulation, Phys. Med. Biol. 41 (1996) 2221–2227. Opt. 43 (15) (2004) 3037–3047.
[18] A. Pifferi, P. Taroni, G. Valentini, S. Anderson-Engels, [31] S.R. Arridge, J.C. Hebden, Optical imaging in medicine. Ii.
Real-time method for fitting time resolved reflectance and Modelling and reconstruction, Phys. Med. Biol. 42 (5) (1997)
transmittance measurements with a monte carlo model, 841–853.
Appl. Opt. 37 (13) (1998) 2774–2780. [32] C.K. Hayakawa, J. Spanier, F. Bevilacqua, A.K. Dunn, J.S. You,
[19] M.J.C. VanGemert, S.L. Jacques, J.C.M. Sterenborg, W.M. Star, B.J. Tromberg, V. Venugopalan, Perturbation monte carlo
Skin optics, IEEE Trans. Biomed. Eng. 36 (12) (1989) methods to solve inverse photon migration problems in
1146–1154. heterogeneous tissues, Opt. Lett. 26 (17) (2001) 1335–1337.
[20] C.W. Cowell-Shah, Nine language performance round-up: [33] P. Kumar, R.M. Vasu, Reconstruction of optical properties of
benchmarking math and file i/o, OSNews, 2004, low-scattering tissue using derivative estimated though
(http://www.osnews.com/story.php?news id=5602). perturbation monte-carlo method, J. Biomed. Opt. 9 (5)
[21] S.R. Ladd, Linux Number Crunching: Benchmarking (2004) 1002–1012.
Compilers and Languages for ia32, Coyote Gulch [34] J. Swartling, A. Pifferi, A.M.K. Enejder, S. Anderson-Engels,
Productions, 2003. Accelerated monte carlo models to simulate fluorescence
[22] J. Bloch, Effective Java Programming Language Guide, spectra from layered tissues, J. Opt. Soc. Am. 20 (4) (2003)
Addison-Wesley Professional, 2001. 714–727.
[23] G. Marsaglia, A. Zaman, Toward a Universal Random [35] F.F.M.d. Mul, W. Steenbergen, J. Greve, Doppler monte carlo
Number Generator, Florida State University, 1987. simulations of light scattering in tissue to support
[24] F. James, A review of pseudorandom number generators, laser-doppler perfusion measurements, Technol. Health
Comput. Phys. Commun. 60 (1990) 329–344. Care 7 (2–3) (1999) 171–183.

You might also like