Ejemplo n.º 1
0
 /// <summary>
 /// constructor for simulation options, a class sub to SimulationInput
 /// </summary>
 /// <param name="seed">random number generator seed (-1=randomly chosen seed, >=0 reproducible sequence)</param>
 /// <param name="rngType">random number generator type</param>
 /// <param name="absWeightingType">absorption weighting type</param>
 /// <param name="phaseFunctionType">phase function type</param>
 /// <param name="databases">list of DatabaseType indicating data to be written database for post-processing</param>
 /// <param name="trackStatistics">flag indicating whether to track statistics about where photons end up</param>
 /// <param name="russianRouletteWeightThreshold">weight threshold to perform RR (default=0, no RR)</param>
 /// <param name="simulationIndex">index of simulation</param>
 public SimulationOptions(
     int seed,
     RandomNumberGeneratorType rngType,
     AbsorptionWeightingType absWeightingType,
     PhaseFunctionType phaseFunctionType,
     IList <DatabaseType> databases,
     bool trackStatistics,
     double russianRouletteWeightThreshold,
     int simulationIndex)
 {
     RandomNumberGeneratorType = rngType;
     AbsorptionWeightingType   = absWeightingType;
     PhaseFunctionType         = phaseFunctionType;
     Databases = databases;
     // check if databases list is null and if so make empty
     if (Databases == null)
     {
         Databases = new List <DatabaseType>()
         {
         };
     }
     Seed = seed;
     //if (Seed == -1) // handling of random seed moved to RNGFactory 10/01/11
     //{
     //    Seed = GetRandomSeed();
     //}
     SimulationIndex = simulationIndex;
     TrackStatistics = trackStatistics;
     RussianRouletteWeightThreshold = russianRouletteWeightThreshold;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Required factory method to create the corresponding
        /// ITissue based on the ITissueInput data
        /// </summary>
        /// <param name="awt">Absorption Weighting Type</param>
        /// <param name="pft">Phase Function Type</param>
        /// <param name="russianRouletteWeightThreshold">Russian Roulette Weight Threshold</param>
        /// <returns></returns>
        public ITissue CreateTissue(AbsorptionWeightingType awt, PhaseFunctionType pft, double russianRouletteWeightThreshold)
        {
            var t = new BoundedTissue(CylinderRegion, LayerRegions);

            t.Initialize(awt, pft, russianRouletteWeightThreshold);

            return(t);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///// Required factory method to create the corresponding
        ///// ITissue based on the ITissueInput data
        /// </summary>
        /// <param name="awt">Absorption Weighting Type</param>
        /// <param name="pft">Phase Function Type</param>
        /// <param name="russianRouletteWeightThreshold">Russian Roulette Weight Threshold</param>
        /// <returns></returns>
        public ITissue CreateTissue(AbsorptionWeightingType awt, PhaseFunctionType pft, double russianRouletteWeightThreshold)
        {
            var t = new SingleInclusionTissue(EllipsoidRegion, LayerRegions);

            t.Initialize(awt, pft, russianRouletteWeightThreshold);

            return(t);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Required factory method to create the corresponding
        /// ITissue based on the ITissueInput data
        /// </summary>
        /// <param name="awt">Absorption Weighting Type</param>
        /// <param name="pft">Phase Function Type</param>
        /// <param name="russianRouletteWeightThreshold">Russian Roulette Weight Threshold</param>
        /// <returns></returns>
        public ITissue CreateTissue(AbsorptionWeightingType awt, PhaseFunctionType pft, double russianRouletteWeightThreshold)
        {
            var t = new MultiConcentricInfiniteCylinderTissue(InfiniteCylinderRegions, LayerRegions);

            t.Initialize(awt, pft, russianRouletteWeightThreshold);

            return(t);
        }
        /// <summary>
        ///// Required factory method to create the corresponding
        ///// ITissue based on the ITissueInput data
        /// </summary>
        /// <param name="awt">Absorption Weighting Type</param>
        /// <param name="pft">Phase Function Type</param>
        /// <param name="russianRouletteWeightThreshold">Russian Roulette Weight Threshold</param>
        /// <returns></returns>
        public ITissue CreateTissue(AbsorptionWeightingType awt, PhaseFunctionType pft, double russianRouletteWeightThreshold)
        {
            var t = new MultiLayerWithSurfaceFiberTissue(SurfaceFiberRegion, LayerRegions);

            t.Initialize(awt, pft, russianRouletteWeightThreshold);

            return(t);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Required factory method to create the corresponding
        /// ITissue based on the ITissueInput data
        /// </summary>
        /// <param name="awt">Absorption Weighting Type</param>
        /// <param name="pft">Phase Function Type</param>
        /// <param name="russianRouletteWeightThreshold">Russian Roulette Weight Threshold</param>
        /// <returns></returns>
        public ITissue CreateTissue(AbsorptionWeightingType awt, PhaseFunctionType pft, double russianRouletteWeightThreshold)
        {
            throw new NotImplementedException();

            //var t = new SingleInclusionTissue(EllipsoidRegions, LayerRegions); // todo: add implementation

            //t.Initialize(awt, pft, russianRouletteWeightThreshold);

            //return t;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Required method to initialiize the corresponding ITissue
        /// </summary>
        /// <param name="tissue"></param>
        public void Initialize(
            AbsorptionWeightingType awt           = AbsorptionWeightingType.Discrete,
            PhaseFunctionType pft                 = PhaseFunctionType.HenyeyGreenstein,
            double russianRouletteWeightThreshold = 0.0)
        {
            AbsorptionWeightingType        = awt;
            PhaseFunctionType              = pft;
            RussianRouletteWeightThreshold = russianRouletteWeightThreshold;

            RegionScatterLengths = Regions.Select(region => region.RegionOP.GetScatterLength(awt)).ToArray();
        }
Ejemplo n.º 8
0
        private void SetScatterAction(PhaseFunctionType st)
        {
            switch (st)
            {
            case PhaseFunctionType.HenyeyGreenstein:
                Scatter = ScatterHenyeyGreenstein;
                break;

            case PhaseFunctionType.Bidirectional:
                Scatter = Scatter1D;
                break;
            }
        }
Ejemplo n.º 9
0
        // todo: revisit to make signatures here and in Tissue/TissueInput class signatures strongly typed
        /// <summary>
        /// Method to return ITissue given inputs
        /// </summary>
        /// <param name="ti">ITissueInput</param>
        /// <param name="awt">AbsorptionWeightingType enum</param>
        /// <param name="pft">PhaseFunctionType enum</param>
        /// <param name="russianRouletteWeightThreshold">Russian Roulette weight threshold</param>
        /// <returns>ITissue</returns>
        public static ITissue GetTissue(ITissueInput ti, AbsorptionWeightingType awt, PhaseFunctionType pft, double russianRouletteWeightThreshold)
        {
            ITissue t = ti.CreateTissue(awt, pft, russianRouletteWeightThreshold);

            if (t == null)
            {
                throw new ArgumentException(
                          "Problem generating ITissue instance. Check that TissueInput, ti, has a matching ITissue definition.");
            }

            return(t);
        }