public void validate_spectral_generation_of_OpticalProperties_with_tissue()
        {
            var scatterer                         = new IntralipidScatterer(0.01);
            var fatAbsorber                       = new ChromophoreAbsorber(ChromophoreType.Fat, 0.01);
            var waterAbsorber                     = new ChromophoreAbsorber(ChromophoreType.H2O, 0.99);
            var _twoLayerSDAForwardSolver         = new TwoLayerSDAForwardSolver();
            var _oneLayerPointSourceForwardSolver = new PointSourceSDAForwardSolver();

            var n   = 1.4;
            var wvs = new DoubleRange(650, 1000, 36).AsEnumerable().ToArray();
            var rho = 10;

            var tissue = new Tissue(
                new IChromophoreAbsorber[] { fatAbsorber, waterAbsorber },
                scatterer,
                "test_tissue",
                n);

            var ops = wvs.Select(wv => tissue.GetOpticalProperties(wv)).ToArray();

            var fs = new PointSourceSDAForwardSolver();

            var reflectanceVsWavelength = fs.ROfRho(ops, rho);

            Assert.NotNull(reflectanceVsWavelength);
            Assert.AreEqual(reflectanceVsWavelength.Length, wvs.Length);

            // check that change in scattering changes the reflectance
            Assert.IsTrue(reflectanceVsWavelength[0] != reflectanceVsWavelength[1]);
            // check that change in absorption changes the reflectance
            Assert.IsTrue(reflectanceVsWavelength[1] != reflectanceVsWavelength[2]);
        }
        public void validate_spectral_generation_of_OpticalProperties_with_scatterers_and_absorbers()
        {
            var scatterer     = new IntralipidScatterer(0.01);
            var fatAbsorber   = new ChromophoreAbsorber(ChromophoreType.Fat, 0.01);
            var waterAbsorber = new ChromophoreAbsorber(ChromophoreType.H2O, 0.99);
            var wvs           = new DoubleRange(650, 1000, 36).AsEnumerable().ToArray();
            var n             = 1.4;
            var rho           = 10;

            var ops = wvs.Select(wv =>
            {
                var mua  = fatAbsorber.GetMua(wv) + waterAbsorber.GetMua(wv);
                var musp = scatterer.GetMusp(wv);
                var g    = scatterer.GetG(wv);
                return(new OpticalProperties(mua, musp, g, n));
            }).ToArray();

            var fs = new PointSourceSDAForwardSolver();

            var reflectanceVsWavelength = fs.ROfRho(ops, rho);

            Assert.NotNull(reflectanceVsWavelength);
            Assert.AreEqual(reflectanceVsWavelength.Length, wvs.Length);

            // check that change in scattering changes the reflectance
            Assert.IsTrue(reflectanceVsWavelength[0] != reflectanceVsWavelength[1]);
            // check that change in absorption changes the reflectance
            Assert.IsTrue(reflectanceVsWavelength[1] != reflectanceVsWavelength[2]);
        }