// This window will work as the link between the capture processes and the analysis processes public AnalysisWindow(CaptureWindow cw, bool countAnalysis, bool classAnalysis, string map, string folder) { InitializeComponent(); this.Width = 1200; this.Height = 900; if (countAnalysis) { countPage = new CountAnalytics(this); chartPage = new ChartPage(); } if (classAnalysis) { clssPage = new ClassifyAnalytics(); if (map.Length > 1) { clssPage.Init(map, countPage); } } pick = new Picker(cw, countAnalysis, classAnalysis, clssPage, countPage, chartPage, folder); Navigate(pick); closeRequest = false; captureWindow = cw; }
// ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // Charts management // ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // Page's content is originated when the page is shown, with a link to the source of the data that needs to be presented public void initCharts(CountAnalytics analysisDataSource, string _saveDir) { double[] countYData = analysisDataSource.getColonyCountData(); barCharConstruct(countYData, _saveDir, new string[] { "Colony Count Chart", "Number of colonies", "Step" }); object[] returnable = analysisDataSource.getColonySizeData(); List <double[]> sizeYData = (List <double[]>)returnable[0]; List <int[]> bbs = (List <int[]>)returnable[1]; List <Bitmap> images = (List <Bitmap>)returnable[2]; bbList = convertToFormat(bbs, images[0].Width, images[0].Height); imagesList = convertToFormat(images); for (int i = 0; i < sizeYData.Count; i++) { ListBoxItem lbItem = new ListBoxItem(); System.Windows.Controls.Label l = new System.Windows.Controls.Label(); l.Content = "Colony " + i.ToString(); lbItem.Content = l; colonyListBox.Items.Add(lbItem); chartsList.Add(barCharConstruct(sizeYData[i], _saveDir, i, new string[] { "Colony " + i + " Size Chart", "Size (mm)", "Step" })); } Init_List(); }
internal bool Init(string sourceFolder, CountAnalytics ca) { object[] returned = DataHandler.ProcessInputTest(sourceFolder); if (returned == null) { System.Windows.MessageBox.Show(" Invalid map folder"); errorDuringImport = true; return(false); } List <string> labels = (List <string>)returned[0]; Cell[,] map = (Cell[, ])returned[1]; lh = new LabelingHandler(labels); kn = new KohonenNetwork(lh, map, this); Logo_Init(); ScrollLeft_Init(); ScrollRight_Init(); countA = ca; return(true); }
// UI initialization with a link to every analysis related interface public Picker(CaptureWindow cw, bool count, bool classAn, ClassifyAnalytics clss, CountAnalytics cnt, ChartPage chp, string folder) { InitializeComponent(); captureWindow = cw; countAnalysis = count; classAnalysis = classAn; Logo_Init(); Panel_Logic_Init(); clssPage = clss; countPage = cnt; chartPage = chp; saveFolder = folder; }