You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running MCX simulations via commandline with the -F bnii and --debug M options to save trajectory info on photons there are errors in the file containing the trajectory info (traj.jdat). When the number of followed photons is larger than the number of threads used the number of photon id saved in the trajectory file is too low. Doing simulations with mus =0 and mua = 0 show the correct number of events (positional data), that is 2 per photon (one entry and one exit). However the number of photon id is still too low and shows more than 2 events for some photon id. In conclusion when the number of followed photons exceeds the number of threads data of multiple photons get added to a single photon id.
The text was updated successfully, but these errors were encountered:
hi @g-buist, thanks for reporting this, I am able to reproduce the issue and the above commit should fix it
clear cfg
cfg.nphoton=1e6;
cfg.vol=uint8(ones(60,60,60));
cfg.prop=[0 0 1 1;0 0 1 1];
cfg.issrcfrom0=1;
cfg.srcpos=[30 30 1];
cfg.srcdir=[0 0 1];
cfg.issaveref=1;
cfg.gpuid=1;
cfg.autopilot=1;
cfg.tstart=0;
cfg.tend=5e-9;
cfg.tstep=5e-10;
cfg.nphoton=1e5;
[fluence,detpt,vol,seeds,traj]=mcxlab(cfg);
id=sort(double(traj.id));
[a,b]=histc(id,unique(id));
count = a(b); % count for each photon id - should be mostly 2
length(find(count==4))
max(count)
before fixing the issue, there are quite a few repeated photon trajectories with the same photon produced by different threads (i.e. count==4 for 2 positions per repeated track). After fixing, duplicated IDs are gone. The highest count is 3, due to multiple scattering (even along the same direction).
After running MCX simulations via commandline with the -F bnii and --debug M options to save trajectory info on photons there are errors in the file containing the trajectory info (traj.jdat). When the number of followed photons is larger than the number of threads used the number of photon id saved in the trajectory file is too low. Doing simulations with mus =0 and mua = 0 show the correct number of events (positional data), that is 2 per photon (one entry and one exit). However the number of photon id is still too low and shows more than 2 events for some photon id. In conclusion when the number of followed photons exceeds the number of threads data of multiple photons get added to a single photon id.
The text was updated successfully, but these errors were encountered: