Description
Issue
Large number of scattering events take place in a medium with a very low scattering coefficient. To me this behaviour seems counterintuitive as I would expect little to no scattering events.
Setup
A 32x32 pixel 2D volume containing one circular artery in the middle surrounded by background tissue is being simulated. A pencil illumination source located at the top-middle of the volume is used and directed towards the artery. The background tissue is assigned a very low scattering coefficient
Observed behaviour
When plotting the photon trajectories for
- There is a large number of scattering events happening in the BG tissue for
$\mu_s \in [10^{-11}, 10^{-8}]$ - Photon trajectories are traced outside of the volume (black = background tissue)
- Photons are terminated in the middle of the volume with weights much higher than the termination threshold (e.g. 0.8 weight, 0.0 threshold)
- The behaviour stabilizes at approximately
$\mu_s \geq 10^{-6}$
Expected behaviour
There should be little to no scattering events in the background tissue for very low
Code to reproduce
import pmcx
import numpy as np
def _circle(h, w, center, radius):
Y, X = np.ogrid[:h, :w]
dist_from_center = np.sqrt((X - center[0])**2 + (Y-center[1])**2)
mask = dist_from_center <= radius
return mask
optical_properties= [
[0, 0, 1, 1],
[0.02, 1e-11, 0.9, 1],
[0.30, 80.25, 0.9, 1]
]
volume_height=32
volume_width=32
artery_center=(16, 16)
artery_radius=7
source_position=[0, 0, 16]
source_direction=[0, 1, 0]
volume = np.ones([1, volume_height, volume_width], dtype='uint8')
volume[:, _circle(volume_height,
volume_width,
artery_center,
artery_radius)] = 2
out = pmcx.run(debuglevel="M",
seed=42,
nphoton=10000,
tstart=0,
tend=5e-9,
tstep=5e-9,
outputtype="energy",
issrcfrom0=1,
unitinmm=0.1,
vol=volume,
srcpos=source_position,
srcdir=source_direction,
prop=optical_properties)