ECE532 Biomedical Optics
© 1998 Steven L. Jacques, Scott A. Prahl
Oregon Graduate Institute

Time-resolved Monte Carlo

Initialize variables

Once the user has selected the variable settings, the program begins by initializing certain variables and zeroing the arrays.

/**** INITIALIZATIONS 
*****/
dr = radial_size/NR;      /* cm,  incremental bin size */
c = LIGHTSPEED/nt;        /* lightspeed within medium */
i_photon = 0;             /* zero photon counter */
InitRandomGen;            /* initialize seed of random number generator */

for (it=0; it<NTpts; it++) 
	LT[it] = T[it]*c;     /* pathlengths LT[it] associated with T[it] */
Lmax  = LT[NTpts-1];      /* last total pathlength considered */

for (ir=0; ir<=NR; ir++)  /* clear data array */
	for (it=0; it<NTpts; it++)
   		Csph[ir][it] = 0;

NextMonte Carlo