private static ValidationResult ValidateTissueInput(ITissueInput tissueInput) { // for all types of tissues, check that OPs are non-negative (g could be neg) if (tissueInput.Regions.Any(r => r.RegionOP.Mua < 0.0) || tissueInput.Regions.Any(r => r.RegionOP.Musp < 0.0) || tissueInput.Regions.Any(r => r.RegionOP.N < 0.0)) { return(new ValidationResult( false, "Tissue optical properties mua, mus', n need to be non-negative", "Please check optical properties")); } if (tissueInput is MultiLayerTissueInput) { return(MultiLayerTissueInputValidation.ValidateInput(tissueInput)); } if (tissueInput is SingleEllipsoidTissueInput) { return(SingleEllipsoidTissueInputValidation.ValidateInput(tissueInput)); } if (tissueInput is SingleVoxelTissueInput) { return(SingleVoxelTissueInputValidation.ValidateInput(tissueInput)); } if (tissueInput is BoundingCylinderTissueInput) { return(BoundingCylinderTissueInputValidation.ValidateInput(tissueInput)); } return(new ValidationResult( true, "Tissue input must be valid", "Validation skipped for tissue input " + tissueInput + ". No matching validation rules were found.")); }
private static ValidationResult ValidateTissueInput(ITissueInput tissueInput) { if (tissueInput is MultiLayerTissueInput) { return(MultiLayerTissueInputValidation.ValidateInput(tissueInput)); } if (tissueInput is SingleEllipsoidTissueInput) { return(SingleEllipsoidTissueInputValidation.ValidateInput(tissueInput)); } if (tissueInput is SingleVoxelTissueInput) { return(SingleVoxelTissueInputValidation.ValidateInput(tissueInput)); } if (tissueInput is BoundingCylinderTissueInput) { return(BoundingCylinderTissueInputValidation.ValidateInput(tissueInput)); } return(new ValidationResult( true, "Tissue input must be valid", "Validation skipped for tissue input " + tissueInput + ". No matching validation rules were found.")); }