betaFeedback

WorksComputer Science

Meshless Monte Carlo Radiation Transfer Method for Curved Geometries using Signed Distance Functions

Abstract

Significance: Monte Carlo radiation transfer (MCRT) is the gold standard of modeling light transport in turbid media. Typical MCRT models use voxels or meshes to approximate experimental geometry. A voxel based geometry does not allow for the accurate modeling of smooth curved surfaces, such as may be found in biological systems or food and drink packaging. Aim: We present our algorithm which we term signedMCRT (sMCRT), a new geometry-based method which uses signed distance functions (SDF) to represent the geometry of the model. SDFs are capable of modeling smooth curved surfaces accurately whilst also modeling complex geometries. Approach: We show that using SDFs to represent the problem's geometry is more accurate and can be faster than voxel based methods. sMCRT, can easily be incorporated into existing voxel based models. Results: sMCRT is validated against theoretical expressions, and other voxel based MCRT codes. We show that sMCRT can accurately model arbitrary complex geometries such as microvascular vessel network using SDFs. In comparison to the current state-of-the-art in MCRT methods specifically for curved surfaces, sMCRT is up-to forty-five times more accurate. Conclusions: sMCRT is a highly accurate, fast MCRT method that outperforms comparable voxel based models due to its ability to model smooth curved surfaces. sMCRT is up-to three times faster than a voxel model for equivalent scenarios. sMCRT is publicly available at https://github.com/lewisfish/signedMCRT

Introduction

The modeling of light transport is important to our understanding of how light interacts with turbid media. It allows us to make predictions of the viability of treatment modalities [1, 2], simulate the behavior of complex shaped light in highly scattering media [3], retrieve images of objects in highly scattering media [4] and optimize light sensors in the food and drink industry [5] among other applications. The current "gold standard" of modeling light transport in turbid media is the Monte Carlo radiative transfer (MCRT) method. MCRT can model light transport in arbitrary 3D geometries and model several micro-physics phenomena such as Raman scattering [6, 7], fluorescence [8, 9], polarization [10, 11, 12], and has been applied to problems ranging from light propagation in dynamic fluid systems [13, 14] to simulating thermal gradients in illuminated tissue [15, 16].

In order to simulate the transport of light through a medium, the geometry of the problem must modeled. Most Monte Carlo codes rely on voxels [17, 18, 19], or meshes [20, 21] to approximate the geometry of the problem. Voxel models are only suitable for the simplest problems that do not require accurate treatment of curved surfaces, due to their cubic nature [22]. Curved surfaces arise in many problems where MCRT maybe used, for example the propagation of light through: an optical system, the anatomy of animals or humans such as the brain or vascular networks, among many other possible examples. In contrast, mesh based models can accurately treat curved surfaces but usually require specialist software to create high quality meshes which can also be computationally expensive to produce, and MCRT codes require extensive software engineering to incorporate meshes in a computationally efficient manner.

A number of previous methods have been introduced to tackle the problem of smooth surfaces in voxel based models. Tran and Jacques preprocessed the voxels to determine where the material interfaces are, and computed surface normals for each voxel which can then be smoothed via interpolation to create curved surfaces [23]. Whilst this method, on the whole, accurately models curved surfaces, it can have an increased memory footprint, and is more computationally intensive. Alternatively, implicit surfaces can be defined using mathematical formulae [24, 25]. However, while this method of defining mathematical surfaces allows the modeling of smooth surfaces, it has the drawback that each surface needs an accompanying intersection and surface normal routine which can be computationally costly to evaluate and increases the workload on the programmer.

In this work, we present a novel Monte Carlo radiative transfer model where we eschew the common voxel or mesh based approaches for an approach based upon signed distance functions (SDFs), which we call signedMCRT (sMCRT). SDFs have been commonly used to define implicit surfaces in computer graphics [26], video games [27], and computer vision [28]. Recently, there has been considerable interest in using neural networks to define SDFs from point clouds and meshes. This interest has been led by computer graphics and deep learning researchers, looking for memory efficient representations of meshes and/or point clouds at high spatial resolutions [28, 29, 30].

SDFs allow the efficient transport of photon packets through the modeled geometry using sphere tracing, which is faster, in most cases, compared to traditional ray tracing methods used in MCRT [26]. SDFs, while being similar to the approach of mathematical surfaces, do not need individual intersection routines as they are naturally included in the SDF definition. Moreover, we can use numerical differentiation to provide the surface normals. SDFs also require little effort to incorporate into existing voxel based codes, requiring tweaks to the optical depth integration and geometry initialization routines. These features of SDFs make them an attractive alternative to voxel models.

We show in this paper that sMCRT is more malleable and accurate the traditional voxel models for curved surfaces and more accurate than current solutions (by up-to 45 times more accurate) to the voxel discretization problem. Moreover, we demonstrate that sMCRT is faster (for certain problems) than MCRT. MCRT can be faster, or slower than traditional voxel based methods depending on the output required. When MCRT is used to retrieve the intensity at each point of a volume of interest, there is fractional increase in runtime of sMCRT (up-to 0.6 times slower) when compared with a traditional voxel based code. However, for problems where the desired output is only the light distribution at a single plane of interest, then sMCRT is fractionally faster than the traditional voxel-based methods (up-to 3 times faster).

Methods

Monte Carlo Radiation Transfer Algorithm

The radiation transfer equation (RTE) describes the transfer of energy in a medium. However, analytical solutions for the RTE only exist for simple geometries. Therefore, numerical methods such as the diffusion method [31] or the Monte Carlo radiation transfer method (MCRT) must be used to compute a solution.

MCRT uses interaction probabilities and probability distribution functions that describe the physics of light transport, to model light transport though turbid and non-turbid media. Each photon is propagated a distance τ/μt\tau/ \mu_t, where τ\tau is the optical distance [-] and μt\mu_t [cm−1^{-1}] is the extinction coefficient, before it interacts with the medium. The value of τ\tau is sampled from the probability distribution function for the mean free path of a photon using the Monte Carlo method [17], as shown in Equation 1, where ξ\xi is a random number drawn in the range [0,1][0, 1]. For voxel models the extinction coefficient can differ from voxel to voxel. MCRT is highly accurate (as the number of photons simulated tends to infinity) and can be used to model the light transport in arbitrary 3D geometries provided these geometries can be modeled.

τ=−log⁡(ξ)(1)\tau= -\log(\xi) \tag*{(1)}

The MCRT code presented in this work is broadly based upon previous MCRT codes used in various astronomical, medical, and bio-photonics applications [3, 32, 33, 34]. We use the same routines for releasing photons, input/output, scattering, random number generation, and helper routines. What differs in this work is the optical depth integration routine, and the geometry modeling method, which are accomplished by the use of signed distance functions.

Signed Distance Functions

Signed distance functions determine the distance from a point pp, to the boundary of a specified shape. The function returns a positive value if pp is outside the boundary, and a negative value if inside the boundary. Formally, this can be described using level set representation. In level set representation contours are modeled at the zero-level set (ϕ=0\phi= 0) of a function defined in a higher dimension. Let Φ:Ω→R3\Phi: \Omega\to\mathbb{R}^{3} be a Lipchitz function that refers to a level set representation for a given shape SS [35] then:

