Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use precise grid-space ray-tracing #15

Closed
fangq opened this issue Aug 21, 2015 · 3 comments
Closed

Use precise grid-space ray-tracing #15

fangq opened this issue Aug 21, 2015 · 3 comments

Comments

@fangq
Copy link
Owner

fangq commented Aug 21, 2015

MCX has been using a 1-grid advance step size since the beginning, derived from the tMCimg era. My previous argument regarding this inaccurate in-grid ray-tracing scheme is that after sufficient sampling of the paths, the solution will converge to the correct result. See this mailing list comment:

https://groups.google.com/forum/?hl=en#!searchin/mcx-users/precise$20/mcx-users/I7YCRf4aNnY/8qunTY6UPo4J

However, for this to converge, it may take a lot more photons than I originally expected. I recently compared MCX and MMC (which does precise ray-tracing) and found that the fluence distributions from the two solutions match very well for homogeneous solutions, but not for heterogeneous cases with scattering contrasts (inclusions with absorption contrast also matches very well). This suggested the problem of photon-path related inaccuracy exist in MCX.

Implementing precise and fast grid-space ray-tracing in MCX is expected to solve this problem.

@fangq
Copy link
Owner Author

fangq commented Aug 21, 2015

Implementation is progress. Initial result is very positive. MCX and MMC now match perfectly for both homogeneous and heterogeneous cases with scattering contrasts.

The boundary reflection code was also significantly simplified due to this new change.

Computational speed did get a hit - about 50% slow-down for Fermi (GTX 590) and 30% for Maxwell (GTX980Ti). NVVP profiler shows hot spots in the new ray-grid ray-tracing code. Need to further optimize to improve the speed.

Stay tuned.

@fangq fangq changed the title Use precise in-grid ray-tracing Use precise grid-space ray-tracing Aug 21, 2015
@fangq
Copy link
Owner Author

fangq commented Sep 11, 2015

Changes are completed

c7f9625

the precise ray-tracing algorithm does make a difference when an inclusion present scattering contrast (either in mus or in g). New algorithm returns smooth fluence profiles while the old algorithm generate a small discontinuity.

The computational speed was improved guided by NVVP profiling results. A bunch of register variables, which were actually stored in the local/global memory, were optimized by using shared memory. see my forum post at

https://devtalk.nvidia.com/default/topic/868118/?comment=4646254

These changes improved the performance on Maxwell by 50%; however, there is no noticeable speed improvement on Fermi or Kepler.

The old way of photon fluence accumulation, i.e. adding the photon weight to enclosing voxel at a fixed length (1mm) can still be simulated by setting "-F 1" or "--faststep 1". By default, faststep is disabled.

@fangq
Copy link
Owner Author

fangq commented Sep 11, 2015

issue now closed

@fangq fangq closed this as completed Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant