hi Yu,
mcx uses Fresnel's law to handle n-mismatched boundaries by default, you do not need to set anything in order to use it. you can, however, set cfg.isreflect=0 to disable it when needed.
for the paper you referred to, please check out our SVMC paper addressing the same issue
https://www.osapublishing.org/boe/abstract.cfm?uri=boe-11-11-6262
the paper you linked only has the ability to reduce errors due to reflections at voxelated boundaries (in our paper, we called it Type-II error), but can not mitigate the "partial volume" effect at internal boundaries (we called it Type-I error). see the Introduction section of our SVMC paper
you can find all benchmarks (B1, B2, B3) in our SVMC paper in this folder
https://github.com/fangq/mcx/tree/v2025/mcxlab/examples
Qianqian
You don't often get email from shimoshi...@gmail.com. Learn why this is important
--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/b9460243-8d8b-4bb5-bedd-76d82afdab0cn%40googlegroups.com.
hi Yu,
I was able to run your test script (after uncomment your Nx/Ny/Nz), the disk source runs fine, and produced expected results on my machine. see my screenshot
I am also attaching the printed logs.
can you try other demo scripts in mcxlab and do you see this error?
Qianqian
SVMC preprocessing complete, Elapsed time is 0.278214
seconds.
Launching MCXLAB - Monte Carlo eXtreme for MATLAB & GNU
Octave ...
Running simulations for configuration #1 ...
mcx.nphoton=1e+08;
mcx.seed=1961459715;
mcx.srctype='disk';
mcx.srcpos=[50 50 0 1];
mcx.srcparam1=[20 0 0 0];
mcx.srcdir=[0 0 1 0];
mcx.issrcfrom0=1;
mcx.medianum=3;
mcx.tstart=0;
mcx.tend=5e-09;
mcx.tstep=5e-10;
mcx.isreflect=1;
mcx.unitinmm=0.1;
mcx.outputtype='fluence';
mcx.gpuid=1;
mcx.autopilot=1;
mcx.dim=[100 100 100];
mcx.mediabyte=4;
###############################################################################
# Monte Carlo eXtreme (MCX) --
CUDA #
# Copyright (c) 2009-2025 Qianqian Fang <q.fang at
neu.edu> #
# https://mcx.space/ &
https://neurojson.io #
#
#
# Computational Optics & Translational Imaging (COTI) Lab-
http://fanglab.org #
# Department of Bioengineering, Northeastern University,
Boston, MA, USA #
###############################################################################
# The MCX Project is funded by the NIH/NIGMS under grant
R01-GM114365 #
###############################################################################
# Open-source codes and reusable scientific data are essential
for research, #
# MCX proudly developed human-readable JSON-based data formats
for easy reuse.#
#
#
#Please visit our free scientific data sharing portal at
https://neurojson.io #
# and consider sharing your public datasets in standardized
JSON/JData format #
###############################################################################
$Rev::d98d88 $ v2025 $Date::2025-01-26 13:14:33 -05$ by
$Author::Qianqian Fang$
###############################################################################
- code name: [Jumbo Jolt] compiled by nvcc [11.5] for CUDA-arch
[350] on [Feb 20 2025]
- compiled with: RNG [xorshift128+] with Seed Length [4]
GPU=1 (NVIDIA GeForce RTX 4070 Laptop GPU) threadph=678
extra=24832 np=100000000 nthread=147456 maxgate=10 repetition=1
initializing streams ... init complete : 1 ms
requesting 1280 bytes of shared memory
launching MCX simulation for time window [0.00e+00ns 5.00e+00ns]
...
simulation run# 1 ...
kernel complete: 929 ms
retrieving fields ... transfer complete: 956 ms
normalizing raw data ... source 1, normalization factor
alpha=0.000001
data normalization complete : 1060 ms
simulated 100000000 photons (100000000) with 147456 threads
(repeat x1)
MCX simulation speed: 110375.28 photon/ms
total simulated energy: 100000000.00 absorbed: 0.00000%
(loss due to initial specular reflection is excluded in the
total)
Launching MCXLAB - Monte Carlo eXtreme for MATLAB & GNU
Octave ...
Running simulations for configuration #1 ...
mcx.nphoton=1e+08;
mcx.seed=1961459715;
mcx.srctype='disk';
mcx.srcpos=[50 50 0 1];
mcx.srcparam1=[20 0 0 0];
mcx.srcdir=[0 0 1 0];
mcx.issrcfrom0=1;
mcx.medianum=3;
mcx.tstart=0;
mcx.tend=5e-09;
mcx.tstep=5e-10;
mcx.isreflect=1;
mcx.unitinmm=0.1;
mcx.outputtype='fluence';
mcx.gpuid=1;
mcx.autopilot=1;
mcx.dim=[100 100 100];
mcx.mediabyte=97;
###############################################################################
# Monte Carlo eXtreme (MCX) --
CUDA #
# Copyright (c) 2009-2025 Qianqian Fang <q.fang at
neu.edu> #
# https://mcx.space/ &
https://neurojson.io #
#
#
# Computational Optics & Translational Imaging (COTI) Lab-
http://fanglab.org #
# Department of Bioengineering, Northeastern University,
Boston, MA, USA #
###############################################################################
# The MCX Project is funded by the NIH/NIGMS under grant
R01-GM114365 #
###############################################################################
# Open-source codes and reusable scientific data are essential
for research, #
# MCX proudly developed human-readable JSON-based data formats
for easy reuse.#
#
#
#Please visit our free scientific data sharing portal at
https://neurojson.io #
# and consider sharing your public datasets in standardized
JSON/JData format #
###############################################################################
$Rev::d98d88 $ v2025 $Date::2025-01-26 13:14:33 -05$ by
$Author::Qianqian Fang$
###############################################################################
- code name: [Jumbo Jolt] compiled by nvcc [11.5] for CUDA-arch
[350] on [Feb 20 2025]
- compiled with: RNG [xorshift128+] with Seed Length [4]
GPU=1 (NVIDIA GeForce RTX 4070 Laptop GPU) threadph=678
extra=24832 np=100000000 nthread=147456 maxgate=10 repetition=1
initializing streams ... init complete : 2 ms
requesting 1280 bytes of shared memory
launching MCX simulation for time window [0.00e+00ns 5.00e+00ns]
...
simulation run# 1 ...
kernel complete: 2201 ms
retrieving fields ... transfer complete: 2230 ms
normalizing raw data ... source 1, normalization factor
alpha=0.000001
data normalization complete : 2329 ms
simulated 100000000 photons (100000000) with 147456 threads
(repeat x1)
MCX simulation speed: 45934.77 photon/ms
total simulated energy: 100000000.00 absorbed: 0.00000%
(loss due to initial specular reflection is excluded in the
total)
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/34e08732-ef23-4c1f-8b07-02364e3e7162n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "mcx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mcx-users/KdRah18Iznw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/fd388247-abba-46b3-8e00-9aff0ca2c117n%40googlegroups.com.