public void validate_tissue_optical_properties_are_non_negative()
        {
            var tissueInput = new MultiLayerTissueInput(
                new ITissueRegion[]
            {
                new LayerTissueRegion(
                    new DoubleRange(double.NegativeInfinity, 0.0),
                    new OpticalProperties(0.0, 1e-10, 1.0, 1.0)),
                new LayerTissueRegion(
                    new DoubleRange(0.0, 100.0),
                    new OpticalProperties(-1.0, 1.0, 0.8, 1.4)),     // make mua negative
                new LayerTissueRegion(
                    new DoubleRange(100.0, double.PositiveInfinity),
                    new OpticalProperties(0.0, 1e-10, 1.0, 1.0))
            });
            var input = new PostProcessorInput(
                new List <IDetectorInput>()
            {
                new pMCROfRhoDetectorInput()
                {
                    Rho = new DoubleRange(0.0, 100.0),
                    // set perturbed ops to reference ops
                    PerturbedOps = new List <OpticalProperties>()
                    {
                        tissueInput.Regions[0].RegionOP,
                        tissueInput.Regions[1].RegionOP,
                        tissueInput.Regions[2].RegionOP
                    },
                    PerturbedRegionsIndices = new List <int>()
                    {
                        1
                    }
                }
            },
                "", "", ""
                );
            var result = PostProcessorInputValidation.ValidateInput(input, "");

            Assert.IsFalse(result.IsValid);
        }
Esempio n. 2
0
 public static ValidationResult ValidatePostProcessorInput(PostProcessorInput input)
 {
     return(PostProcessorInputValidation.ValidateInput(input));
 }
 /// <summary>
 /// Validate PostProcessor input with optional overriding command line "infile" option
 /// </summary>
 /// <param name="input">PostProcessor infile</param>
 /// <param name="inpath">command line path for inpath (where database resides)</param>
 /// <returns></returns>
 public static ValidationResult ValidatePostProcessorInput(PostProcessorInput input, string inpath)
 {
     return(PostProcessorInputValidation.ValidateInput(input, inpath));
 }