Comments (4)
thanks, I am able to reproduce this issue in both python and mcxlab. I agree with you both the scattering behavior and the out-of-bbx trajectories are incorrect. I will look into this and will post my updates here.
mcxlab test code is attached
%%octave
cfg.nphoton=1e4;
cfg.seed=42;
cfg.vol=permute(uint8(ones(32,32)), [3,1,2]); % from 2d to 3d
cfg.vol(1,10:22, 10:22)=2;
cfg.issrcfrom0=1;
cfg.srctype='pencil';
cfg.srcpos=[0,0,16]; % src position must be located in the 2D plane
cfg.srcdir=[0 1 0]; % src dir must align in the plan (y-z in this case)
cfg.gpuid=1;
cfg.autopilot=1;
cfg.prop=[0, 0, 1, 1,
0.02, 1e-11, 0.9, 1,
0.30, 80.25, 0.9, 1];
cfg.unitinmm=0.1;
cfg.tstart=0;
cfg.tend=5e-9;
cfg.tstep=5e-9;
cfg.outputtype='energy';
[flux,detp,vol,seeds,traj]=mcxlab(cfg);
sortedlines=mcxplotphotons(traj);
from mcx.
@dkalsan, again, thanks for reporting this issue.
I looked into it further, and was able to identify the cause - the handling of near-zero mus
causes issues when combined with the new DDA ray-tracing approach implemented last year. The photon voxel indices (flipdir(1:3)
) no longer follow the floating-point positions (p.{x,y,z}
). this was not a problem before using the DDA based photon advancing.
after a one-line change, I believe this behavior has been fixed. see my above commit.
the above matlab demo code now returns correct trajectories, see below.
feel free to reopen the ticket if you see anything else is not fixed.
from mcx.
Interestingly, mcxcl/mcxlabcl does not have this behavior - it uses native_divide
for the affected line, which appears to be able to handle divided by 0.
from mcx.
Perfect, I will give it a test. Thanks a lot for taking the time for this!
from mcx.
Related Issues (20)
- Misleading Documentation for Gaussian Source Type HOT 1
- Replay using photon seeds saved as results_detp.jdat fails HOT 2
- Detected photon discrepancy between pmcx and mcxlab HOT 4
- Output option -F mc2 produces a .jnii file
- pmcx incorrectly set default source focal length to 1
- Build V2020 requires to fill an expired form. HOT 1
- MCX Studio build not working on MacOS Montery 12.4 HOT 7
- pmcx volume loading differs from mcx HOT 1
- Pytorch seems to be broken after calling pmcx.run()
- Tutorial on how to import arbitrary 3d shapes. HOT 1
- Error in make HOT 1
- pmcx buffer overflow error if bc parameter has 12 characters HOT 1
- "misaligned address" error when using cfg.invcdf and cfg.angleinvcdf
- Failed to apply double-float-buffer approach in #41 to `dref` cause loss of accuracy
- Tissue propoerty for different wavelenght HOT 2
- `pmcx.mcxlab` fails to typecast `traj.id` output from float32 to uint32
- mcx2json unable to export simulations of continuously-varying media
- mcxlab: Where to find "sphdiffusionslab.m" required by "demo_validation_heterogeneous.m"? HOT 1
- Support per voxel mua/mus/g/n continuous medium type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcx.