private void PerformTestType(eTestType TestType) { #region extract classes of interest cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses(); GUI_ListClasses.IsCheckBoxes = !_DescEvolCellByCellItem.Checked; GUI_ListClasses.IsSelectAll = true; if (GUI_ListClasses.Run().IsSucceed == false) return; cExtendedTable ListClassSelected = GUI_ListClasses.GetOutPut(); if (ListClassSelected.Sum() < 1) { MessageBox.Show("At least one classe has to be selected.", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } #endregion cDesignerTab DT = new cDesignerTab(); for (int i = 0; i < cGlobalInfo.CurrentScreening.ListDescriptors.Count; i++) { if (cGlobalInfo.CurrentScreening.ListDescriptors[i].IsActive() == false) continue; cDesignerSplitter DS = new cDesignerSplitter(); DS.Orientation = Orientation.Vertical; cViewerTable VTable = new cViewerTable(); cViewertext VT = new cViewertext(); cExtendedTable FinalTable = new cExtendedTable(cGlobalInfo.ListWellClasses.Count, 0, 0); for (int j = 0; j < cGlobalInfo.ListWellClasses.Count; j++) { FinalTable[j].Tag = cGlobalInfo.ListWellClasses[j]; FinalTable[j].Name = cGlobalInfo.ListWellClasses[j].Name; } cListWells ListWellsToProcess = new cListWells(null); cDescriptorType CurrentDesc = cGlobalInfo.CurrentScreening.ListDescriptors[i]; // build the table foreach (cPlate CurrentPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) { foreach (cWell CurrentWell in CurrentPlate.ListActiveWells) { if ((CurrentWell.GetCurrentClassIdx() < 0) || (ListClassSelected[0][CurrentWell.GetCurrentClassIdx()] == 0)) continue; { FinalTable[CurrentWell.GetCurrentClassIdx()].Add(CurrentWell.GetAverageValue(CurrentDesc)); ListWellsToProcess.Add(CurrentWell); } } } cClean C = new cClean(); C.SetInputData(FinalTable); C.Run(); cExtendedTable NewTable = C.GetOutPut(); cTwoSampleFTest TSFTest = null; cANOVA Anova = null; cTwoSampleUnpooledTTest TwoSampleTTest = null; cStudent_tTest StudentTTest = null; if (TestType == eTestType.F_TEST) { TSFTest = new cTwoSampleFTest(); TSFTest.SetInputData(NewTable); TSFTest.Run(); VTable.SetInputData(TSFTest.GetOutPut()); VT.SetInputData(TSFTest.GetInfo()); } else if (TestType == eTestType.ANOVA) { Anova = new cANOVA(); Anova.SetInputData(NewTable); Anova.Run(); VTable.SetInputData(Anova.GetOutPut()); VT.SetInputData(Anova.GetInfo()); } else if (TestType == eTestType.TWO_SAMPLES_T_TEST) { TwoSampleTTest = new cTwoSampleUnpooledTTest(); TwoSampleTTest.SetInputData(NewTable); TwoSampleTTest.Run(); VTable.SetInputData(TwoSampleTTest.GetOutPut()); VT.SetInputData(TwoSampleTTest.GetInfo()); } else if (TestType == eTestType.STUDENT_T_TEST) { StudentTTest = new cStudent_tTest(); StudentTTest.SetInputData(NewTable); StudentTTest.Run(); VTable.SetInputData(StudentTTest.GetOutPut()); VT.SetInputData(StudentTTest.GetInfo()); } VTable.DigitNumber = -1; VTable.Run(); DS.SetInputData(VTable.GetOutPut()); VT.Run(); DS.SetInputData(VT.GetOutPut()); DS.Run(); DS.Title = cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName(); cDesignerSplitter DSMain = new cDesignerSplitter(); DSMain.Orientation = Orientation.Horizontal; DSMain.SetInputData(DS.GetOutPut()); // Compute and display associated Stacked histogram //CDW1.Title = CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Stacked Histogram - " + PlateList.Count + " plates"; cExtendedTable TableForHisto = ListWellsToProcess.GetAverageDescriptorValues(i); TableForHisto.Name = ""; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(TableForHisto); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName(); CV1.Chart.IsLegend = true; CV1.Run(); DSMain.SetInputData(CV1.GetOutPut()); DSMain.Title = cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName(); DSMain.Run(); DT.SetInputData(DSMain.GetOutPut()); } DT.Run(); cDisplayToWindow DTW = new cDisplayToWindow(); DTW.SetInputData(DT.GetOutPut()); DTW.Title = "Classification Significance - " + TestType.ToString(); DTW.Run(); DTW.Display(); }
private void dToolStripMenuItem_Click(object sender, EventArgs e) { cFeedBackMessage MessageReturned; cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses(); GUI_ListClasses.IsCheckBoxes = true; GUI_ListClasses.IsSelectAll = true; if (GUI_ListClasses.Run().IsSucceed == false) return; cExtendedList ListClassSelected = GUI_ListClasses.GetOutPut()[0]; List<cWellClassType> ListWellClassesSelected = new List<cWellClassType>(); foreach (var item in ListClassSelected.ListTags) { ListWellClassesSelected.Add((cWellClassType)(item)); } cViewerGraph1D V1D = new cViewerGraph1D(); V1D.Chart.IsSelectable = true; V1D.Chart.LabelAxisX = "Well Index"; V1D.Chart.LabelAxisY = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); V1D.Chart.IsXGrid = true; if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) { cExtendedTable DataFromPlate = new cExtendedTable(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells, cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx, ListClassSelected); DataFromPlate.Name = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName(); V1D.Chart.IsShadow = true; V1D.Chart.IsBorder = true; //V1D.Chart.IsSelectable = true; V1D.Chart.CurrentTitle.Tag = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate(); V1D.SetInputData(DataFromPlate); V1D.Run(); cDesignerSplitter DS = new cDesignerSplitter(); DS.Orientation = System.Windows.Forms.Orientation.Horizontal; DS.SetInputData(V1D.GetOutPut()); cExtendedTable NewTable = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.Filter(ListWellClassesSelected).GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = "Histogram"; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Run(); DS.SetInputData(CV1.GetOutPut()); DS.Run(); cDisplayToWindow Disp0 = new cDisplayToWindow(); Disp0.SetInputData(DS.GetOutPut()); Disp0.Title = "Scatter points graph - " + DataFromPlate[0].Count + " wells."; if (!Disp0.Run().IsSucceed) return; Disp0.Display(); } else if (ProcessModeEntireScreeningToolStripMenuItem.Checked) { V1D.Chart.MarkerSize = 5; V1D.Chart.IsBorder = false; V1D.Chart.IsShadow = false; cListWells ListWell = new cListWells(null); int IdxWellForPlateSeparator = 0; foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) { foreach (cWell TmpWell in TmpPlate.ListActiveWells) { int ClassTmp = TmpWell.GetCurrentClassIdx(); if ((ClassTmp == -1) || (GUI_ListClasses.GetOutPut()[0][TmpWell.GetCurrentClassIdx()] == 0)) continue; ListWell.Add(TmpWell); IdxWellForPlateSeparator++; } if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxDisplayPlatesVerticalLines.Checked) { Classes.Base_Classes.General.cLineVerticalForGraph VL = new Classes.Base_Classes.General.cLineVerticalForGraph(IdxWellForPlateSeparator + 0.5); VL.IsAllowMoving = false; V1D.Chart.ListVerticalLines.Add(VL); } } cExtendedTable DataFromPlate = new cExtendedTable(ListWell, cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx, ListClassSelected); DataFromPlate.Name = cGlobalInfo.CurrentScreening.GetName() + " - " + cGlobalInfo.CurrentScreening.ListPlatesActive.Count + " plates"; int MaxNumberOfPts = (int)cGlobalInfo.OptionsWindow.FFAllOptions.numericUpDownMinNumPointForFastDisp.Value; if (ListWell.Count > MaxNumberOfPts) { cGlobalInfo.WindowHCSAnalyzer.richTextBoxConsole.AppendText("\n" + V1D.Title + ": Number of Wells is Higher than " + MaxNumberOfPts + " => Switching to FastPoints Mode.\n"); V1D.Chart.ISFastPoint = true; } V1D.SetInputData(DataFromPlate); V1D.Run(); cDesignerSplitter DS = new cDesignerSplitter(); DS.Orientation = System.Windows.Forms.Orientation.Horizontal; DS.SetInputData(V1D.GetOutPut()); cExtendedTable NewTable = ListWell.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = "Histogram"; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Run(); DS.SetInputData(CV1.GetOutPut()); DS.Run(); cDisplayToWindow Disp0 = new cDisplayToWindow(); Disp0.SetInputData(DS.GetOutPut()); Disp0.Title = "Scatter points graph - " + DataFromPlate[0].Count + " wells."; if (!Disp0.Run().IsSucceed) return; Disp0.Display(); } else if (ProcessModeplateByPlateToolStripMenuItem.Checked) { cDesignerTab CDT = new cDesignerTab(); foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) { cExtendedTable DataFromPlate = new cExtendedTable(TmpPlate.ListActiveWells, cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx, ListClassSelected); DataFromPlate.Name = TmpPlate.GetName(); V1D = new cViewerGraph1D(); V1D.Chart.IsSelectable = true; V1D.Chart.LabelAxisX = "Well Index"; V1D.Chart.LabelAxisY = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); V1D.Chart.IsXGrid = true; V1D.Chart.CurrentTitle.Tag = TmpPlate; V1D.SetInputData(DataFromPlate); V1D.Title = TmpPlate.GetName(); V1D.Run(); cDesignerSplitter DS = new cDesignerSplitter(); DS.Orientation = System.Windows.Forms.Orientation.Horizontal; DS.SetInputData(V1D.GetOutPut()); cExtendedTable NewTable = TmpPlate.ListActiveWells.Filter(ListWellClassesSelected).GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = "Histogram"; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Run(); DS.Title = TmpPlate.GetName(); DS.SetInputData(CV1.GetOutPut()); DS.Run(); CDT.SetInputData(DS.GetOutPut()); } CDT.Run(); cDisplayToWindow Disp0 = new cDisplayToWindow(); Disp0.SetInputData(CDT.GetOutPut()); Disp0.Title = "Scatter points graphs"; if (!Disp0.Run().IsSucceed) return; Disp0.Display(); } }
private void ToolStripMenuItem_DisplayHistograms(object sender, EventArgs e) { cDesignerTab DT = new cDesignerTab(); cListExtendedTable ListTables = new cListExtendedTable(this.AssociatedImage); for (int i = 0; i < ListTables.Count; i++) { cLinearize LI = new cLinearize(); LI.SetInputData(ListTables[i]); LI.Run(); cViewerStackedHistogram VH = new cViewerStackedHistogram(); VH.SetInputData(LI.GetOutPut()); VH.Title = ListTables[i].Name; if (!VH.Run().IsSucceed) return; DT.SetInputData(VH.GetOutPut()); } DT.Run(); cDisplayToWindow MyDisplay = new cDisplayToWindow(); MyDisplay.SetInputData(DT.GetOutPut()); MyDisplay.Title = "Histograms(" + this.AssociatedImage.Name + ")"; MyDisplay.Run(); MyDisplay.Display(); }
private void stackedHistogramsToolStripMenuItem_Click(object sender, EventArgs e) { cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses(); GUI_ListClasses.IsCheckBoxes = true; GUI_ListClasses.IsSelectAll = true; if (GUI_ListClasses.Run().IsSucceed == false) return; cExtendedList ListClassSelected = GUI_ListClasses.GetOutPut()[0]; if (ListClassSelected.Sum() < 1) { MessageBox.Show("At least one classe has to be selected.", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } cDisplayToWindow CDW1 = new cDisplayToWindow(); if ((ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) || (ProcessModeEntireScreeningToolStripMenuItem.Checked)) { cListWells ListWellsToProcess = new cListWells(null); List<cPlate> PlateList = new List<cPlate>(); if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) PlateList.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate()); else { foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) PlateList.Add(TmpPlate); } foreach (cPlate TmpPlate in PlateList) foreach (cWell item in TmpPlate.ListActiveWells) if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item); if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) CDW1.Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Stacked Histogram (" + PlateList[0].GetName() + ")"; else CDW1.Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Stacked Histogram - " + PlateList.Count + " plates"; cExtendedTable NewTable = ListWellsToProcess.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = CDW1.Title; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Run(); CDW1.SetInputData(CV1.GetOutPut()); } else if (ProcessModeplateByPlateToolStripMenuItem.Checked) { cDesignerTab CDT = new cDesignerTab(); foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) { cListWells ListWellsToProcess = new cListWells(null); foreach (cWell item in TmpPlate.ListActiveWells) if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item); cExtendedTable NewTable = ListWellsToProcess.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - " + TmpPlate.GetName(); cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Title = TmpPlate.GetName(); CV1.Run(); CDT.SetInputData(CV1.GetOutPut()); } CDT.Run(); CDW1.SetInputData(CDT.GetOutPut()); CDW1.Title = "Stacked Histogram - " + cGlobalInfo.CurrentScreening.ListPlatesActive.Count + " plates"; } CDW1.Run(); CDW1.Display(); }
private void ToolStripMenuItem_DisplayHistograms(object sender, EventArgs e) { if (GlobalInfo == null) return; for (int i = 0; i < cGlobalInfo.ListWellClasses.Count; i++) { if (cGlobalInfo.ListWellClasses[i].Name == this.Name) { Idx = i; break; } } if (Idx == -1) return; if ((cGlobalInfo.CurrentScreening.ListDescriptors == null) || (cGlobalInfo.CurrentScreening.ListDescriptors.Count == 0)) return; cDisplayToWindow CDW1 = new cDisplayToWindow(); cListWells ListWellsToProcess = new cListWells(null); List<cPlate> PlateList = new List<cPlate>(); cDesignerSplitter DS = new cDesignerSplitter(); foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) PlateList.Add(TmpPlate); foreach (cPlate TmpPlate in PlateList) foreach (cWell item in TmpPlate.ListActiveWells) if (item.GetCurrentClassIdx() == base.Idx) ListWellsToProcess.Add(item); cExtendedTable NewTable2 = ListWellsToProcess.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable2.Name = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Histogram - " + PlateList.Count + " plates"; cViewerStackedHistogram CV2 = new cViewerStackedHistogram(); CV2.SetInputData(NewTable2); CV2.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV2.Chart.IsBorder = false; CV2.Chart.Width = 0; CV2.Chart.Height = 0; //StripLine AverageLine = new StripLine(); //AverageLine.BackColor = Color.Red; //AverageLine.IntervalOffset = GlobalInfo.CurrentScreen.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetValue(); //AverageLine.StripWidth = 0.0001; //AverageLine.Text = this.ListDescriptors[Parent.ListDescriptors.CurrentSelectedDescriptor].GetValue().ToString("N2"); CV2.Run(); //CV2.Chart.ChartAreas[0].AxisX.StripLines.Add(AverageLine); DS.SetInputData(CV2.GetOutPut()); PlateList.Clear(); PlateList.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate()); ListWellsToProcess.Clear(); foreach (cPlate TmpPlate in PlateList) foreach (cWell item in TmpPlate.ListActiveWells) if (item.GetCurrentClassIdx() == Idx) ListWellsToProcess.Add(item); CDW1.Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Histogram (" + PlateList[0].GetName() + ")"; cExtendedTable NewTable = ListWellsToProcess.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = CDW1.Title; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Chart.Width = 0; CV1.Chart.Height = 0; // CV1.Chart.ChartAreas[0].AxisX.Minimum = CV2.Chart.ChartAreas[0].AxisX.Minimum; // CV1.Chart.ChartAreas[0].AxisX.Maximum = CV2.Chart.ChartAreas[0].AxisX.Maximum; CV1.Run(); // CV1.Chart.ChartAreas[0].AxisX.StripLines.Add(AverageLine); DS.SetInputData(CV1.GetOutPut()); DS.Run(); CDW1.SetInputData(DS.GetOutPut()); CDW1.Run(); CDW1.Display(); return; }
private void ToolStripMenuItem_DisplaySingleCellHistogram(object sender, EventArgs e) { cListWells ListWells = new cListWells(); List<cDescriptorType> LCDT = new List<cDescriptorType>(); LCDT.Add(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()); List<cWellClassType> ListForCurrentClass = new List<cWellClassType>(); ListForCurrentClass.Add(this); cGUI_ListClasses GUIClasses = new cGUI_ListClasses(); GUIClasses.IsCheckBoxes = true; GUIClasses.IsSelectAll = true; GUIClasses.ClassType = eClassType.PHENOTYPE; if (!GUIClasses.Run().IsSucceed) return; cDesignerTab DT = new cDesignerTab(); if (cGlobalInfo.WindowHCSAnalyzer.ProcessModeEntireScreeningToolStripMenuItem.Checked) { foreach (cPlate CurrentPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) { ListWells.AddRange(CurrentPlate.ListWells.Filter(ListForCurrentClass)); } cExtendedTable FinalTable = new cExtendedTable(); FinalTable.Name = "Stacked Histogram: " + ListWells.Count + " wells"; int Idx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { FinalTable.Add(new cExtendedList()); FinalTable[Idx].Name = item.Name; FinalTable[Idx].Tag = item; Idx++; } foreach (cWell TmpWell in ListWells) { TmpWell.AssociatedPlate.DBConnection = new cDBConnection(TmpWell.AssociatedPlate, TmpWell.SQLTableName); int IDx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { if (GUIClasses.GetOutPut()[0][IDx] == 0) { IDx++; continue; } List<cCellularPhenotype> ListCellularPhenotypesToBeSelected = new List<cCellularPhenotype>(); ListCellularPhenotypesToBeSelected.Add(item); cExtendedTable TmpET = TmpWell.AssociatedPlate.DBConnection.GetWellValues(TmpWell, LCDT, ListCellularPhenotypesToBeSelected); if (TmpET.Count > 0) FinalTable[IDx].AddRange(TmpET[0]); IDx++; } TmpWell.AssociatedPlate.DBConnection.CloseConnection(); } cViewerStackedHistogram VSH = new cViewerStackedHistogram(); VSH.SetInputData(FinalTable); VSH.Chart.BinNumber = LCDT[0].GetBinNumber(); VSH.Chart.IsShadow = false; VSH.Chart.IsBorder = false; VSH.Chart.IsXGrid = true; VSH.Chart.IsYGrid = true; VSH.Chart.LabelAxisX = LCDT[0].GetName(); VSH.Run(); VSH.Chart.Width = 0; VSH.Chart.Height = 0; VSH.GetOutPut().Title = cGlobalInfo.CurrentScreening.GetName(); DT.SetInputData(VSH.GetOutPut()); } else { cListPlates ListPlates = new cListPlates(); if (cGlobalInfo.WindowHCSAnalyzer.ProcessModeplateByPlateToolStripMenuItem.Checked) ListPlates = cGlobalInfo.CurrentScreening.ListPlatesActive; else ListPlates.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate()); foreach (cPlate CurrentPlate in ListPlates) { ListWells = CurrentPlate.ListWells.Filter(ListForCurrentClass); cExtendedTable FinalTable = new cExtendedTable(); FinalTable.Name = "Stacked Histogram: " + ListWells.Count + " wells - " + CurrentPlate.GetName(); int Idx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { FinalTable.Add(new cExtendedList()); FinalTable[Idx].Name = item.Name; FinalTable[Idx].Tag = item; if (GUIClasses.GetOutPut()[0][Idx] == 0) { Idx++; continue; } Idx++; } foreach (cWell TmpWell in ListWells) { TmpWell.AssociatedPlate.DBConnection = new cDBConnection(TmpWell.AssociatedPlate, TmpWell.SQLTableName); int IDx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { if (GUIClasses.GetOutPut()[0][IDx] == 0) { IDx++; continue; } List<cCellularPhenotype> ListCellularPhenotypesToBeSelected = new List<cCellularPhenotype>(); ListCellularPhenotypesToBeSelected.Add(item); cExtendedTable TmpET = TmpWell.AssociatedPlate.DBConnection.GetWellValues(TmpWell, LCDT, ListCellularPhenotypesToBeSelected); if (TmpET.Count > 0) FinalTable[IDx].AddRange(TmpET[0]); IDx++; } TmpWell.AssociatedPlate.DBConnection.CloseConnection(); } cViewerStackedHistogram VSH = new cViewerStackedHistogram(); VSH.SetInputData(FinalTable); VSH.Chart.BinNumber = LCDT[0].GetBinNumber(); VSH.Chart.IsShadow = false; VSH.Chart.IsBorder = false; VSH.Chart.IsXGrid = true; VSH.Chart.IsYGrid = true; VSH.Chart.LabelAxisX = LCDT[0].GetName(); VSH.Run(); VSH.Chart.Width = 0; VSH.Chart.Height = 0; VSH.GetOutPut().Title = CurrentPlate.GetName(); DT.SetInputData(VSH.GetOutPut()); } } DT.Run(); cDisplayToWindow DTW = new cDisplayToWindow(); DTW.SetInputData(DT.GetOutPut()); DTW.Title = "Single Cell Histograms"; DTW.Run(); DTW.Display(); }
private void ToolStripMenuItem_DisplayAsStackedHistograms(object sender, EventArgs e) { cDisplayToWindow CDW1 = new cDisplayToWindow(); cListWells ListWellsToProcess = new cListWells(null); List<cPlate> PlateList = new List<cPlate>(); PlateList.Add(this); foreach (cPlate TmpPlate in PlateList) foreach (cWell item in TmpPlate.ListActiveWells) if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item); CDW1.Title = this.ParentScreening.ListDescriptors[this.ParentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Stacked Histogram (" + PlateList[0].Name + ")"; cExtendedTable NewTable = ListWellsToProcess.GetAverageDescriptorValues(this.ParentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = CDW1.Title; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = this.ParentScreening.ListDescriptors[this.ParentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Run(); CDW1.SetInputData(CV1.GetOutPut()); CDW1.Run(); CDW1.Display(); }
public void ExportToHTML(cDescriptorType Desc) { if (Desc.IsConnectedToDatabase == false) return; List<cDescriptorType> LCDT = new List<cDescriptorType>(); LCDT.Add(Desc); List<cCellularPhenotype> ListCellularPhenotypesToBeSelected = new List<cCellularPhenotype>(); cGUI_ListClasses GUIClasses = new cGUI_ListClasses(); GUIClasses.IsCheckBoxes = true; GUIClasses.IsSelectAll = true; GUIClasses.ClassType = eClassType.PHENOTYPE; if (!GUIClasses.Run().IsSucceed) return; int IDx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { if ((GUIClasses.GetOutPut()[0][IDx++] != 0)) ListCellularPhenotypesToBeSelected.Add(item); } cExtendedTable ET = new cExtendedTable(cGlobalInfo.CurrentScreening.Columns, cGlobalInfo.CurrentScreening.Rows, 0); ET.Name = this.Name + " [" + Desc.GetName() + "]"; ET.ListRowNames = new List<string>(); for (int i = 0; i < ET[0].Count; i++) { ET.ListRowNames.Add(((char)(i + 65)).ToString()); } FormForProgress MyProgressBar = new FormForProgress(); MyProgressBar.progressBar.Maximum = this.ListActiveWells.Count; MyProgressBar.Show(); //ET.ListTags = new List<object>(); for (int i = 0; i < cGlobalInfo.CurrentScreening.Columns; i++) { ET[i].ListTags = new List<object>(); ET[i].Name = (i + 1).ToString(); for (int j = 0; j < cGlobalInfo.CurrentScreening.Rows; j++) { MyProgressBar.progressBar.Update(); cWell TmpWell = this.GetWell(i, j, true); if (TmpWell == null) { ET[i].ListTags.Add("n.a."); continue; } MyProgressBar.progressBar.Value++; cExtendedTable TmpET = null; if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportStackedHisto.Checked) TmpET = TmpWell.GetValuesList(LCDT, ListCellularPhenotypesToBeSelected, true); else TmpET = TmpWell.GetValuesList(LCDT, ListCellularPhenotypesToBeSelected, false); TmpET.Name = "[" + TmpWell.GetPos() + "] - " + TmpET[0].Count + " Objects"; // get the values associated to this well and descriptor if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportStackedHisto.Checked) { cExtendedTable FinalTable = new cExtendedTable(); FinalTable.Name = "Stacked Histogram - " + this.GetName(); int Idx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { FinalTable.Add(new cExtendedList()); FinalTable[Idx].Name = item.Name; FinalTable[Idx].Tag = item; for (int k = 0; k < TmpET[1].Count; k++) { if (TmpET[1][k] == Idx) FinalTable[Idx].Add(TmpET[0][k]); } Idx++; } cViewerStackedHistogram VSH = new cViewerStackedHistogram(); VSH.SetInputData(FinalTable);//TmpET); VSH.Chart.LabelAxisX = Desc.GetName(); VSH.Chart.IsLine = false; VSH.Chart.CurrentTitle.Text = TmpET.Name; if ((cGlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked) || (cGlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked)) { VSH.Chart.DefaultAxisXMin = new cExtendedList(); VSH.Chart.DefaultAxisXMin.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMin.Value); VSH.Chart.DefaultAxisXMax = new cExtendedList(); VSH.Chart.DefaultAxisXMax.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMax.Value); if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportBackColorClass.Checked) VSH.Chart.BackgroundColor = TmpWell.GetClassColor(); } VSH.Chart.BinNumber = Desc.GetBinNumber(); VSH.Chart.IsShadow = false; VSH.Chart.IsBorder = false; VSH.Run(); ET[i].ListTags.Add((Chart)VSH.Chart); } else { cViewerHistogram VH = new cViewerHistogram(); VH.SetInputData(TmpET); VH.Chart.LabelAxisX = Desc.GetName(); VH.Chart.CurrentTitle.Text = TmpET.Name; if ((cGlobalInfo.OptionsWindow.radioButtonHistoDisplayManualMinMax.Checked) || (cGlobalInfo.OptionsWindow.radioButtonHistoDisplayAutomatedMinMax.Checked)) { VH.Chart.DefaultAxisXMin = new cExtendedList(); VH.Chart.DefaultAxisXMin.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMin.Value); VH.Chart.DefaultAxisXMax = new cExtendedList(); VH.Chart.DefaultAxisXMax.Add((double)cGlobalInfo.OptionsWindow.numericUpDownManualMax.Value); if (cGlobalInfo.OptionsWindow.FFAllOptions.checkBoxHTMLExportBackColorClass.Checked) VH.Chart.BackgroundColor = TmpWell.GetClassColor(); } VH.Run(); ET[i].ListTags.Add((Chart)VH.Chart); } } } MyProgressBar.Close(); cTableToHTML TToHTML = new cTableToHTML(); TToHTML.IsDisplayUIForFilePath = true; TToHTML.SetInputData(ET); TToHTML.Run(); }
public void Refresh1DScatter() { List<cWellClassType> ListWellClassesSelected = cGlobalInfo.ListWellClasses; cViewerGraph1D V1D = new cViewerGraph1D(); V1D.Chart.IsSelectable = true; V1D.Chart.LabelAxisX = "Well Index"; V1D.Chart.LabelAxisY = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); V1D.Chart.IsDetachable = false; V1D.Chart.IsXGrid = true; cExtendedList EtF = new cExtendedList(); for (int i = 0; i < cGlobalInfo.ListWellClasses.Count; i++) { EtF.Add(1); } cExtendedTable DataFromPlate = new cExtendedTable(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells, cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx, EtF); DataFromPlate.Name = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName(); V1D.Chart.IsShadow = true; V1D.Chart.IsBorder = true; //V1D.Chart.IsSelectable = true; V1D.Chart.CurrentTitle.Tag = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate(); V1D.SetInputData(DataFromPlate); V1D.Run(); cDesignerSplitter DS = new cDesignerSplitter(); DS.Orientation = System.Windows.Forms.Orientation.Horizontal; DS.SetInputData(V1D.GetOutPut()); cExtendedTable NewTable = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.Filter(ListWellClassesSelected).GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = "Histogram"; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Run(); CV1.Chart.IsDetachable = false; DS.SetInputData(CV1.GetOutPut()); DS.Run(); cGlobalInfo.WindowHCSAnalyzer.tabPage1DView.Controls.Clear(); DS.GetOutPut().Width = cGlobalInfo.WindowHCSAnalyzer.tabPage1DView.Width; DS.GetOutPut().Height = cGlobalInfo.WindowHCSAnalyzer.tabPage1DView.Height; DS.GetOutPut().Controls[0].Width = cGlobalInfo.WindowHCSAnalyzer.tabPage1DView.Width; DS.GetOutPut().Controls[0].Height = cGlobalInfo.WindowHCSAnalyzer.tabPage1DView.Height; cGlobalInfo.WindowHCSAnalyzer.tabPage1DView.Controls.Add(DS.GetOutPut()); }
public void DisplayInfoWindow(int IdxDescriptor) { FormForWellInformation NewWindow = new FormForWellInformation(this); NewWindow.Text = this.GetShortInfo(); cExtendedTable EL = this.GetAverageValuesList(true); cViewerTable VT = new cViewerTable(); VT.SetInputData(EL); VT.Run(); cExtendedControl EXT = VT.GetOutPut(); EXT.Width = NewWindow.panelForDescValues.Width; EXT.Height = NewWindow.panelForDescValues.Height; NewWindow.panelForDescValues.Controls.Add(VT.GetOutPut()); NewWindow.textBoxName.Text = GetCpdName(); NewWindow.textBoxInfo.Text = Info; object ConcentrationValue = this.ListProperties.FindValueByName("Concentration"); if (ConcentrationValue != null) NewWindow.textBoxConcentration.Text = ((double)ConcentrationValue).ToString("e4"); else NewWindow.textBoxConcentration.Text = "n.a."; object ValObj = this.ListProperties.FindValueByName("Locus ID"); if (ValObj != null) { int LocusID = (int)ValObj; NewWindow.textBoxLocusID.Text = ((int)(LocusID)).ToString(); } else NewWindow.textBoxLocusID.Text = "n.a."; if (cGlobalInfo.ViewMode != eViewMode.PIE) { if (/*(cGlobalInfo.ViewMode == eViewMode.DISTRIBUTION) &&*/ (cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor().IsConnectedToDatabase)) { this.AssociatedPlate.DBConnection = new cDBConnection(this.AssociatedPlate, this.SQLTableName); List<cDescriptorType> LCDT = new List<cDescriptorType>(); LCDT.Add(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()); cExtendedTable ET = new cExtendedTable(); foreach (var item in cGlobalInfo.ListCellularPhenotypes) { List<cCellularPhenotype> ListCellularPhenotypesToBeSelected = new List<cCellularPhenotype>(); ListCellularPhenotypesToBeSelected.Add(item); cExtendedTable TmpET = this.AssociatedPlate.DBConnection.GetWellValues(this, LCDT, ListCellularPhenotypesToBeSelected); if (TmpET.Count == 0) continue; TmpET[0].Name = item.Name; TmpET[0].Tag = item; ET.Add(TmpET[0]); } ET.Name = this.GetShortInfo(); cViewerStackedHistogram VSH = new cViewerStackedHistogram(); VSH.SetInputData(ET); // VSH.Chart.BinNumber = LCDT[0].GetBinNumber(); VSH.ListProperties.FindByName("Bin Number").SetNewValue((int)LCDT[0].GetBinNumber()); //VS.Chart.IsSelectable = true; //VSH.Chart.BackgroundColor = Color.LightGray; VSH.Chart.IsShadow = true; VSH.Chart.IsXGrid = true; VSH.Chart.IsYGrid = true; VSH.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); VSH.Run(); VSH.Chart.Width = 0; VSH.Chart.Height = 0; cExtendedControl EC = VSH.GetOutPut(); EC.Width = NewWindow.chartForFormWell.Width; EC.Height = NewWindow.chartForFormWell.Height; NewWindow.chartForFormWell.Controls.Add(EC); this.AssociatedPlate.DBConnection.CloseConnection(); } else { NewWindow.tabControlMain.TabPages.RemoveByKey("tabPageHisto"); } } else { NewWindow.tabControlMain.TabPages["tabPageHisto"].Text = "Pie"; Series CurrentSeries = new Series("ChartSeries" + PosX + "x" + PosY); ChartArea CurrentChartArea = new ChartArea("ChartArea" + PosX + "x" + PosY); CurrentSeries.ChartType = SeriesChartType.Pie; for (int IdxValue = 0; IdxValue < ListSignatures.Count; IdxValue++) { if (ListSignatures[IdxValue].GetAssociatedType().IsActive()) { double Value = ListSignatures[IdxValue].GetValue(); CurrentSeries.Points.Add(Value); if (Value > 0) { CurrentSeries.Points[CurrentSeries.Points.Count - 1].Label = ListSignatures[IdxValue].GetAssociatedType().GetName(); CurrentSeries.Points[CurrentSeries.Points.Count - 1].ToolTip = Value.ToString(); } } } CurrentChartArea.BorderColor = Color.Black; NewWindow.chartForFormWell.ChartAreas.Add(CurrentChartArea); NewWindow.chartForFormWell.TextAntiAliasingQuality = TextAntiAliasingQuality.High; CurrentChartArea.BackColor = Color.FromArgb(64, 64, 64); CurrentSeries.ChartArea = "ChartArea" + PosX + "x" + PosY; CurrentSeries.Name = "Series" + PosX + "x" + PosY; NewWindow.chartForFormWell.Series.Add(CurrentSeries); } #region Text Info NewWindow.richTextBoxDescription.AcceptsTab = true; NewWindow.richTextBoxDescription.AppendText("Plate: " + this.AssociatedPlate.GetName() + "\nWell: [" + this.GetPosX() + "x" + this.GetPosY() + "] - " + this.GetNumBiologicalObjects() + " Object(s)."); NewWindow.richTextBoxDescription.AppendText("\n\nProperty List:\n"); foreach (var item in this.ListProperties) { if (item.GetValue() != null) { NewWindow.richTextBoxDescription.AppendText("\nName:\t" + item.PropertyType.Name + "\n\tType: " + item.PropertyType.Type.ToString() + "\n\tValue: " + item.GetValue().ToString() + "\n\tLocked: " + item.PropertyType.IsLocked.ToString() + "\n"); if ((item.PropertyType.Type == eDataType.DOUBLE) || (item.PropertyType.Type == eDataType.INTEGER)) { NewWindow.richTextBoxDescription.AppendText("\tMin:\t" + item.PropertyType.Min + "\n\tMax: " + item.PropertyType.Max + "\n"); } } else NewWindow.richTextBoxDescription.AppendText("\nName:\t" + item.PropertyType.Name + "\n\tType: " + item.PropertyType.Type.ToString() + "\n\tValue: NULL\n\tLocked: " + item.PropertyType.IsLocked.ToString() + "\n"); } #endregion NewWindow.chartForFormWell.Update(); NewWindow.Show(); return; }
//private void ToolStripMenuItem_DisplayImage(object sender, EventArgs e) //{ // vtkImageData ID0 = null; // string[] ListChar = this.Info.Split('.'); // if (ListChar[ListChar.Length - 1].ToLower() == "jpg") // { // vtkJPEGReader JPEGReader = vtkJPEGReader.New(); // JPEGReader.SetFileName(this.Info); // JPEGReader.Update(); // ID0 = JPEGReader.GetOutput(); // } // if ((ListChar[ListChar.Length - 1].ToLower() == "tif") || (ListChar[ListChar.Length - 1].ToLower() == "tiff")) // { // vtkTIFFReader TIFFReader = vtkTIFFReader.New(); // TIFFReader.SetFileName(this.Info); // TIFFReader.Update(); // ID0 = TIFFReader.GetOutput(); // } // vtkImageReader Reader = vtkImageReader.New(); // Reader.SetFileName(this.Info); // Reader.Update(); // if (Reader == null) return; // //vtkJPEGReader TIFFReader = vtkJPEGReader.New(); // //TIFFReader.SetFileName(this.Info); // //TIFFReader.Update(); // // cVolume3D Volume3D0 = new cVolume3D(ID0, new HCSAnalyzer.Classes._3D.cPoint3D(0, 0, 0)); // cViewerImage3D VI3D = new cViewerImage3D(); // VI3D.SetInputData(ID0); // VI3D.Run(); // cDisplayToWindow DTW = new cDisplayToWindow(); // DTW.SetInputData(VI3D.GetOutPut()); // DTW.Title = this.Info; // DTW.Run(); // DTW.Title = this.Info; // DTW.Display(); //} private void DisplayHisto(object sender, EventArgs e) { if ((cGlobalInfo.CurrentScreening.ListDescriptors == null) || (cGlobalInfo.CurrentScreening.ListDescriptors.Count == 0)) return; cDisplayToWindow CDW1 = new cDisplayToWindow(); cListWells ListWellsToProcess = new cListWells(null); List<cPlate> PlateList = new List<cPlate>(); cDesignerSplitter DS = new cDesignerSplitter(); foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive) PlateList.Add(TmpPlate); foreach (cPlate TmpPlate in PlateList) foreach (cWell item in TmpPlate.ListActiveWells) if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item); cExtendedTable NewTable2 = ListWellsToProcess.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable2.Name = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Stacked Histogram - " + PlateList.Count + " plates"; cViewerStackedHistogram CV2 = new cViewerStackedHistogram(); CV2.SetInputData(NewTable2); CV2.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV2.Chart.IsBorder = false; CV2.Chart.Width = 0; CV2.Chart.Height = 0; StripLine AverageLine = new StripLine(); AverageLine.BackColor = Color.Red; AverageLine.IntervalOffset = this.ListSignatures[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetValue(); AverageLine.StripWidth = 0.0001; AverageLine.Text = this.ListSignatures[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetValue().ToString("N2"); CV2.Run(); CV2.Chart.ChartAreas[0].AxisX.StripLines.Add(AverageLine); DS.SetInputData(CV2.GetOutPut()); PlateList.Clear(); PlateList.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate()); ListWellsToProcess.Clear(); foreach (cPlate TmpPlate in PlateList) foreach (cWell item in TmpPlate.ListActiveWells) if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item); CDW1.Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - Stacked Histogram (" + PlateList[0].GetName() + ")"; cExtendedTable NewTable = ListWellsToProcess.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); NewTable.Name = CDW1.Title; cViewerStackedHistogram CV1 = new cViewerStackedHistogram(); CV1.SetInputData(NewTable); CV1.Chart.LabelAxisX = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); CV1.Chart.Width = 0; CV1.Chart.Height = 0; // CV1.Chart.ChartAreas[0].AxisX.Minimum = CV2.Chart.ChartAreas[0].AxisX.Minimum; // CV1.Chart.ChartAreas[0].AxisX.Maximum = CV2.Chart.ChartAreas[0].AxisX.Maximum; CV1.Run(); CV1.Chart.ChartAreas[0].AxisX.StripLines.Add(AverageLine); DS.SetInputData(CV1.GetOutPut()); DS.Run(); CDW1.SetInputData(DS.GetOutPut()); CDW1.Run(); CDW1.Display(); return; //cExtendedList Pos = new cExtendedList(); //cWell TempWell; //int NumberOfPlates = cGlobalInfo.PlateListWindow.listBoxPlateNameToProcess.Items.Count; //// loop on all the plate //for (int PlateIdx = 0; PlateIdx < NumberOfPlates; PlateIdx++) //{ // cPlate CurrentPlateToProcess = cGlobalInfo.CurrentScreening.ListPlatesActive.GetPlate((string)cGlobalInfo.PlateListWindow.listBoxPlateNameToProcess.Items[PlateIdx]); // for (int row = 0; row < cGlobalInfo.CurrentScreening.Rows; row++) // for (int col = 0; col < cGlobalInfo.CurrentScreening.Columns; col++) // { // TempWell = CurrentPlateToProcess.GetWell(col, row, false); // if (TempWell == null) continue; // else // { // if (TempWell.GetClassIdx() == this.ClassForClassif) // Pos.Add(TempWell.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptor].GetValue()); // } // } //} //if (Pos.Count == 0) //{ // MessageBox.Show("No well of class " + cGlobalInfo.CurrentScreening.SelectedClass + " selected !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; //} //List<double[]> HistoPos = Pos.CreateHistogram((int)cGlobalInfo.OptionsWindow.numericUpDownHistoBin.Value); //if (HistoPos == null) return; //cWindowToDisplayHisto NewWindow = new cWindowToDisplayHisto(this.Parent, Pos); //Series SeriesPos = new Series(); //SeriesPos.ShadowOffset = 1; //if (HistoPos.Count == 0) return; //for (int IdxValue = 0; IdxValue < HistoPos[0].Length; IdxValue++) //{ // SeriesPos.Points.AddXY(HistoPos[0][IdxValue], HistoPos[1][IdxValue]); // SeriesPos.Points[IdxValue].ToolTip = HistoPos[1][IdxValue].ToString(); // if (this.ClassForClassif == -1) // SeriesPos.Points[IdxValue].Color = Color.Black; // else // SeriesPos.Points[IdxValue].Color = cGlobalInfo.ListWellClasses[this.ClassForClassif].ColourForDisplay; //} //ChartArea CurrentChartArea = new ChartArea(); //CurrentChartArea.BorderColor = Color.Black; //NewWindow.chartForSimpleForm.ChartAreas.Add(CurrentChartArea); //CurrentChartArea.Axes[0].MajorGrid.Enabled = false; //CurrentChartArea.Axes[0].Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptor].GetName(); //CurrentChartArea.Axes[1].Title = "Sum"; //CurrentChartArea.AxisX.LabelStyle.Format = "N2"; //NewWindow.chartForSimpleForm.TextAntiAliasingQuality = TextAntiAliasingQuality.High; //CurrentChartArea.BackGradientStyle = GradientStyle.TopBottom; //CurrentChartArea.BackColor = cGlobalInfo.OptionsWindow.panel1.BackColor; //CurrentChartArea.BackSecondaryColor = Color.White; //SeriesPos.ChartType = SeriesChartType.Column; //// SeriesPos.Color = cGlobalInfo.CurrentScreening.GetColor(1); //NewWindow.chartForSimpleForm.Series.Add(SeriesPos); //NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserEnabled = true; //NewWindow.chartForSimpleForm.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; //NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScaleView.Zoomable = true; //NewWindow.chartForSimpleForm.ChartAreas[0].AxisX.ScrollBar.IsPositionedInside = true; //StripLine AverageLine = new StripLine(); //AverageLine.BackColor = Color.Red; //AverageLine.IntervalOffset = this.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptor].GetValue(); //AverageLine.StripWidth = 0.0001; //AverageLine.Text = String.Format("{0:0.###}", this.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptor].GetValue()); //CurrentChartArea.AxisX.StripLines.Add(AverageLine); //if (cGlobalInfo.OptionsWindow.checkBoxDisplayHistoStats.Checked) //{ // StripLine NAverageLine = new StripLine(); // NAverageLine.BackColor = Color.Black; // NAverageLine.IntervalOffset = Pos.Mean(); // NAverageLine.StripWidth = 0.0001;// double.Epsilon; // CurrentChartArea.AxisX.StripLines.Add(NAverageLine); // NAverageLine.Text = String.Format("{0:0.###}", NAverageLine.IntervalOffset); // StripLine StdLine = new StripLine(); // StdLine.BackColor = Color.FromArgb(64, Color.Black); // double Std = Pos.Std(); // StdLine.IntervalOffset = NAverageLine.IntervalOffset - 0.5 * Std; // StdLine.StripWidth = Std; // CurrentChartArea.AxisX.StripLines.Add(StdLine); // //NAverageLine.StripWidth = 0.01; //} //Title CurrentTitle = new Title(this.StateForClassif + " - " + cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptor].GetName() + " histogram."); //CurrentTitle.Font = new System.Drawing.Font("Arial", 11, FontStyle.Bold); //NewWindow.chartForSimpleForm.Titles.Add(CurrentTitle); //NewWindow.Text = CurrentTitle.Text; //NewWindow.Show(); //NewWindow.chartForSimpleForm.Update(); //NewWindow.chartForSimpleForm.Show(); //NewWindow.Controls.AddRange(new System.Windows.Forms.Control[] { NewWindow.chartForSimpleForm }); //return; }
private void RedrawHistoHorizontal(bool KeepBinning) { cExtendedTable FinalTable = new cExtendedTable(); int Idx = 0; foreach (var item in cGlobalInfo.ListCellularPhenotypes) { FinalTable.Add(new cExtendedList()); FinalTable[Idx].Name = item.Name; FinalTable[Idx].Tag = item; Idx++; } int IdxPt = 0; for (int j = 0; j < this.chartForPoints.Series[0].Points.Count; j++) { cSingleBiologicalObject TmpObj = (cSingleBiologicalObject)this.chartForPoints.Series[0].Points[j].Tag; if (this.ListPhenotypeVisible[(int)MachineLearning.Classes[j]]) { FinalTable[(int)MachineLearning.Classes[j]/*TmpObj.GetAssociatedPhenotype().Idx*/].Add(this.chartForPoints.Series[0].Points[j].XValue); IdxPt++; } } FinalTable.Name = "Stacked Histogram: " + IdxPt + " points"; int CurrentNumberOfBin = 100; if (KeepBinning && (VSH != null)) { CurrentNumberOfBin = VSH.Chart.BinNumber;// (int)VSH.ListProperties.FindByName("Bin Number").GetValue(); } VSH = new cViewerStackedHistogram(); VSH.SetInputData(FinalTable);//new cExtendedTable(ListValue)); VSH.Chart.LabelAxisY = ""; VSH.Chart.IsBorder = false; VSH.Chart.IsShadow = false; VSH.Chart.BackgroundColor = Color.White; VSH.Chart.DefaultAxisXMin = new cExtendedList(this.chartForPoints.ChartAreas[0].AxisX.Minimum); VSH.Chart.DefaultAxisXMax = new cExtendedList(this.chartForPoints.ChartAreas[0].AxisX.Maximum); if (KeepBinning) { VSH.ListProperties.FindByName("Bin Number").SetNewValue(CurrentNumberOfBin); } VSH.Run(); splitContainerVertical.Panel2.Controls.Clear(); cExtendedControl TextEC = VSH.GetOutPut(); VSH.Chart.Width = 0;// splitContainerVertical.Panel2.Width - 23; VSH.Chart.Height = 0;// splitContainerVertical.Panel2.Height; TextEC.Width = splitContainerVertical.Panel2.Width - 23; TextEC.Height = splitContainerVertical.Panel2.Height; TextEC.Location = new Point(23, 0); VSH.Chart.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); TextEC.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); //VSH.Chart.Width = splitContainerVertical.Panel2.Width - 23; //VSH.Chart.Height = splitContainerVertical.Panel2.Height; splitContainerVertical.Panel2.Controls.Add(TextEC); return; //cPanelHisto PanelHisto = new cPanelHisto(ListValue, eGraphType.HISTOGRAM, eOrientation.HORIZONTAL); //PanelHisto.WindowForPanelHisto.UserEnable = false; //PanelHisto.WindowForPanelHisto.panelForGraphContainer.Size = new System.Drawing.Size(splitContainerVertical.Panel2.Width - 23, splitContainerVertical.Panel2.Height); //PanelHisto.WindowForPanelHisto.panelForGraphContainer.BackColor = Color.White; //PanelHisto.WindowForPanelHisto.panelForGraphContainer.Location = new Point(23, 0); //PanelHisto.WindowForPanelHisto.panelForGraphContainer.Anchor = AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; //PanelHisto.WindowForPanelHisto.panelForGraphContainer.BorderStyle = BorderStyle.None; //PanelHisto.WindowForPanelHisto.CurrentChartArea.AxisX.Minimum = chartForPoints.ChartAreas[0].AxisX.Minimum; //PanelHisto.WindowForPanelHisto.CurrentChartArea.AxisX.Maximum = chartForPoints.ChartAreas[0].AxisX.Maximum; //splitContainerVertical.Panel2.Controls.Clear(); //splitContainerVertical.Panel2.Controls.Add(PanelHisto.WindowForPanelHisto.panelForGraphContainer); }
void Process() { cExtendedTable NewTable1 = null; string DescName = ""; if (this.InputWells != null) { NewTable1 = new cExtendedTable(this.InputWells, cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); DescName = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName(); } else if (this.InputTable != null) { NewTable1 = this.InputTable; } cDesignerTab NormalityTestTabs = new cDesignerTab(); cNormalityAndersonDarling NAD = new cNormalityAndersonDarling(); NAD.SetInputData(NewTable1); NAD.Run(); cExtendedTable TNAD = NAD.GetOutPut(); TNAD[0].Name = "Anderson-Darling Test"; cViewerTable VTNAD = new cViewerTable(); VTNAD.SetInputData(TNAD); VTNAD.Sender = NAD; VTNAD.IsDisplayInfo = true; VTNAD.DigitNumber = -1; VTNAD.Run(); cExtendedControl AndersonCtrl = VTNAD.GetOutPut(); AndersonCtrl.Title = TNAD[0].Name; cNormalityJarqueBera NJB = new cNormalityJarqueBera(); NJB.SetInputData(NewTable1); NJB.Run(); cExtendedTable TmpTest = NJB.GetOutPut(); TmpTest[0].Name = "Jarque-Bera Test"; cViewerTable VT = new cViewerTable(); VT.SetInputData(TmpTest); VT.Sender = NJB; VT.IsDisplayInfo = true; VT.DigitNumber = -1; VT.Run(); cExtendedControl JarqueCtrl = VT.GetOutPut(); JarqueCtrl.Title = TmpTest[0].Name; NormalityTestTabs.SetInputData(JarqueCtrl); NormalityTestTabs.SetInputData(AndersonCtrl); NormalityTestTabs.Run(); //cExtendedControl ControlForTab = CADP.GetOutPut(); //NormalityTestTabs.Title = TmpPlate.Name; cDesignerSplitter MainDS = new cDesignerSplitter(); MainDS.Orientation = Orientation.Vertical; cDesignerSplitter DS = new cDesignerSplitter(); DS.Orientation = Orientation.Horizontal; cNormalProbabilityPlot NPP = new cNormalProbabilityPlot(); NPP.SetInputData(NewTable1); NPP.IdxColumnToProcess = 0; NPP.Run(); cViewer2DScatterPoint V2DS = new cViewer2DScatterPoint(); cExtendedTable TableToDisp = NPP.GetOutPut(); TableToDisp.Name = ""; V2DS.Chart.IsSelectable = true; V2DS.Chart.IsBorder = false; V2DS.Chart.IsShadow = false; V2DS.Chart.IsXGrid = true; V2DS.Chart.IsYGrid = true; V2DS.Chart.IsDisplayTrendLine = true; V2DS.SetInputData(TableToDisp); V2DS.Run(); V2DS.Chart.CurrentTitle.Text = "Normal Probability Plot\n" + DescName + " - " + NewTable1[0].Count + " points"; DS.SetInputData(V2DS.GetOutPut()); cViewerStackedHistogram VSH = new cViewerStackedHistogram(); cExtendedTable NewTable = null; if (this.InputWells != null) { NewTable = this.InputWells.GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx); } else { NewTable = this.InputTable; } NewTable.Name = DescName + " - Stacked Histogram - " + NewTable1[0].Count + " values"; VSH.SetInputData(NewTable); VSH.Chart.LabelAxisX = DescName; VSH.Run(); DS.SetInputData(VSH.GetOutPut()); DS.Run(); cExtendedControl TextEC = NormalityTestTabs.GetOutPut(); TextEC.Width = 0; TextEC.Height = 0; TextEC.Anchor = (System.Windows.Forms.AnchorStyles)(System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right); MainDS.SetInputData(TextEC); MainDS.SetInputData(DS.GetOutPut()); MainDS.Run(); this.Output = MainDS.GetOutPut(); }