ΦS(x,y,z)={0,(x,y,z)∈S+D((x,y,z),S)>0,(x,y,z)∈RS−D((x,y,z),S)<0,(x,y,z)∈[Ω−RS](2)\Phi_{S}(x,y,z) = \begin{cases} 0, & (x,y,z) \in S \\ +D((x,y,z),S) > 0, & (x,y,z) \in\mathcal{R}_{S} \\ -D((x,y,z),S) < 0, & (x,y,z) \in[\Omega-\mathcal{R}_{S}] \end{cases} \tag*{(2)}

An example of an SDF is shown in Equation 4 for a sphere, where rr is the radius of the sphere, and pp is the position of a photon:

Dsphere(x,y,z)=∣p∣−r(3)D_{\mathrm{sphere}}(x,y,z) = |p| - r \tag*{(3)}
p=[x,y,z](4)p = [x,y,z] \tag*{(4)}

SDFs can easily be translated, rotated, twisted and scaled among many other operations. Constructive solid geometry (CSG) operations such as union, intersection and difference can also be used on the SDFs. Figure 1 shows a subset of shapes, and possible operations on SDFs [36, 37].

Image not extracted

Figure 1. Several examples surfaces that can be created by SDFs, rendered in Blender. For illustrative purposes, SDFs are voxelized in sMCRT then transformed to a mesh using Skimage’s [38] marching cubes algorithm and then rendered using Blender [39]. The left two panels show a subset of basic shapes calculated using SDFs (a to d and j to m). The right two panels show a subset of possible operations on SDFs: smooth (e) and non-smooth union (f), intersection (g), subtraction (h), repetition (i), displacement (n), elongation (o), bend (p), and twist (q).

MCRT SDF Algorithm

To incorporate SDFs into a pre-existing voxel based MCRT code, requires only relativity small adjustments: modifications to the geometry initialization routine, and to the optical depth integration routine. An overview of the complete MCRT algorithm is shown in the left panel of Figure 2.

To create the geometry in voxel based models, each voxel is independently assigned a set of optical properties (scattering and absorption coefficients, refractive index, and anisotropy gg value). In sMCRT the geometry is initialized by selecting the functional form, size, and location of SDF(s) required to model the problem, applying any CSG operations required to generate more complex shapes, and finally setting the optical properties for each SDF. Each SDF has its own set of optical properties, which include scattering and absorption coefficient, refractive index and the anisotropy gg value. We then create a bounding box around all the SDFs, which gives us a simulation volume of interest.

In voxel based MCRT codes, each photon packet is randomly ascribed a specific optical path length that it travels before an interaction, such as scattering or absorption, according to Equation 1 and is scaled by μt\mu_t (μt\mu_t can be different for each voxel). The photon packet is then propagated through the voxel grid using ray tracing until it reaches that interaction point or leaves the voxel grid.

In our SDF based MCRT algorithm, the first step in the SDF optical depth integration routine is the same as in the voxel case, i.e. randomly assign an optical depth. As before, this is calculated using Equation 1 and μt\mu_t can be different for each SDF. The next step is to acquire the distance from the current position of the photon packet to the nearest boundary. This is computed by using the SDFs to calculate the distance to each boundary in the modeled geometry, and taking the minimum value (dsdfd_{sdf}). This process is called sphere tracing [36], and is illustrated in Figure 3.

Image not extracted

Figure 3. Example of sphere tracing. Starting a position PP, the photon is propagated by a step size, ss (represented here by the blue circle), equal to the distance to the nearest surface (red line) until the step size is under some threshold δ\delta.

If the remaining optical depth for the photon packet is less than dsdfd_{sdf}, the photon packet undergoes some interaction, and the optical depth integration routine restarts. If the optical depth is not reached, then we move the full distance dsdfd_{sdf}, and then recalculate the distances to all boundaries. If the SDF of the bounding box returns a positive value we are outside the volume of interest, so we terminate the packet and start a new packet.

If the SDF for the bounding box returns a negative value, we then check if the smallest distance, dsdfd_{sdf}, is less than some threshold, δ\delta. In this case, the photon packet is on a boundary so we need to check if there is a change in refractive index. If there is a change in refractive index we calculate the Fresnel coefficients and the surface normals, then reflect or refract the photon packet. If dsdfd_{sdf} is larger than δ\delta, and all distances to the SDFs are not positive then we start this whole process again until one of the exit conditions has been met. The above algorithm is shown in the right panel of Figure 2.

Results and Discussion

Validation

To ensure that our novel SDF-based geometry method works accurately, we validate our algorithm against a theoretical expression, and two other MCRT codes. All simulations are fully parallelized with OpenMP and were run on a workstation with an AMD Ryzen 9 3950X 16-Core Processor with 64 GB RAM utilizing the full 32 threads available.

We first compare sMCRT’s accuracy by computing the average number of scattering events occurring to a photon in an isotropic sphere [40].

For a photon’s random walk from the center to the edge of a uniformly scattering sphere of radius rr, the average number of scatterings that take place can be written as (see Supporting Information):

N≈τ22+τ(5)N \approx\frac{\tau^2}{2}+\tau \tag*{(5)}

To compare Equation 5 to sMCRT, we model a sphere of radius 0.5 cm, vary the radial optical depth between 0.1 and 100, and release 10 million photons isotropically from its center. The agreement of the code and analytical expression can be seen in Figure 4.

Image not extracted

Figure 4. Agreement of analytical expression (Equation 5) and sMCRT for several optical depths in the range [0.01, 100]. Photons are released from the center of an isotropic scattering sphere. The optical density (scattering coefficient) is varied and the average number of scattering per photon packet is recorded.

We also validated sMCRT against our previous voxel based MCRT code [3, 15, 41], and S. Jacques et al. MCRT code [42]. We validate against S. Jacques code as it incorporates all the relevant physics we need in an MCRT code; scattering, absorption, and refractive index mismatches.

Image not extracted

Figure 2. Flow diagram of an MCRT code (left). Right panel shows the additional steps needed to incorporate signed distance functions into the optical depth integration routine which governs the movement of photon packets through the simulated media.

For this validation, the medium is set up as a semi-infinite slab and light is uniformly incident on the surface of the slab (negative zz direction) and propagates until it is absorbed or escapes via the top surface (positive zz direction). We then fit against Equation 6 to compare between codes.

Ψ(z)=Ψ0(C1e−(zk1/δ)−C2e−(zk2/δ))(6)\Psi(z) = \Psi_0\left(C_1 e^{-\left(z k_1/\delta\right)} - C_2 e^{-\left(z k_2/\delta\right)}\right) \tag*{(6)}

Here Ψ(z)\Psi(z) is the penetration of the incident light or equivalently the fluence rate [W cm−2^{-2}], Ψ0\Psi_0 is a normalization constant [W cm−2^{-2}], CnC_n and knk_n are fitted coefficients [-], and δ\delta is the optical penetration depth, defined as δ=13μa(μa+μs(1−g))\delta= \frac{1}{\sqrt{3\mu_a(\mu_a+\mu_s(1-g))}} [cm]. The optical properties for the slab are shown in Table 1, where we use the Henyey-Greenstein phase function [43] with a gg of 0.9, and we model two wavelengths in separate simulations. The refractive index for the medium was set to 1.38 to mimic the rat skin used in S. Jacques code [42], and for the surrounding medium a refractive index of 1.0 was set, to mimic air.

Wavelength [nm]μa\mu_a [cm−1^{-1}]μs(1−g)\mu_s(1-g) [cm−1^{-1}]C1k1C2k2δ\delta [cm−1^{-1}]
4201.8825.761.001.3110.20.047
6300.23216.271.001.1814.40.261

Table 1. Table of optical properties and determined coefficients from Jacques et al. [42].

As evidenced in Figure 5, sMCRT gives a better match to the results in S. Jacques et al. work than our previous voxel model. An exact match is not possible, due to the difference in the code underlying workings such as cylindrical fluence bin shape used by S. Jacques et al. versus our rectangular bin shape. sMCRT is more accurate than the voxel model at 420 nm as it incorporates the left hand-side of the peak near the surface whereas the voxel model levels off after the peak fluence value.

Image not extracted

Figure 5. Validation of sMCRT against our previous voxel based model, and S. Jacques et al. MCRT model. The simulation medium is a semi-infinite slab (infinite in the xx and yy dimensions), and has the optical properties as in Table 1. The medium is uniformly illuminated via the top surface, i.e. is incident from the left of this figure.

Comparing Voxel Models and sMCRT

In this section we compare the accuracy and speed of a voxel based MCRT code to that of our new SDF based MCRT code, sMCRT. We devise two tests based upon speed and accuracy.

The first test is a simple test of modeling a smooth surface: for this we use the test case in Tran and Jacques surface normal approach [23]. They model a glass sphere (refractive index 1.46) and let a beam of light, with a waist of 0.3 cm, be incident on the sphere (in the negative zz direction). Figure 6 shows a slice of the fluence through the sphere for sMCRT, a voxel based MCRT code, and Tran and Jacques code.

Image not extracted

Figure 6. Comparison of simulation accuracy between voxel, A.P Tran and S. Jacques surface normal approach [23] interpolation method and sMCRT models. A glass sphere (red circle) with refractive index 1.46 and radius 1.0 cm is placed at the (0.5, 0.0, -1.0) cm of the simulated medium. Light is incident on the top surface of the sphere with a beam radius of 0.3 cm. Figure shows a slice of fluence though the center of the medium for the voxel model (top-left), surface normal approach (top-middle), sMCRT (top-right), and the difference between sMCRT and the surface normal approach along the gray lines in top right two panels (bottom-row). This clearly shows that the voxel geometry cannot model curved surfaces and their reflections and refractions. The surface normal approach allows semi-accurate modeling, whereas the sMCRT model can model these reflections and refractions with greater accuracy.

Here the voxel model (top right panel) does not exhibit the expected reflection and refraction of light due to the lack of smooth surfaces in the modeled geometry. The sphere is discretized onto a voxel grid which only has flat surfaces, leading to the lack of accurate refractions/reflections. In comparison sMCRT model (top left panel) accurately replicates the refractions/reflections at the glass/air boundary.

The surface normal approach (bottom left panel) shows an improvement on the basic voxel model alone, it still suffers from inaccuracies. These inaccuracies, as evidenced from the missing reflections and refractions, arise from their model still being based upon voxels. They interpolate the surface normals at the refractive index mismatches, however this new virtual surface is not in the correct place for accurate reflections and refractions due to discretization errors.

The difference in accuracy between the surface normal approach and sMCRT can be seen in the lower row of Figure 6, which shows a line profile across each of the reflected and refracted beams for the two approaches. The beam profiles produced by sMCRT exhibit a reduction in the root mean square deviation from the expected beam profile by a factor of 10 for the reflected beam and by a factor of 45 for the refracted beam, when compared to the surface normal approach.

sMCRT also outperforms the surface normal approach on speed for this test case. sMCRT took on average 61 seconds to run ∼27\sim27 million photons compared to 250 seconds for the surface normal approach. The speedup factor here is 4. Both codes were run on the full 32 threads available on our workstation.

The second test is a comparison of speed between the SDF and voxel models. Here we use the same setup from the validation section, an isotropic scattering sphere which releases photons isotropically from its center. We vary the scattering coefficient and time the simulation for 10 million photons. As shown in Figure 7, the SDF model is up to 3 times faster when run on the same workstation.

Image not extracted

Figure 7. Comparison of speed between voxel and SDF based MCRT models. The time taken for the calculation of 10 million photon trajectories was recorded for a variety of optical depths.

This however may not be representative of the true speed difference between the SDF and voxel models in real use scenarios. In another test, we calculated the average number of scatterings per photon, which requires no fluence computation and thus no grid to record fluence. The most common use of MCRT codes is to compute the fluence throughout the simulated medium. The voxel model provides this with little extra computation. However, sMCRT needs no such grid, so the introduction of a fluence counting grid will slow down the simulation. We therefore, test the two models whilst computing the fluence for two different scenarios: the S. Jacques validations case, and the aforementioned isotropic sphere test. Table 2 summarizes the results of these tests. For the S. Jacques et al. validation case, we use the same geometry as before and a fluence grid of size 200 ×\times 200 ×\times 400 voxels for both the SDF and voxel models. We run 10 million photons and use 32 threads on our workstation for both models. The isotropic sphere test was run for 1 million photons and a grid of 2003200^3 voxels for both the SDF and voxel models. The radial optical depth of the sphere was set to 100.

TestModelTime [s]Speedup
S. Jacques ValidationsMCRT33.730.60
S. Jacques ValidationVoxel20.371.0
Isotropic spheresMCRT75.760.73
Isotropic sphereVoxel55.591.0

Table 2. Timings of the SDF and voxel models for the S. Jacques et al. validation case and the isotropic sphere test. Time is the average of three runs using the same seed, and the speedup is relative to the voxel model case for both tests.

The results show that the sMCRT is slower than the voxel model for both test cases by a factor of ≈1.5\approx1.5. It should be noted that sMCRT is a new code, whereas the voxel model has had several years of development and optimizations applied to it, meaning that sMCRT could reach the same level of performance as the voxel model with a similar effort applied. sMCRT does however, give more accurate results for both of these problems at the expense of speed.

Complex Geometry

SDFs can be used in place of current voxel based geometries as they offer increased accuracy in the modeling of complex geometries, as well as the accurate treatment of smooth surfaces. We have recently used sMCRT in our simulations of Raman spectroscopy of alcoholic beverages through glass bottles [44]. Accurate modeling of a bottle in a voxel geometry was not possible, as this did not allow accurate reflection/refractions at the glass/air and glass/alcohol interfaces. The lack of these accurate reflections meant a massive decrease in the accuracy of the simulation of the light distribution in the bottle, as the bottle acts as a cylindrical lens on the light, see SI 8.

Image not extracted

Figure 8. Comparison of fluence for the voxel model and sMCRT model in a glass bottle. Left panel shows the voxel model. Right panel shows the sMCRT. Both panels show the cross section of the bottle. This shows clearly that the voxel model cannot accurately model reflections/refraction in an experiment with curved surfaces, as it shows discretized reflections and refractions, whilst sMCRT shows the expected continuum of reflections and refractions. For this example the optical properties are set for the contents μs=2.5 cm−1\mu_s=2.5\ \mathrm{cm}^{-1}, μa=0.01 cm−1\mu_a=0.01\ \mathrm{cm}^{-1}. The glass has no scattering and has the same absorption coefficient. The refractive index of the glass is 1.5 and 1.3 for the contents. Both the glass and contents of the bottle have a gg value of 0.7. The bottles radius is 1.75 cm, and the glasses thickness is 0.2 cm

Thus far we have shown that sMCRT can model simple geometries, so to demonstrate that sMCRT can model complex shapes, we model a blood vessel network embedded in tissue, and show that sMCRT can model arbitrary SDF generated neural networks, such as DeepSDF or SIREN, see SI Figure 1.

The vessels are a 3D synthetic microvascular network from data published in [45] and preprocessed by Yuan et al. [46]. We model the slab of tissue using a box SDF (second shape in bottom left panel of Figure 1), and the vessels as a collection of capsule SDFs (third shape in top left panel of Figure 1) which are then joined together using the CSG operator union (bottom left operation in top right panel of Figure 1). The simulation volume is 326×305×611 μm3326 \times305 \times611\ \mu\mathrm{m}^3 and we use a voxel grid of 4003400^3 to record the fluence. The optical properties of the slab of tissue and the vessels are taken from [18], and are shown in Table 3. The slab is uniformly illuminated on its top surface by 10 million photons, which are allowed to propagate until they are absorbed or leave the simulated medium. Figure 9 shows the fluence on the vessel network, and slices of fluence through the tissue slab.

Image not extracted

Figure 9. Fluence and absorption images for the vessel network. Light is uniformly incident on the x-y plane of a slab of tissue with an embedded vessel network. Top left panel shows the 3D fluence for the vessel network with tissue’s fluence removed for clarity, arrow indicates direction of incident light. Top right shows a slice through the fluence for the tissue and vessels in the y-z plane. Bottom left shows a slice though the fluence for the vessels in the y-z plane. Bottom right shows a slice of absorption for the tissue and vessels on the y-z plane.

Absorption μa\mu_a [cm−1^{-1}]Scattering μs\mu_s [cm−1^{-1}]gn
Skin0.4593570.91.38
Vessels23194.00.91.38

Table 3. Table of optical properties for the tissue and vessel network.

Conclusion and Outlook

We have shown a novel meshless, geometrical method for Monte Carlo radiation transport, using signed distance functions. SDF based models achieve higher accuracy than voxel based models, particularly for modeling smooth surfaces, such as computing fluence in droplets or accurate modeling of human anatomy for light transport calculations. For problems where the detection of photons is the key measurement and the calculation of light distribution is not, SDFs allow the acceleration of MCRT simulations.

Therefore, SDFs offer an improvement on voxel based models, whilst retaining high accuracy and ease of implementation. However, there are a number of potential downsides to using SDFs.

In certain configurations the number of steps needed to be taken by a photon packet can be extremely large, see SI Figure 3. This occurs when the photon is approximately parallel to a surface whilst the distance between the photon and the surface is small. Recent work has been undertaken to alleviate this problem. This includes segment tracing which accelerates the sphere tracing method by improving the marching step computation and enhanced sphere tracing which uses an over-relaxation-based method for accelerating sphere tracing [47, 48].

Large collections of SDFs can also cause massive slow downs due having to evaluate every SDF each time the photon needs to be moved. This is analogous to the same issue in Monte Carlo models which use triangular meshes. As in the triangular mesh case, this can be diminished by using a space-partitioning data structure.

The final potential downside is the combination of multiple CSG operations can lead to non-bounded SDFs. Non-bounded SDFs can pose a problem in terms of accuracy and speed [49]. In terms of speed, non-bounded SDFs only give a conservative distance to the surface, resulting in more SDF evaluations which can cause computational slow down. The accuracy problem only affects the computation of surface normals, and is therefore only applicable at refractive index interfaces.

Despite these potential downsides, we envision MCRT codes using SDFs to model the geometry to probe problems such as: effect of skin color on pulse oximetry accuracy, fluence calculation of droplets with viral loads such as Covid-19, and accurate simulations of light propagation in fruit. In these problems, using SDF over voxels would allow accurate modeling of curved surfaces allowing better accuracy in the simulations.

Disclosures

Funding: The work was supported by funding from the UK Engineering and Physical Sciences Research Council (EP/P030017/1 and EP/R004854/1) and the H2020 FETOPEN project “Dynamic” (EC-GA 863203).

Data, Materials, and Code Availability

All code is publicly available at: https://github.com/lewisfish/signedMCRT. Data is available at https://doi.org/10.5281/zenodo.5780513.

Supporting Information: Meshless Monte Carlo Radiation Transfer Method for Curved Geometries Using Signed Distance Functions

Lewis McMillan; Graham D. Bruce; Kishan Dholakia

A Preprint

Derivation of Average number of scattering in an isotropic sphere

For a photon’s random walk from the center to the edge of a uniformly scattering sphere of radius rr. Consider the net displacement for a single photon from a starting point pp after NN mean free paths is:

R=r1+r2+…+rN(7)R = r_1 + r_2 + \ldots+ r_N \tag*{(7)}

The mean square displacement traveled by a photon (l∗l_\ast) is thus:

l∗2=⟨R2⟩=⟨r12⟩+⟨r22⟩+…+⟨rN2⟩+2⟨r1⋅r2⟩+…(8)l_\ast^2 = \langle R^2 \rangle= \langle r_1^2 \rangle+ \langle r_2^2 \rangle+ \ldots+ \langle r_N^2 \rangle+ 2\langle r_1 \cdot r_2 \rangle+ \ldots \tag*{(8)}

where

2⟨r2⋅r2⟩=2⟨∣r1∣∣r2∣cos⁡δ⟩2\langle r_2 \cdot r_2 \rangle= 2\langle\lvert r_1\rvert\lvert r_2\rvert\cos\delta\rangle

For isotropic scattering cos⁡δ=0\cos\delta= 0 therefore all cross terms vanish. As each term involving the square of the displacement averages to the mean square of the free path of a photon, therefore

l∗2=N⟨r2⟩(9)l_\ast^2 = N\langle r^2\rangle \tag*{(9)}

Then multiplying both sides by μ2\mu^2, the scattering coefficient, gives an expression for the average number of scatterings for optically thick media.

μ2l∗2=N⟨r2⟩(10)\mu^2 l_\ast^2 = N\langle r^2\rangle \tag*{(10)}

By definition, the scattering coefficient multiplied by the radius of the sphere is τmax\tau_{max}:

τmax2=N⟨τ2⟩(11)\tau_{max}^{2}=N\langle\tau^{2}\rangle \tag*{(11)}

Then using the following identity

⟨τ2⟩=∫0∞p(τ)τ2dτ=∫0∞e−ττ2dτ=2(12)\langle\tau^{2}\rangle=\int_{0}^{\infty}p(\tau)\tau^{2}d\tau=\int_{0}^{\infty}e^{-\tau}\tau^{2}d\tau=2 \tag*{(12)}

we arrive at an expression for the average number of scatterings as a function of maximum optical depth for an isotropic sphere in the optically thick limit:

N=τmax22(13)N=\frac{\tau_{max}^{2}}{2} \tag*{(13)}

For the optically thin limit, the number of scatterings is small, on the order of 1−e−τ≈τ1-e^{-\tau}\approx\tau.

Examples of sMCRT on complex geometries

Image not extracted

Figure SI Figure 1. Example of an arbitrary SDF generated via a neural SDF method (SIREN [1]). Image shows 3D fluence inside the Stanford bunny [2] for a point source inside the Bunny. Fluence outside the bunny has been removed for clarity.

Fluence on the University of St Andrews crest and simplified SVG

Figure 2 (PDF p. 16). Fluence on the University of St Andrews crest. Crest is converted from a simplified Scalable Vector Graphic (SVG) of the crest, and translated into 2D line segments. Line segments are then extruded in the zz-axis and assigned optical properties, where μa=0.1\mu_a=0.1 cm−1^{-1}, μs=10.0\mu_s=10.0 cm−1^{-1}, g=0.9g=0.9, and n=1.5n=1.5. Left shows a slice of fluence in the xx-yy plane in the middle of the simulated medium. Photons are incident on the crest’s surface (into the page). Right shows the simplified SVG where each line has a different color. SVG was simplified by removing some elements, and converting Bézier curves into line segments using Inkscape.

Number of SDF evaluations

Image not extracted

Figure SI Figure 3. Left panel shows the average number of SDF evaluations for a slice through the middle of the model shown in the right panel. Middle panel shows a slice of fluence through the middle for uniform illumination going into the page.

References

  1. [1]V Sitzmann, J Martel, A Bergman, D Lindell, and G Wetzstein. Implicit neural representations with periodic activation functions. Advances in Neural Information Processing Systems, 33, 2020.arxiv.org/abs/2006.09661
  2. [2]G Turk, M Levoy Zippered polygon meshes from range images. Proceedings of the 21st annual conference on Computer graphics and interactive techniques,311–318,1994.DOI

Paper details

vlnc:W_x6zr38nq
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents