Exemplo n.º 1
0
 protected DoDBase(string name, DirectoryInfo folder, Surface newSurface, Surface oldSurface, Masks.AOIMask aoi, Raster rawDoD, Raster thrDoD, Raster thrErr, HistogramPair histograms, FileInfo summaryXML, DoDStats stats)
     : base(name)
 {
     Folder             = folder;
     NewSurface         = newSurface;
     OldSurface         = oldSurface;
     AOIMask            = aoi;
     RawDoD             = new DoDRaster(string.Format(Name + " - Raw"), rawDoD);
     ThrDoD             = new DoDRaster(string.Format(Name + " - Thresholded"), thrDoD);
     ThrErr             = new DoDRaster(string.Format(Name + " - Thresholded Error"), thrErr);
     Histograms         = histograms;
     SummaryXML         = summaryXML;
     Statistics         = stats;
     BudgetSegregations = new List <BudgetSegregation>();
     LinearExtractions  = new List <LinearExtraction.LinearExtraction>();
 }
Exemplo n.º 2
0
        protected DoDBase(XmlNode nodDoD)
            : base(nodDoD.SelectSingleNode("Name").InnerText)
        {
            Folder     = ProjectManager.Project.GetAbsoluteDir(nodDoD.SelectSingleNode("Folder").InnerText);
            NewSurface = DeserializeSurface(nodDoD, "NewSurface");
            OldSurface = DeserializeSurface(nodDoD, "OldSurface");

            XmlNode nodAOI = nodDoD.SelectSingleNode("AOI");

            if (nodAOI is XmlNode)
            {
                AOIMask = ProjectManager.Project.Masks.First(x => string.Compare(x.Name, nodAOI.InnerText, true) == 0) as Masks.AOIMask;
            }

            RawDoD     = new DoDRaster(string.Format(Name + " - Raw"), ProjectManager.Project.GetAbsolutePath(nodDoD.SelectSingleNode("RawDoD").InnerText));
            ThrDoD     = new DoDRaster(string.Format(Name + " - Thresholded"), ProjectManager.Project.GetAbsolutePath(nodDoD.SelectSingleNode("ThrDoD").InnerText));
            ThrErr     = new DoDRaster(string.Format(Name + " - Thresholded Error"), ProjectManager.Project.GetAbsolutePath(nodDoD.SelectSingleNode("ThrErr").InnerText));
            Histograms = new HistogramPair(ProjectManager.Project.GetAbsolutePath(nodDoD.SelectSingleNode("RawHistogram").InnerText),
                                           ProjectManager.Project.GetAbsolutePath(nodDoD.SelectSingleNode("ThrHistogram").InnerText));
            SummaryXML = ProjectManager.Project.GetAbsolutePath(nodDoD.SelectSingleNode("SummaryXML").InnerText);
            Statistics = DeserializeStatistics(nodDoD.SelectSingleNode("Statistics"), ProjectManager.Project.CellArea, ProjectManager.Project.Units);

            BudgetSegregations = new List <BudgetSegregation>();
            XmlNode nodBSes = nodDoD.SelectSingleNode("BudgetSegregations");

            if (nodBSes is XmlNode)
            {
                foreach (XmlNode nodBS in nodBSes.SelectNodes("BudgetSegregation"))
                {
                    BudgetSegregation bs = new BudgetSegregation(nodBS, this);
                    BudgetSegregations.Add(bs);
                }
            }

            LinearExtractions = new List <LinearExtraction.LinearExtraction>();
            foreach (XmlNode nodLE in nodDoD.SelectNodes("LinearExtractions/LinearExtraction"))
            {
                LinearExtraction.LinearExtraction le = new LinearExtraction.LinearExtractionFromDoD(nodLE, this);
                LinearExtractions.Add(le);
            }
        }