Giter Club home page Giter Club logo

montecarlorender's Introduction

MonteCarloRender

This is a GPU implementation of a Monte Carlo Photon Transport in scattering media

Main function call

Use the lunchPacketwithBatch() function to run the simulator. See MC.py for documentation.

Several notes on properties / limitations:

Media:

Assume homogeneous media. You can provide the scattering mean free path (MFP) and Henyey Greenstein anisotropy coefficient.

Detector:

Assume a single detector.
Detector is circular (you can provide diameter).
Detector is centered at the origin.
Detector is parallel to the x-y plane and points at the positive z direction.

Targets:

Supports a 2d target that is positioned at a given x-y plane (user provides the z coordinate).
The mask can be absorbing (binary value), or scattering (reflective).

GPU support:

Supports single or multiple GPUs (user defined).

Example:

import MC
ret = MC.lunchPacketwithBatch(batchSize = 1e7,
                           nPhotonsRequested = 1e7,
                            nPhotonsToRun = 1e7,
                            muS = 1.0, g = 0.85,
                            source = {'r': np.array([0.0, 0.0, 30.0]),
                                      'mu': np.array([0.0, 0.0, -1.0]),
                                      'method': 'pencil', 'time_profile': 'delta'},
                            detector = {'radius': 100.0},
                            control_param = {'max_N': 1e5,
                                             'max_distance_from_det': 110},
                            normalize_d = None,
                            ret_cols = [0,1,2,3,4,5,6,7]
                            )      

The runtime is approximatley 15 sec on a single Nvidia GTX 1080.
ret[0] is the data.
ret[1][0] are the number of simulated photons.
ret[1][1] are the number of detected photons.
etc.

montecarlorender's People

Contributors

tomotomohiro avatar guysatat avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.