示例#1
0
        void Process()
        {
            // here is the core of the meta component ...
            // just a list of Component steps

            MyImageViewer = new cViewerImage();
            MyImageViewer.SetInputData(this.Input);
            MyImageViewer.ListLinearMaxColor = this.ListLinearMaxColor;

            MyImageViewer.IsDisplayScale = this.IsDisplayScale;
            MyImageViewer.IsUseSavedDefaultDisplayProperties = this.IsUseSavedDefaultDisplayProperties;
            MyImageViewer.DefaultZoom = this.DefaultZoom;
            this.Title = this.Input.Name;

            MyImageViewer.Run();

            cDesignerSinglePanel MyDesigner = new cDesignerSinglePanel();
            MyDesigner.SetInputData(MyImageViewer.GetOutPut());
            MyDesigner.Run();

            cDisplayToWindow MyDisplay = new cDisplayToWindow();
            MyDisplay.SetInputData(MyImageViewer.GetOutPut());
            MyDisplay.Title = this.Title;

            MyImageViewer.IP.Resize-= new EventHandler(MyImageViewer.IP.panelForImage_Resize);
            MyDisplay.Run();
            MyImageViewer.IP.Resize += new EventHandler(MyImageViewer.IP.panelForImage_Resize);
            MyDisplay.Display();
        }
示例#2
0
        void Process()
        {
            // here is the core of the meta component ...
            // just a list of Component steps

            cViewerGraphTree MyTree = new cViewerGraphTree();
            MyTree.SetInputData(this.Input);
            MyTree.Run();

            cDesignerSinglePanel MyDesigner = new cDesignerSinglePanel();
            MyDesigner.SetInputData(MyTree.GetOutPut());
            MyDesigner.Run();

            cDisplayToWindow MyDisplay = new cDisplayToWindow();
            MyDisplay.SetInputData(MyDesigner.GetOutPut());
            MyDisplay.Title = "Tree Viewer";
            MyDisplay.Run();
            MyDisplay.Display();
        }
示例#3
0
        void Process()
        {
            // here is the core of the meta component ...
            // just a list of Component steps

            cViewertext VT = new cViewertext();
            VT.SetInputData(this.Input);
            VT.Run();

            cDesignerSinglePanel MyDesigner = new cDesignerSinglePanel();
            MyDesigner.SetInputData(VT.GetOutPut());
            MyDesigner.Run();

            cDisplayToWindow MyDisplay = new cDisplayToWindow();
            MyDisplay.SetInputData(MyDesigner.GetOutPut());
            MyDisplay.Title = this.Title;
            MyDisplay.Run();
            MyDisplay.Display();
        }
        void Process()
        {
            cDesignerTab DT = new cDesignerTab();

            for (int i = 0; i < this.Input.Count; i++)
            {
                cViewerTable MyTable = new cViewerTable();
                MyTable.SetInputData(this.Input[i]);
                MyTable.Run();

                DT.SetInputData(MyTable.GetOutPut());
            }
            DT.Run();

            cDisplayToWindow MyDisplay = new cDisplayToWindow();
            MyDisplay.SetInputData(DT.GetOutPut());
            MyDisplay.Title = this.Input.Name;
            MyDisplay.Run();
            MyDisplay.Display();
        }
示例#5
0
        void Process()
        {
            // here is the core of the meta component ...
            // just a list of Component steps

            cViewerTable MyTable = new cViewerTable();
            MyTable.SetInputData(this.Input);
            MyTable.DigitNumber = DigitNumber;
            MyTable.Run();

            cDesignerSinglePanel MyDesigner = new cDesignerSinglePanel();
            MyDesigner.SetInputData(MyTable.GetOutPut());
            MyDesigner.Run();

            cDisplayToWindow MyDisplay = new cDisplayToWindow();
            MyDisplay.SetInputData(MyDesigner.GetOutPut());
            MyDisplay.Title = this.Input.Name;
            MyDisplay.Run();
            MyDisplay.Display();
        }
        void Process()
        {
            // here is the core of the meta component ...
            // just a list of Component steps

            cCorrelationMatrix MyCorrelation = new cCorrelationMatrix();
            MyCorrelation.SetCorrelationType(this.CorrelationType);
            MyCorrelation.SetInputData(Input);
            MyCorrelation.Run();

            cViewerTable MyTable = new cViewerTable();
            MyTable.SetInputData(MyCorrelation.GetOutPut());
            MyTable.Run();

            cDesignerSinglePanel MyDesigner = new cDesignerSinglePanel();
            MyDesigner.SetInputData(MyTable.GetOutPut());
            MyDesigner.Run();

            cDisplayToWindow MyDisplay = new cDisplayToWindow();
            MyDisplay.SetInputData(MyDesigner.GetOutPut());
            MyDisplay.Title = this.Title;
            MyDisplay.Run();
            MyDisplay.Display();
        }
示例#7
0
        private void histogramsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cGUI_ListClasses GUIClasses = new cGUI_ListClasses();
            GUIClasses.IsCheckBoxes = false;
            GUIClasses.ClassType = eClassType.PHENOTYPE;
            if (!GUIClasses.Run().IsSucceed) return;

            cGUI_ListClasses GUIClassesWells = new cGUI_ListClasses();
            GUIClassesWells.IsCheckBoxes = true;
            GUIClassesWells.ClassType = eClassType.WELL;
            if (!GUIClassesWells.Run().IsSucceed) return;

            List<cWellClassType> ListClass = new List<cWellClassType>();
            for (int i = 0; i < GUIClassesWells.GetOutPut()[0].Count; i++)
            {
                if (GUIClassesWells.GetOutPut()[0][i] == 1)
                    ListClass.Add(cGlobalInfo.ListWellClasses[i]);
            }


            cGUI_ListPlates GUIListPlates = new cGUI_ListPlates();
            GUIListPlates.IsCheckBoxes = true;
            if (!GUIListPlates.Run().IsSucceed) return;

            List<cDescriptorType> LCDT = new List<cDescriptorType>();
            LCDT.Add(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor());


            cDesignerTab DT = new cDesignerTab();
            DT.IsMultiline = false;

            foreach (var TmpPlate in GUIListPlates.GetOutPut())
            {
                cListWells CurrentPlateListWells = TmpPlate.ListWells.Filter(ListClass);

                cExtendedTable FinalTable = new cExtendedTable();
                FinalTable.Name = TmpPlate.GetName() + " - " + CurrentPlateListWells.Count + " wells";

                for (int i = 0; i < GUIClasses.GetOutPut()[0].Count; i++)
                {
                    if (GUIClasses.GetOutPut()[0][i] == 1)
                    {
                        FinalTable.Add(new cExtendedList());
                        FinalTable[0].Name = cGlobalInfo.ListCellularPhenotypes[i].Name;
                        FinalTable[0].Tag = cGlobalInfo.ListCellularPhenotypes[i];
                    }
                }

                foreach (cWell TmpWell in CurrentPlateListWells)
                {
                    TmpWell.AssociatedPlate.DBConnection = new cDBConnection(TmpWell.AssociatedPlate, TmpWell.SQLTableName);

                    for (int i = 0; i < GUIClasses.GetOutPut()[0].Count; i++)
                    {
                        if (GUIClasses.GetOutPut()[0][i] == 1)
                        {
                            List<cCellularPhenotype> ListCellularPhenotypesToBeSelected = new List<cCellularPhenotype>();
                            ListCellularPhenotypesToBeSelected.Add(cGlobalInfo.ListCellularPhenotypes[i]);

                            cExtendedTable TmpET = TmpWell.AssociatedPlate.DBConnection.GetWellValues(TmpWell,
                                                     LCDT, ListCellularPhenotypesToBeSelected);

                            if (TmpET.Count > 0) FinalTable[0].AddRange(TmpET[0]);
                            break;
                        }
                    }
                    TmpWell.AssociatedPlate.DBConnection.CloseConnection();
                }

                cViewerHistogram VH = new cViewerHistogram();
                //cViewerStackedHistogram VSH = new cViewerStackedHistogram();
                VH.SetInputData(FinalTable);
                //VH.Chart.BinNumber = -1;
                //VSH.Chart.Is

                //VH.ListProperties.FindByName("Bin Number").SetNewValue((int)100);
                //VH.ListProperties.FindByName("Bin Number").IsGUIforValue = true;

                //  VSH.Chart.BinNumber = LCDT[0].GetBinNumber();
                VH.Chart.IsShadow = false;
                VH.Chart.IsBorder = true;
                VH.Chart.IsXGrid = true;
                VH.Chart.IsHistoNormalized = true;
                VH.Chart.IsBar = true;

                VH.Chart.IsYGrid = true;
                VH.Chart.LabelAxisX = LCDT[0].GetName();
                VH.Title = TmpPlate.GetName();
                VH.Run();
                VH.Chart.Width = 0;
                VH.Chart.Height = 0;


                cDesignerSplitter DS = new cDesignerSplitter();
                DS.Orientation = Orientation.Vertical;
                DS.SetInputData(VH.GetOutPut());

                cHistogramBuilder HB = new cHistogramBuilder();
                HB.SetInputData(FinalTable);
                HB.BinNumber = -1;
                HB.IsNormalized = true;
                HB.Run();

                cViewerTable VT = new cViewerTable();
                VT.SetInputData(HB.GetOutPut());
                VT.Run();

                DS.SetInputData(VT.GetOutPut());
                DS.Title = TmpPlate.GetName();
                DS.Run();
                //DS.SetInputData(HB.Get


                DT.SetInputData(DS.GetOutPut());

            }

            DT.Run();
            cDisplayToWindow DTW = new cDisplayToWindow();
            DTW.SetInputData(DT.GetOutPut());
            DTW.Title = "Single cell based Histograms";
            DTW.Run();
            DTW.Display();


        }
示例#8
0
        private void mannWithneyTestToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cGUI_2ClassesSelection GUI_ListClasses = new cGUI_2ClassesSelection();

            if (GUI_ListClasses.Run(this.GlobalInfo).IsSucceed == false) return;
            cExtendedTable ListClassSelected = GUI_ListClasses.GetOutPut();

            int IdxClassNeg = -1;
            int IdxClassPos = -1;
            for (int IdxC = 0; IdxC < ListClassSelected[0].Count; IdxC++)
            {
                if (ListClassSelected[0][IdxC] == 1) IdxClassNeg = IdxC;
                if (ListClassSelected[1][IdxC] == 1) IdxClassPos = IdxC;
            }

            string SubTitle = "Mann-Withney (both tails)";


            #region single plate and plate by plate

            cDesignerTab DT = new cDesignerTab();
            if ((ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) || (ProcessModeplateByPlateToolStripMenuItem.Checked)/*||(ProcessModeEntireScreeningToolStripMenuItem.Checked)*/)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                if ((ProcessModeplateByPlateToolStripMenuItem.Checked)/*||(ProcessModeEntireScreeningToolStripMenuItem.Checked)*/)
                {
                    foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                        ListPlatesToProcess.Add(TmpPlate);
                }
                else
                    ListPlatesToProcess.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate());

                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {
                    cListWells ListWellsToProcess1 = new cListWells(null);
                    cListWells ListWellsToProcess2 = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[0][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess1.Add(item);
                            if (ListClassSelected[1][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess2.Add(item);
                        }
                    }

                    cExtendedTable NewTable1 = new cExtendedTable(ListWellsToProcess1, true);
                    cExtendedTable NewTable2 = new cExtendedTable(ListWellsToProcess2, true);

                    if ((NewTable1.Count == 0) || (NewTable1[0].Count < 5) || (NewTable2.Count == 0) || (NewTable2[0].Count < 5))
                    {
                        if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                        {
                            MessageBox.Show("Insufficient number of control wells", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        else
                            continue;
                    }

                    cExtendedList ListZ = new cExtendedList();
                    List<cDescriptorType> ListDescForZFactor = new List<cDescriptorType>();
                    List<string> ListNames = new List<string>();
                    int RealIdx = 0;
                    for (int IDxDesc = 0; IDxDesc < cGlobalInfo.CurrentScreening.ListDescriptors.Count; IDxDesc++)
                    {
                        if (!cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc].IsActive()) continue;

                        cExtendedTable TableForZ = new cExtendedTable();

                        TableForZ.Add(NewTable1[RealIdx]);
                        TableForZ.Add(NewTable2[RealIdx]);
                        RealIdx++;

                        cMannWithneyTest ZF = new cMannWithneyTest();
                        ZF.SetInputData(TableForZ);
                        ZF.Run();
                        ListZ.Add(ZF.GetOutPut()[0][1]);

                        ListDescForZFactor.Add(cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc]);

                    }

                    cExtendedTable ET = new cExtendedTable(new cExtendedTable(ListZ));
                    ET[0].ListTags = new List<object>();
                    ET[0].ListTags.AddRange(ListDescForZFactor);
                    ET.Name = TmpPlate.GetName() + "\n" + SubTitle + " - " + cGlobalInfo.ListWellClasses[IdxClassNeg].Name + " (" + NewTable1[0].Count + " wells) vs. " + cGlobalInfo.ListWellClasses[IdxClassPos].Name + " (" + NewTable2[0].Count + " wells)";
                    ET[0].Name = ET.Name;

                    cSort S = new cSort();
                    S.SetInputData(ET);
                    S.ColumnIndexForSorting = 0;
                    S.Run();

                    //ZFactorList.Sort(delegate(cSimpleSignature p1, cSimpleSignature p2) { return p1.AverageValue.CompareTo(p2.AverageValue); });

                    cViewerGraph1D VG1 = new cViewerGraph1D();
                    VG1.SetInputData(S.GetOutPut());

                    VG1.Chart.LabelAxisY = SubTitle;
                    VG1.Chart.LabelAxisX = "Descriptor";
                    VG1.Chart.IsZoomableX = true;
                    VG1.Chart.IsBar = true;
                    VG1.Chart.IsBorder = true;
                    VG1.Chart.IsDisplayValues = true;
                    VG1.Chart.IsShadow = true;
                    VG1.Chart.MarkerSize = 4;

                    //VG1.Chart.Max
                    VG1.Title = TmpPlate.GetName();

                    Classes.Base_Classes.General.cLineHorizontalForGraph VLZ05 = new Classes.Base_Classes.General.cLineHorizontalForGraph(.05);
                    VLZ05.IsAllowMoving = true;
                    VG1.Chart.ListHorizontalLines.Add(VLZ05);

                    VG1.Run();

                    cDesignerSplitter DS = new cDesignerSplitter();
                    DS.Orientation = Orientation.Vertical;
                    DS.SetInputData(VG1.GetOutPut());

                    cSort S1 = new cSort();
                    S1.SetInputData(ET);
                    S1.ColumnIndexForSorting = 0;
                    S1.IsAscending = false;
                    S1.Run();

                    cViewerTable VT = new cViewerTable();
                    VT.SetInputData(S1.GetOutPut());
                    VT.DigitNumber = -1;
                    VT.Run();

                    DS.SetInputData(VT.GetOutPut());
                    DS.Title = TmpPlate.GetName();
                    DS.Run();

                    DT.SetInputData(DS.GetOutPut());
                }
                DT.Run();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(DT.GetOutPut());//VG1.GetOutPut());


                if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                    CDW.Title = SubTitle + " - " + ListPlatesToProcess[0].GetName();
                else
                    CDW.Title = SubTitle + " - " + ListPlatesToProcess.Count + " plates";

                CDW.Run();
                CDW.Display();
            }
            #endregion

            #region entire screening
            else if (ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                    ListPlatesToProcess.Add(TmpPlate);

                cExtendedList ListZ = new cExtendedList();
                List<cPlate> ListPlatesForZFactor = new List<cPlate>();
                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {
                    cListWells ListWellsToProcess1 = new cListWells(null);
                    cListWells ListWellsToProcess2 = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[0][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess1.Add(item);
                            if (ListClassSelected[1][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess2.Add(item);
                        }
                    }

                    cExtendedTable NewTable1 = new cExtendedTable(ListWellsToProcess1, cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorIndex(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()));
                    cExtendedTable NewTable2 = new cExtendedTable(ListWellsToProcess2, cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorIndex(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()));
                    //cExtendedTable NewTable2 = new cExtendedTable(ListWellsToProcess2, false);

                    if ((NewTable1.Count == 0) || (NewTable1[0].Count < 5) || (NewTable2.Count == 0) || (NewTable2[0].Count < 5))
                    {
                        if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                        {
                            MessageBox.Show("Insufficient number of control wells", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        else
                            continue;
                    }

                    cExtendedTable TableForZ = new cExtendedTable();

                    TableForZ.Add(NewTable1[0]);
                    TableForZ.Add(NewTable2[0]);

                    cMannWithneyTest ZF = new cMannWithneyTest();
                    ZF.SetInputData(TableForZ);
                    ZF.Run();
                    double Zfactor = ZF.GetOutPut()[0][1];
                    ListZ.Add(Zfactor);

                    // update plate quality
                    //TmpPlate.ListProperties.UpdateValueByName("Quality", Math.Exp(Zfactor - 1));
                    //cProperty Prop = TmpPlate.ListProperties.FindByName("Quality");
                    //Prop.Info = ZF.GetInfo();

                    ListPlatesForZFactor.Add(TmpPlate);
                }


                cExtendedTable ET = new cExtendedTable(new cExtendedTable(ListZ));
                ET[0].ListTags = new List<object>();
                ET[0].ListTags.AddRange(ListPlatesForZFactor);
                ET.Name = SubTitle + " - " + cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName() + " - " + cGlobalInfo.ListWellClasses[IdxClassNeg].Name + /*" (" + NewTable1[0].Count + " wells)*/ " vs. " + cGlobalInfo.ListWellClasses[IdxClassPos].Name;// +" (" + NewTable2[0].Count + " wells)";
                ET[0].Name = ET.Name;

                cViewerGraph1D VG1 = new cViewerGraph1D();
                VG1.SetInputData(ET);

                VG1.Chart.LabelAxisY = SubTitle;
                VG1.Chart.LabelAxisX = "Plate";
                VG1.Chart.IsZoomableX = true;
                VG1.Chart.IsBar = true;
                VG1.Chart.IsBorder = true;
                VG1.Chart.IsDisplayValues = true;
                VG1.Chart.IsShadow = true;
                VG1.Chart.MarkerSize = 4;


                Classes.Base_Classes.General.cLineHorizontalForGraph VLZ05 = new Classes.Base_Classes.General.cLineHorizontalForGraph(.05);
                VLZ05.IsAllowMoving = true;
                VG1.Chart.ListHorizontalLines.Add(VLZ05);

                VG1.Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();
                VG1.Run();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(VG1.GetOutPut());
                CDW.Title = SubTitle + " - " + ListPlatesToProcess.Count + " plates";
                CDW.Run();
                CDW.Display();
            #endregion
            }
        }
示例#9
0
        private void aToolStripMenuItem_Click_1(object sender, EventArgs e)
        {


            //if (CompleteScreening.ListDescriptors.GetListNameActives().Count <= 1)
            //{
            //    MessageBox.Show("MINE Analysis requires at least two activated descriptors\n", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //    return;
            //}

            //bool IsFullScreen = false;
            //List<double>[] ListValueDesc = ExtractDesciptorAverageValuesList(IsFullScreen);

            //DisplayMINE(ListValueDesc);

            cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses();
            if (GUI_ListClasses.Run().IsSucceed == false) return;
            cExtendedList ListClassSelected = GUI_ListClasses.GetOutPut()[0];

            if (ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                cDesignerTab DT = new cDesignerTab();

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    cListWells ListWellsToProcess = new cListWells(null);
                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess.Add(item);
                        }
                    }

                    cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                    cMineAnalysis MA = new cMineAnalysis();
                    MA.SetInputData(NewTable);
                    MA.Is_BriefReport = true;
                    MA.CurrentScreening = cGlobalInfo.CurrentScreening;
                    MA.Run();

                    cDesignerTab SubDT = new cDesignerTab();
                    foreach (var item in MA.GetOutPut())
                    {
                        cViewerTable SubTable = new cViewerTable();

                        SubTable.Title = "MINE - " + item.Name;
                        SubTable.SetInputData(item);
                        SubTable.Run();

                        SubDT.SetInputData(SubTable.GetOutPut());
                    }
                    SubDT.Title = TmpPlate.GetName();
                    SubDT.Run();
                    DT.SetInputData(SubDT.GetOutPut());
                }

                DT.Run();
                cDisplayToWindow TmpvD = new cDisplayToWindow();

                TmpvD.SetInputData(DT.GetOutPut());
                TmpvD.Title = "MINE analysis - " + cGlobalInfo.CurrentScreening.ListPlatesActive.Count + " plates";
                TmpvD.Run();
                TmpvD.Display();
            }
            else if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
            {
                cPlate TmpPlate = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate();

                cListWells ListWellsToProcess = new cListWells(null);
                foreach (cWell item in TmpPlate.ListActiveWells)
                {
                    if (item.GetCurrentClassIdx() != -1)
                    {
                        if (ListClassSelected[item.GetCurrentClassIdx()] == 1)
                            ListWellsToProcess.Add(item);
                    }
                }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                cMineAnalysis MA = new cMineAnalysis();
                MA.SetInputData(NewTable);
                MA.Is_BriefReport = true;
                MA.CurrentScreening = cGlobalInfo.CurrentScreening;
                MA.Run();

                cDesignerTab SubDT = new cDesignerTab();
                foreach (var item in MA.GetOutPut())
                {
                    cViewerTable SubTable = new cViewerTable();

                    SubTable.Title = "MINE - " + item.Name;
                    SubTable.SetInputData(item);
                    SubTable.Run();

                    SubDT.SetInputData(SubTable.GetOutPut());
                }
                SubDT.Title = TmpPlate.GetName();
                SubDT.Run();

                cDisplayToWindow TmpvD = new cDisplayToWindow();

                TmpvD.SetInputData(SubDT.GetOutPut());
                TmpvD.Title = "MINE analysis - " + TmpPlate.GetName() + " : " + ListWellsToProcess.Count + " wells";
                TmpvD.Run();
                TmpvD.Display();
            }
            else if (ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1)
                            if (ListClassSelected[item.GetCurrentClassIdx()] == 1) ListWellsToProcess.Add(item);

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                cMineAnalysis MA = new cMineAnalysis();
                MA.SetInputData(NewTable);
                MA.Is_BriefReport = true;
                MA.CurrentScreening = cGlobalInfo.CurrentScreening;
                MA.Run();

                cDesignerTab SubDT = new cDesignerTab();
                foreach (var item in MA.GetOutPut())
                {
                    cViewerTable SubTable = new cViewerTable();

                    SubTable.Title = "MINE - " + item.Name;
                    SubTable.SetInputData(item);
                    SubTable.Run();

                    SubDT.SetInputData(SubTable.GetOutPut());
                }
                SubDT.Run();

                cDisplayToWindow TmpvD = new cDisplayToWindow();

                TmpvD.SetInputData(SubDT.GetOutPut());
                TmpvD.Title = "MINE analysis : " + ListWellsToProcess.Count + " wells";
                TmpvD.Run();
                TmpvD.Display();
            }

        }
示例#10
0
        private void AnalyseSequence(cImage SeqToAnalyse)
        {
            //    //FormForThumbnails WindThumbnail = new FormForThumbnails();

            //    //for (int k = 0; k < ListFormForControl.Count; k++)
            //    //{
            //    //        FormForControl Obj = ListFormForControl.ElementAt(ListFormForControl.Count - k-1);
            //    //        Obj.DisplayThumbnail(WindThumbnail);
            //    //}
            //    //WindThumbnail.Show();

            //    //return;

            #region initialization

            if (SeqToAnalyse == null) return;

            // create World
            if (Current3DWorld == null)
            {
                Current3DWorld = new c3DNewWorld(new cPoint3D(SeqToAnalyse.Width, SeqToAnalyse.Height, SeqToAnalyse.Depth),
                                                 new cPoint3D(SeqToAnalyse.Resolution));
            }
              else
            {
            //     //   Current3DWorld.ren1.
              //  Current3DWorld.Terminate();
                Current3DWorld = null;
                 Current3DWorld = new c3DNewWorld(new cPoint3D(SeqToAnalyse.Width, SeqToAnalyse.Height, SeqToAnalyse.Depth),
                                                         new cPoint3D(SeqToAnalyse.Resolution));

            }

            for (int k = 0; k < ListFormForControl.Count; k++)
            {
                FormForControl Obj = ListFormForControl.ElementAt(ListFormForControl.Count - k-1);
                if (Obj.numericUpDownChannel.Value >= SeqToAnalyse.GetNumChannels())
                {
                    MessageBox.Show("Wrong number of channels", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }

            //   // Current3DWorld.ListObjControl = ListFormForControl;
            //    //   dataGridViewForClassif.DataSource = CurrentTable;
            //    if (DataGrid == null)
            //    {
            //        DataGrid = new FormForDataGridView();
            //        DataGrid.Show();
            //    }
            //    Current3DWorld.SetLinkToDataGridView(DataGrid.dataGridViewForResults);

            Current3DWorld.ListMetaObjectList = new List<cMetaBiologicalObjectList>();
            cMetaBiologicalObjectList ListMetacells = new cMetaBiologicalObjectList("List Meta Objects");
            Current3DWorld.ListMetaObjectList.Add(ListMetacells);
            #endregion

            #region Detection
            for (int k = 0; k < ListFormForControl.Count; k++)
            {
                FormForControl Obj = ListFormForControl.ElementAt(ListFormForControl.Count - k -1);

                if (Obj.radioButtonIsVolume.Checked)    // we have to detect a volume !
                {
                    cVolumeDetection Detection = new cVolumeDetection(SeqToAnalyse, (int)Obj.numericUpDownChannel.Value, Obj.WindowForVolumeDetection.checkBoxIsBorderKill.Checked);
                    Detection.SetShift(new cPoint3D((float)Obj.WindowForPreProcessing.numericUpDownShiftX.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftY.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftZ.Value));

                    if ((Obj.checkBoxPreProcessings.Checked == false) || (Obj.WindowForPreProcessing.checkBoxMedianIsDisabled.Checked))
                    {
                        Detection.SetMedian(-1);
                        Detection.SetShift(new cPoint3D(0, 0, 0));
                    }
                    else
                    {
                        Detection.SetMedian((int)Obj.WindowForPreProcessing.numericUpDownMedianKernel.Value);
                        Detection.SetShift(new cPoint3D((float)Obj.WindowForPreProcessing.numericUpDownShiftX.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftY.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftZ.Value));
                    }

                    if (Obj.WindowForVolumeDetection.checkBoxVolumeSmooth.Checked)
                        Detection.MeshSmoother = new cMeshSmoother((int)Obj.WindowForVolumeDetection.numericUpDownSmoothIterations.Value);

                    if ((Obj.comboBoxContainer.SelectedItem !=null) && (Obj.comboBoxContainer.SelectedItem.ToString() != ""))
                    {
                        Detection.SetContainers(Current3DWorld.GetListBiologicalObjectsOfType(Obj.comboBoxContainer.Items[0].ToString()));
                        if (Obj.InOrOut.radioButtonIn.Checked) Detection.SetContainersMode(0);
                        else Detection.SetContainersMode(1);
                    }
                    else
                        Detection.SetContainers(null);

                    if (Obj.WindowForVolumeDetection.checkBoxIsRegionGrowing.Checked == false)  // no region growing direct detection
                    {
                        Obj.AssociatedBiologicalObjectList = Detection.IntensityThreshold((float)Obj.WindowForVolumeDetection.numericUpDownIntensityThreshold.Value,
                                                                                          (float)Obj.WindowForVolumeDetection.numericUpDownVolumeMinVol.Value,
                                                                                          (float)Obj.WindowForVolumeDetection.numericUpDownVolumeMaxVol.Value);
                    }
                   else // region growing
                   {
                        if (Obj.WindowForVolumeDetection.radioButtonRegionsBased.Checked) // start from a segmentation
                        {
                            if (Obj.WindowForVolumeDetection.radioButtonVolumeDetectionNew.Checked) // a new segmentation has to be performed
                            {
            //                        // Image3D CurrentPatch = new Image3D(2 * Radius, 2 * Radius, 1, CurrentImageToProcess.NumBands);
                                cImage CurrentBinary = new cImage(SeqToAnalyse.Width, SeqToAnalyse.Height, SeqToAnalyse.Depth, 1);

                                for (int i = 0; i < CurrentBinary.ImageSize; i++)
                                {
                                    if (SeqToAnalyse.SingleChannelImage[(int)Obj.numericUpDownChannel.Value].Data[i] >= (float)Obj.WindowForVolumeDetection.numericUpDownIntensityThreshold.Value)
                                        CurrentBinary.SingleChannelImage[0].Data[i] = 1;
                                }

                                eConnectivity CurrentConnectivity = eConnectivity.TWOD_4;
                                if (CurrentBinary.Depth > 1)
                                    CurrentConnectivity = eConnectivity.THREED_6;

                                ConnectedComponentSet OFNucleus = new ConnectedComponentSet(CurrentBinary, null, null, 0, CurrentConnectivity, (int)Obj.WindowForVolumeDetection.numericUpDownRegionBasedMinArea.Value, (int)Obj.WindowForVolumeDetection.numericUpDownRegionBasedMaxArea.Value);
            //                      //  RegionGrowing = new cRegionGrowing(OFNucleus, NewSeq[0], (int)numericUpDownChannelForRegionGrowing.Value, (float)numericUpDownIntensityForRegionGrowing.Value, (int)numericUpDownMaxNucleusArea.Value);
                                int NumIterations = -1;
                                if (Obj.WindowForVolumeDetection.checkBoxIsConvergence.Checked == false) NumIterations = (int)Obj.WindowForVolumeDetection.numericUpDownIterationNumber.Value;

                                float MergingRatio = (float)((Obj.WindowForVolumeDetection.trackBarMergingStrength.Maximum - Obj.WindowForVolumeDetection.trackBarMergingStrength.Value) / 100.0);
                                Obj.AssociatedBiologicalObjectList = Detection.RegionGrowing(OFNucleus,
                                                                                            (float)Obj.WindowForVolumeDetection.numericUpDownIntensityForRegionGrowing.Value,
                                                                                            (float)Obj.WindowForVolumeDetection.numericUpDownVolumeMinVol.Value,
                                                                                            (float)Obj.WindowForVolumeDetection.numericUpDownVolumeMaxVol.Value, NumIterations, MergingRatio);

                            }
            //                    else
            //                    {
            //                        throw new System.ArgumentException("Not implemented", "Error");
            //                    }
            //                }
            //                else // start from seeds points
            //                {

            //                        // first gather the seeds
            //                        if (Obj.WindowForVolumeDetection.comboBoxExistingSpotsDetected.Items.Count == 0) break;
            //                       List<cBiological3DObject> ListSeeds = Current3DWorld.GetListBiologicalObjectsOfType(Obj.WindowForVolumeDetection.comboBoxExistingSpotsDetected.Items[0].ToString());

            //                       int NumIterations = -1;
            //                       if (Obj.WindowForVolumeDetection.checkBoxIsConvergence.Checked == false) NumIterations = (int)Obj.WindowForVolumeDetection.numericUpDownIterationNumber.Value;

            //                       float MergingRatio = (float)((Obj.WindowForVolumeDetection.trackBarMergingStrength.Maximum - Obj.WindowForVolumeDetection.trackBarMergingStrength.Value) / 100.0);
            //                       Obj.AssociatedBiologicalObjectList = Detection.RegionGrowing(ListSeeds,
            //                                                                                   (float)Obj.WindowForVolumeDetection.numericUpDownIntensityForRegionGrowing.Value,
            //                                                                                   (float)Obj.WindowForVolumeDetection.numericUpDownVolumeMinVol.Value,
            //                                                                                   (float)Obj.WindowForVolumeDetection.numericUpDownVolumeMaxVol.Value, NumIterations, MergingRatio);
                        }
                    }
                    if (Obj.AssociatedBiologicalObjectList != null)
                    {
                        Obj.richTextBoxInfo.AppendText(Obj.AssociatedBiologicalObjectList.Count + " objects detected.");

                        for (int i = 0; i < Obj.AssociatedBiologicalObjectList.Count; i++)
                        {
                            cBiological3DVolume TmpVol = (cBiological3DVolume)Obj.AssociatedBiologicalObjectList[i];
                            Obj.AssociatedBiologicalObjectList[i].SetType(Obj.textBoxName.Text);
            //                    TmpVol.ThumbnailnewImage = imageListForThumbnail.Images[Obj.AssociatedBiologicalObjectList[i].GetType() + ".jpg"];
                            Obj.AssociatedBiologicalObjectList[i].Name = Obj.textBoxName.Text + " " + i;
              //                  Obj.AssociatedBiologicalObjectList[i].IsMaster = Obj.IsMasterObject();
            //                    List<double> Res = TmpVol.Information.GetInformation();

                            if (Obj.checkBoxIsDisplayName.Checked)
                            {
                                cGeometric3DObject AssociatedText = TmpVol.AttachText(TmpVol.Name, 10, Color.White);
                                AssociatedText.IsStayInFrontOfCamera = true;
                                Current3DWorld.AddGeometric3DObject(AssociatedText);

                                //                        TmpVol.AddText(TmpVol.Name, Current3DWorld, (double)Obj.ForText.numericUpDownArrowScale.Value, Obj.ForText.buttonChangeColorPositive.BackColor);
                            }

                            if (Obj.checkIsBoxPointingArrow.Checked)
                            {
                                cGeometric3DObject AssociatedArrow = TmpVol.AttachPointingArrow((double)Obj.ForArrow.numericUpDownArrowScale.Value,
                                                            Obj.ForArrow.buttonChangeColorPositive.BackColor);

                                Current3DWorld.AddGeometric3DObject(AssociatedArrow);

                            }

                            Obj.AssociatedBiologicalObjectList[i].SetOpacity((double)Obj.ColorOpacity.numericUpDownValue.Value);

                            // if the object it the Master then create a meta-object and put it inside
                            if (Obj.IsMasterObject())
                            {
                                cMetaBiologicalObject Cell = new cMetaBiologicalObject(Obj.WindowForMaster.textBoxName.Text + i, Current3DWorld.ListMetaObjectList[0], Obj.AssociatedBiologicalObjectList[i]);
            //                        // Cell.AddObject(Obj.AssociatedBiologicalObjectList[i]);
                                Current3DWorld.ListMetaObjectList[0].Add(Cell);
                            }
                        }

                        if (Obj.radioButtonColorSingle.Checked)
                            Current3DWorld.AddBiological3DObjects(Obj.AssociatedBiologicalObjectList, Obj.buttonChangeColorPositive.BackColor, eColorMode.Regular);
                        else if (Obj.radioButtonColorRandom.Checked)
                            Current3DWorld.AddBiological3DObjects(Obj.AssociatedBiologicalObjectList, Obj.buttonChangeColorPositive.BackColor, eColorMode.Random);
                        else if (Obj.radioButtonColorIndexed.Checked)
                            Current3DWorld.AddBiological3DObjects(Obj.AssociatedBiologicalObjectList, Obj.buttonChangeColorPositive.BackColor, eColorMode.Indexed);
                    }

                }
                else if (Obj.RadioButtonIsSpot.Checked)
                {
                    cSpotDetection Detection = new cSpotDetection(SeqToAnalyse, (int)Obj.numericUpDownChannel.Value);

                    if ((Obj.checkBoxPreProcessings.Checked == false) || (Obj.WindowForPreProcessing.checkBoxMedianIsDisabled.Checked))
                    {
                        Detection.SetMedian(-1);
                        Detection.SetShift(new cPoint3D(0, 0, 0));
                    }
                    else
                    {
                        Detection.SetMedian((int)Obj.WindowForPreProcessing.numericUpDownMedianKernel.Value);
                        Detection.SetShift(new cPoint3D((float)Obj.WindowForPreProcessing.numericUpDownShiftX.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftY.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftZ.Value));
                    }

                    if ((Obj.comboBoxContainer.Items.Count > 0) && (Obj.comboBoxContainer.SelectedItem != null))
                    {
                        Detection.SetContainers(Current3DWorld.GetListBiologicalObjectsOfType(Obj.comboBoxContainer.SelectedItem.ToString()));
                        if (Obj.InOrOut.radioButtonIn.Checked) Detection.SetContainersMode(0);
                        else Detection.SetContainersMode(1);
                    }

                    Obj.AssociatedBiologicalObjectList = Detection.HessianDetection((float)Obj.WindowForSpotDetection.numericUpDownSpotRadius.Value,
                                                                                    (float)Obj.WindowForSpotDetection.numericUpDownIntensityThreshold.Value,
                                                                                    (int)Obj.WindowForSpotDetection.numericUpDownSpotLocality.Value,
                                                                                    (double)Obj.WindowForSpotDetection.numericUpDownSphereDisplayRadius.Value);

                    Obj.richTextBoxInfo.AppendText(Obj.AssociatedBiologicalObjectList.Count + " objects detected.");
                    for (int i = 0; i < Obj.AssociatedBiologicalObjectList.Count; i++)
                    {
                        cBiologicalSpot TmpSpot = (cBiologicalSpot)Obj.AssociatedBiologicalObjectList[i];
                        TmpSpot.Name = Obj.textBoxName.Text + " " + i;
                        TmpSpot.SetType(Obj.textBoxName.Text);
            //                TmpSpot.ThumbnailnewImage = imageListForThumbnail.Images[Obj.AssociatedBiologicalObjectList[i].GetType() + ".jpg"];

            //                if (Obj.checkBoxIsDisplayName.Checked)
            //                    TmpSpot.AddText(TmpSpot.Name, Current3DWorld, (double)Obj.ForText.numericUpDownArrowScale.Value, Obj.ForText.buttonChangeColorPositive.BackColor);

                            if (Obj.checkIsBoxPointingArrow.Checked)
                            {
                                cGeometric3DObject AssociatedArrow = TmpSpot.AttachPointingArrow((double)Obj.ForArrow.numericUpDownArrowScale.Value, Obj.ForArrow.buttonChangeColorPositive.BackColor);
                                Current3DWorld.AddGeometric3DObject(AssociatedArrow);
                            }

            //                TmpSpot.SetOpacity((double)Obj.ColorOpacity.numericUpDownValue.Value);

            //                // if the object it the Master then create a meta-object and put it inside
                        if (Obj.IsMasterObject())
                        {
                            cMetaBiologicalObject Cell = new cMetaBiologicalObject("Cell " + i, Current3DWorld.ListMetaObjectList[0], Obj.AssociatedBiologicalObjectList[i]);
            //                 //   Cell.AddObject(Obj.AssociatedBiologicalObjectList[i]);
                            Current3DWorld.ListMetaObjectList[0].Add(Cell);
                        }

            //                /*cMetaBiologicalObject Cell = */
            //                //Current3DWorld.ListMetaObjectList[0].AssociateWith(Current3DWorld.ListMetaObjectList[0].FindTheClosestVolumeFrom(TmpSpot.GetCentroid(), 20), TmpSpot);
                    }

            //            if (Obj.radioButtonColorSingle.Checked)
            //                Current3DWorld.AddBiological3DObjects(Obj.AssociatedBiologicalObjectList, Obj.buttonChangeColorPositive.BackColor, eColorMode.Regular);
            //            else if (Obj.radioButtonColorRandom.Checked)
            //                Current3DWorld.AddBiological3DObjects(Obj.AssociatedBiologicalObjectList, Obj.buttonChangeColorPositive.BackColor, eColorMode.Random);
            //            else if (Obj.radioButtonColorIndexed.Checked)
            //                Current3DWorld.AddBiological3DObjects(Obj.AssociatedBiologicalObjectList, Obj.buttonChangeColorPositive.BackColor, eColorMode.Indexed);

                }
                else if (Obj.radioButtonIsVolumeRendering.Checked)
                {
                    Current3DWorld.AddVolume3D(new cVolumeRendering3D(this.AssociatedImage.SingleChannelImage[(int)Obj.numericUpDownChannel.Value],
                                               new cPoint3D((float)Obj.WindowForPreProcessing.numericUpDownShiftX.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftY.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftZ.Value),
                                               null, Current3DWorld));

                  //  cVolume3D Volume = new cVolume3D(SeqToAnalyse, (int)Obj.numericUpDownChannel.Value, new cPoint3D((float)Obj.WindowForPreProcessing.numericUpDownShiftX.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftY.Value, (float)Obj.WindowForPreProcessing.numericUpDownShiftZ.Value));
                  //  Current3DWorld.AddVolume3D(Volume, Color.Black, Obj.buttonChangeColorPositive.BackColor);
                }

            //        Thread oThread = new Thread(new ThreadStart(Obj.DisplayDone));

            }
            #endregion

            #region Objects Association
            cMetaBiologicalObjectList MetaCellList = Current3DWorld.ListMetaObjectList[0];

            // let's associate the objects
            for (int k = 0; k < ListFormForControl.Count; k++)
            {
                FormForControl Obj = ListFormForControl.ElementAt(ListFormForControl.Count - k -1);

                // that's a volume rendering ... no connection
                if (Obj.radioButtonIsVolumeRendering.Checked) continue;

                // the object is the master
                if (Obj.IsMasterObject()) continue;

                // this object has not connections ... is not associated to the master
                if (Obj.comboBoxLinkToTheMaster.SelectedIndex == 0) continue;

                cPoint3D ClosestPt = new cPoint3D(0, 0, 0);

                foreach (cBiological3DVolume CurrentSubObj in Obj.AssociatedBiologicalObjectList)
                {
                    cBiological3DVolume ObjectToIdentify = null;
                    switch (Obj.comboBoxLinkToTheMaster.SelectedIndex)
                    {
                        case 1:         // association by distance to the master centroid
                            ObjectToIdentify = MetaCellList.FindTheClosestVolumeCentroidFrom(CurrentSubObj.GetCentroid(), (double)Obj.WindowDistanceToMaster.numericUpDownDistanceMaxToMaster.Value);
                            break;
                        case 2:
            //                    //cBiological3DVolume CurrentVolume
                            ObjectToIdentify = MetaCellList.FindTheClosestVolumeFrom(CurrentSubObj, (double)Obj.WindowDistanceToMaster.numericUpDownDistanceMaxToMaster.Value, out ClosestPt);
                            break;
                        default:
                            break;
                   }

                    if (ObjectToIdentify == null) continue;
                    cMetaBiologicalObject Cell = MetaCellList.AssociateWith(ObjectToIdentify, CurrentSubObj);

            //            // --------------  draw information and links between the objects ---------------------
                    if (Obj.WindowDistanceToMaster.checkBoxDrawLinkToMasterCenter.Checked)
                    {
                        c3DLine CurrLine = new c3DLine(CurrentSubObj.GetCentroid(), ObjectToIdentify.GetCentroid());
                        Current3DWorld.AddGeometric3DObject(CurrLine);

                        //if (Obj.WindowDistanceToMaster.checkBoxDisplayBranchToCenterDistance.Checked)
                        //    CurrLine.DisplayLenght(Current3DWorld, 0.4);
                    }

            //            // --------------  draw information and links between the objects ---------------------
                    if (Obj.WindowDistanceToMaster.checkBoxDrawLinkToMasterEdges.Checked)
                    {
                        c3DLine CurrLine1 = new c3DLine(CurrentSubObj.GetCentroid(), ClosestPt);

                        Current3DWorld.AddGeometric3DObject(CurrLine1);

                        //if(Obj.WindowDistanceToMaster.checkBoxDisplayBranchToEdgesDistance.Checked)
                        //    CurrLine1.DisplayLenght(Current3DWorld, 0.4);
                    }
                }
            }
            #endregion

            #region Post Processings
            for (int k = 0; k < ListFormForControl.Count; k++)
            {
                FormForControl Obj = ListFormForControl.ElementAt(ListFormForControl.Count - k - 1);
                // the object is the master
            //      //  if (!Obj.IsMasterObject()) continue;

                if (!Obj.WindowForMaster.checkBoxDrawAssociatedDelaunay.Checked) continue;
                foreach (cMetaBiologicalObject CurrentMeta in MetaCellList)
                {
                    Current3DWorld.AddGeometric3DObject(CurrentMeta.GenerateDelaunay(2.0f,true));
                }
            }

            if (PostProcessWindow.checkBoxRemoveUnAssociatedObjects.Checked)
            {
                int RemovedObjects = Current3DWorld.RemoveNonAssociatedObjects();
                Console.WriteLine(RemovedObjects + " objects removed.");
            }

            //    if (PostProcessWindow.checkBoxExportMetaObjectSignatures.Checked)
            //    {
            //        if (CurrentTable == null)
            //        {
            //            CurrentTable = new DataTable();

            //            if (CurrentExperiment == null)
            //                CurrentTable.Columns.Add(new DataColumn("Image Idx", typeof(int)));
            //            else
            //            {
            //                CurrentTable.Columns.Add(new DataColumn("Image Col.", typeof(int)));
            //                CurrentTable.Columns.Add(new DataColumn("Image Row", typeof(int)));
            //            }

            //            CurrentTable.Columns.Add(new DataColumn("Meta Object Name", typeof(string)));

            //            foreach (string DescName in MetaCellList[0].GetSignatureNames())
            //                CurrentTable.Columns.Add(new DataColumn(DescName, typeof(double)));

            //            CurrentTable.Columns.Add(new DataColumn("Class", typeof(double)));
            //        }

            //        foreach (cMetaBiologicalObject CurrentMeta in MetaCellList)
            //        {
            //            List<double> CurrentSignature = CurrentMeta.GetSignature();

            //            CurrentTable.Rows.Add();
            //            if (CurrentExperiment == null)
            //            {
            //                CurrentTable.Rows[CurrentTable.Rows.Count - 1][0] = IdxImageProcessed;
            //                CurrentTable.Rows[CurrentTable.Rows.Count - 1][1] = CurrentMeta.Name;

            //                for (int Idx = 0; Idx < CurrentSignature.Count; Idx++)
            //                    CurrentTable.Rows[CurrentTable.Rows.Count - 1][Idx + 2] = CurrentSignature[Idx];
            //            }
            //            else
            //            {
            //                CurrentTable.Rows[CurrentTable.Rows.Count - 1][0] = CurrentExperiment.Column;
            //                CurrentTable.Rows[CurrentTable.Rows.Count - 1][1] = CurrentExperiment.Row;
            //                CurrentTable.Rows[CurrentTable.Rows.Count - 1][2] = CurrentMeta.Name;

            //                for (int Idx = 0; Idx < CurrentSignature.Count; Idx++)
            //                    CurrentTable.Rows[CurrentTable.Rows.Count - 1][Idx + 3] = CurrentSignature[Idx];
            //            }

            //            // Current3DWorld.CopyMetaObjectSignatureToTable(CurrentMeta, 0);
            //        }
            //        if (DataGrid != null)
            //        {
            //            DataGrid.dataGridViewForResults.DataSource = CurrentTable;
            //            DataGrid.Update();
            //            IdxImageProcessed++;
            //        }
            //    }

            #endregion

            //    //CurrentTable = new DataTable();
            //    if (CurrentExperiment == null)
            //    {
            //        if (PostProcessWindow.checkBoxDisplayBottomPlate.Checked) Current3DWorld.DisplayBottom(Color.FromArgb(255, 255, 255));
            //        Current3DWorld.SetBackgroundColor(PostProcessWindow.buttonChangeColorPositive.BackColor);
            //        Current3DWorld.Render();
            //    }
            //    // Current3DWorld.SetLinkToDataGridView(dataGridViewForClassif);

            cViewer3D V3D = new cViewer3D();
            V3D.SetInputData(Current3DWorld);
            V3D.Run();

            cDisplayToWindow DTW = new cDisplayToWindow();
            DTW.SetInputData(V3D.GetOutPut());
            DTW.Run();
            DTW.Display();
        }
示例#11
0
        private void spiralToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // first let's define all the stimuli
            #region Build the stimuli
            cStimuli ListCellStimuli = new cStimuli();

            cStimulus_Physical Gravity = new cStimulus_Physical("Gravity");
            ListCellStimuli.Add(Gravity);
            //cStimulus_Physical WorldEdges = new cStimulus_Physical("World Edges");
            //ListCellStimuli.Add(WorldEdges);
            cStimulus_Physical BrownianMotion = new cStimulus_Physical("Brownian Motion");
            ListCellStimuli.Add(BrownianMotion);


            cStimulus_Chemical ToxicCompound1 = new cStimulus_Chemical("ToxicCompound1");
            ListCellStimuli.Add(ToxicCompound1);
            #endregion


            #region build the cell agents
            #endregion

            cNewAgent BiologicalExperiment_DRC = new cNewAgent(new cPoint3D(0, 0, 0), new cPoint3D(5, 5, 5), "DRC");

            double Concentration = 0.01;
            for (int i = 0; i < 2; i++)
            {
                double WellSpacing = 1;
                cNewAgent BiologicalExperiment_Well = new cNewAgent(new cPoint3D(WellSpacing, 0, 0), new cPoint3D(1, 1, 1), "Well " + i);

                // add a new Property to the well
                cInternalProperty Cpd1Concentration = new cInternalProperty();
                Cpd1Concentration.Name = "Compound 1 Concentration";
                BiologicalExperiment_Well.AddProperty(Cpd1Concentration);

                // add the cellular agents in the well
                int RegularCellsNumber = 20;
                for (int CellIdx = 0; CellIdx < RegularCellsNumber; CellIdx++)
                {
                    cAgent_Cell Agent_RegularCell = new cAgent_Cell(new cPoint3D(0.02 * CellIdx, 0.2, 0.0200 * i), new cPoint3D(0.0100, 0.0100, 0.0100), "Regular Cell " + CellIdx);
                    Agent_RegularCell.AssociatedStimuli = ListCellStimuli;
                    BiologicalExperiment_Well.AddNewAgent(Agent_RegularCell);
                }

                int CancerCellsNumber = 30;
                for (int CellIdx = 0; CellIdx < CancerCellsNumber; CellIdx++)
                {
                    cAgent_Cell Agent_CancerCell = new cAgent_Cell(new cPoint3D(0.0100 * i, 0.0100 * CellIdx, 0.1000), new cPoint3D(0.0200, 0.0200, 0.0200), "Cancer Cell " + CellIdx);
                    Agent_CancerCell.AssociatedStimuli = ListCellStimuli;
                    BiologicalExperiment_Well.AddNewAgent(Agent_CancerCell);
                }


                // add the well agent in the DRC
                BiologicalExperiment_DRC.AddNewAgent(BiologicalExperiment_Well);

                Concentration *= 2;
            }

            for (int Iteration = 0; Iteration < 1; Iteration++)
            {
                BiologicalExperiment_DRC.Run();
            }

            // display objects in 3D
            cViewer3D V3D = new cViewer3D();
            // c3DNewWorld MyWorld = new c3DNewWorld((cPoint3D)BiologicalExperiment_DRC.InternalProperties["Volume"], new cPoint3D(1, 1, 1));
            c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1));
            V3D.SetInputData(MyWorld);
            V3D.Run();

            cDesignerSinglePanel CD = new cDesignerSinglePanel();
            CD.SetInputData(V3D.GetOutPut());
            if (CD.Run().IsSucceed == false) return;

            cListGeometric3DObject GlobalList = new cListGeometric3DObject("Global List");
            cListGeometric3DObject CellsList = new cListGeometric3DObject("Cells");

            cInternalProperty TmpProp;

            foreach (cNewAgent TmpWell in BiologicalExperiment_DRC)
            {

                cPoint3D ObjectPos = TmpWell.GetAbsoluteGetPosition();

                c3DCube SpaceCube = new c3DCube();
                TmpProp = TmpWell.InternalProperties["Volume"];
                cPoint3D VOlume = new cPoint3D(0, 0, 0);
                SpaceCube.Create(ObjectPos, VOlume, Color.Blue);
                SpaceCube.SetOpacity(0.2);
                GlobalList.AddObject(SpaceCube);

                foreach (cNewAgent TmpCell in TmpWell)
                {
                    ObjectPos = TmpCell.GetAbsoluteGetPosition();
                    c3DSphere _3DSphere = new c3DSphere(ObjectPos, 0.05, Color.Red);
                    TmpProp = TmpCell.InternalProperties["Volume"];
                    VOlume = new cPoint3D(0, 0, 0);// (cPoint3D)TmpCell.InternalProperties["Volume"];
                    //_3DSphere.(ObjectPos, 0.5, Color.Red);
                    _3DSphere.SetName(TmpCell.GetName());
                    _3DSphere.SetOpacity(1);

                    CellsList.AddObject(_3DSphere);
                }
            }


            GlobalList.AddRange(CellsList);

            foreach (var item in GlobalList)
                MyWorld.AddGeometric3DObject(item);

            cDisplayToWindow CDW = new cDisplayToWindow();
            CDW.SetInputData(CD.GetOutPut());
            CDW.Title = "3D world";
            if (CDW.Run().IsSucceed == false) return;
            CDW.Display();
            return;
        }
示例#12
0
        private void dDisplayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cViewer3D V3D = new cViewer3D();
            c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1));

            MyWorld.BackGroundColor = cGlobalInfo.OptionsWindow.FFAllOptions.panelFor3DBackColor.BackColor;

            V3D.SetInputData(MyWorld);
            V3D.Run();


            cDesignerSinglePanel CD = new cDesignerSinglePanel();
            CD.SetInputData(V3D.GetOutPut());
            if (CD.Run().IsSucceed == false) return;

            cDisplayToWindow CDW = new cDisplayToWindow();
            CDW.SetInputData(CD.GetOutPut());
            CDW.Title = "3D world";
            if (CDW.Run().IsSucceed == false) return;
            CDW.Display();
        }
示例#13
0
        private void dToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            cFeedBackMessage MessageReturned;

            cViewer2DScatterPoint V1D = new cViewer2DScatterPoint();
            V1D.Chart.IsSelectable = true;
            //V1D.Chart.LabelAxisX = "Well Index";
            //V1D.Chart.LabelAxisY = CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName();
            //V1D.Chart.BackgroundColor = Color.LightYellow;
            //V1D.Chart.IsXAxis = true;


            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();
            // cListWell ListWellsToProcess = new cListWell();

            if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
            {
                //cExtendedTable DataFromPlate = new cExtendedTable(CompleteScreening.GetCurrentDisplayPlate().ListActiveWells,
                //                                CompleteScreening.ListDescriptors.CurrentSelectedDescriptor);
                cListWells ListWellsToProcess = new cListWells(null);


                //foreach (cPlate TmpPlate in CompleteScreening.ListPlatesActive)
                foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                    if (item.GetCurrentClassIdx() != -1)
                        if (ListClassSelected[item.GetCurrentClassIdx()] == 1) ListWellsToProcess.Add(item);

                cExtendedTable DataFromPlate = new cExtendedTable(ListWellsToProcess, true);
                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);
                MessageReturned = V1D.Run();
                if (MessageReturned.IsSucceed == false)
                {
                    MessageBox.Show(MessageReturned.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                cDesignerSinglePanel Designer0 = new cDesignerSinglePanel();
                Designer0.SetInputData(V1D.GetOutPut());
                Designer0.Run();

                cDisplayToWindow Disp0 = new cDisplayToWindow();
                Disp0.SetInputData(Designer0.GetOutPut());
                Disp0.Title = "2D 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;

                //List<cWell> ListWell = new List<cWell>();
                //foreach (cPlate TmpPlate in CompleteScreening.ListPlatesActive)
                //    foreach (cWell TmpWell in TmpPlate.ListActiveWells)
                //        ListWell.Add(TmpWell);

                //cExtendedTable DataFromPlate = new cExtendedTable(ListWell,
                //                                CompleteScreening.ListDescriptors.CurrentSelectedDescriptor);

                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1)
                            if (ListClassSelected[item.GetCurrentClassIdx()] == 1) ListWellsToProcess.Add(item);

                cExtendedTable DataFromPlate = new cExtendedTable(ListWellsToProcess, true);

                DataFromPlate.Name = cGlobalInfo.CurrentScreening.GetName() + " - " + cGlobalInfo.CurrentScreening.ListPlatesActive.Count + " plates";

                V1D.SetInputData(DataFromPlate);
                V1D.Run();

                cDesignerSinglePanel Designer0 = new cDesignerSinglePanel();
                Designer0.SetInputData(V1D.GetOutPut());
                Designer0.Run();

                cDisplayToWindow Disp0 = new cDisplayToWindow();
                Disp0.SetInputData(Designer0.GetOutPut());
                Disp0.Title = "2D Scatter points graph - " + DataFromPlate[0].Count + " wells.";
                if (!Disp0.Run().IsSucceed) return;
                Disp0.Display();

               
                //dislin.metafl("xwin");

                
                //dislin.disini();
                
                

                //dislin.name("X-axis", "X");
                //dislin.name("Y-axis", "Y");
                

                
                //dislin.title();

                
                //dislin.axslen(1000, 1000);


                ////dislin.graf(0.0, 1.0, 0.0, 0.1, 0.0, 1.0, 0.0, 0.1);

                
                ////dislin.crvmat(func, n, n, 1, 1);

               
                //dislin.disfin();

            }
            else if (ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                cDesignerTab CDT = new cDesignerTab();

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    //cExtendedTable DataFromPlate = new cExtendedTable(TmpPlate.ListActiveWells,
                    //                            CompleteScreening.ListDescriptors.CurrentSelectedDescriptor);

                    cListWells ListWellsToProcess = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1)
                            if (ListClassSelected[item.GetCurrentClassIdx()] == 1) ListWellsToProcess.Add(item);

                    cExtendedTable DataFromPlate = new cExtendedTable(ListWellsToProcess, true);

                    DataFromPlate.Name = TmpPlate.GetName();

                    V1D = new cViewer2DScatterPoint();
                    V1D.Chart.IsSelectable = true;
                    V1D.Chart.LabelAxisX = "Well Index";
                    V1D.Chart.LabelAxisY = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();
                    V1D.Chart.BackgroundColor = Color.LightYellow;
                    V1D.Chart.IsXGrid = true;
                    V1D.Chart.CurrentTitle.Tag = TmpPlate;
                    V1D.SetInputData(DataFromPlate);
                    V1D.Title = TmpPlate.GetName();
                    V1D.Run();

                    CDT.SetInputData(V1D.GetOutPut());
                }

                CDT.Run();

                cDisplayToWindow Disp0 = new cDisplayToWindow();
                Disp0.SetInputData(CDT.GetOutPut());
                Disp0.Title = "2D Scatter points graphs";
                if (!Disp0.Run().IsSucceed) return;
                Disp0.Display();

               
            }


            //if (CompleteScreening == null) return;

            //SimpleFormForXY FormToDisplayXY = new SimpleFormForXY(false);
            //FormToDisplayXY.CompleteScreening = CompleteScreening;

            //for (int i = 0; i < (int)CompleteScreening.ListDescriptors.Count; i++)
            //{
            //    FormToDisplayXY.comboBoxDescriptorX.Items.Add(CompleteScreening.ListDescriptors[i].GetName());
            //    FormToDisplayXY.comboBoxDescriptorY.Items.Add(CompleteScreening.ListDescriptors[i].GetName());
            //}

            //FormToDisplayXY.comboBoxDescriptorX.SelectedIndex = 0;
            //FormToDisplayXY.comboBoxDescriptorY.SelectedIndex = 0;


            //FormToDisplayXY.DisplayXY();
            //FormToDisplayXY.ShowDialog();

            //return;
        }
示例#14
0
        private void lDAToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses();
            if (GUI_ListClasses.Run().IsSucceed == false) return;
            cExtendedList ListClassSelected = GUI_ListClasses.GetOutPut()[0];

            if (ListClassSelected.Sum() < 2)
            {
                MessageBox.Show("At least two classes have to be selected to perfom a LDA.", "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            cDisplayToWindow vD = new cDisplayToWindow();

            if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
            {
                cPlate TmpPlate = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate();
                cListWells ListWellsToProcess = new cListWells(null);
                cExtendedList ListClasses = new cExtendedList();
                ListClasses.Name = "Classes";
                foreach (cWell item in TmpPlate.ListActiveWells)
                    if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1))
                    {
                        ListWellsToProcess.Add(item);
                        ListClasses.Add(item.GetCurrentClassIdx());
                    }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);
                NewTable.Add(ListClasses);

                cProjectorLDA LDA = new cProjectorLDA();
                LDA.SetInputData(NewTable);
                cFeedBackMessage FM = LDA.Run();
                if (!FM.IsSucceed)
                {
                    MessageBox.Show(FM.Message, "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                cViewerTable VHM = new cViewerTable();
                cExtendedTable CT = LDA.GetOutPut();

                foreach (var item in CT)
                {
                    cDescriptorsLinearCombination DLC = new cDescriptorsLinearCombination(item);
                    foreach (cDescriptorType Desc in item.ListTags)
                        DLC.Add(Desc);
                    item.Tag = DLC;
                }
                VHM.SetInputData(CT);
                VHM.Run();

                vD.SetInputData(VHM.GetOutPut());
                vD.Title = "LDA - " + TmpPlate.GetName() + " : " + ListWellsToProcess.Count + " wells";
            }
            else if (ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                cListWells ListWellsToProcess = new cListWells(null);
                cExtendedList ListClasses = new cExtendedList();
                ListClasses.Name = "Classes";

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[item.GetCurrentClassIdx()] == 1)
                            {
                                ListWellsToProcess.Add(item);
                                ListClasses.Add(item.GetCurrentClassIdx());
                            }
                        }
                    }
                }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);
                NewTable.Add(ListClasses);
                cProjectorLDA LDA = new cProjectorLDA();
                LDA.SetInputData(NewTable);
                cFeedBackMessage FM = LDA.Run();
                if (!FM.IsSucceed)
                {
                    MessageBox.Show(FM.Message, "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                cExtendedTable CT = LDA.GetOutPut();

                foreach (var item in CT)
                {
                    cDescriptorsLinearCombination DLC = new cDescriptorsLinearCombination(item);

                    foreach (cDescriptorType Desc in item.ListTags)
                        DLC.Add(Desc);

                    item.Tag = DLC;
                }

                cViewerTable VHM = new cViewerTable();
                VHM.SetInputData(CT);

                VHM.Run();

                vD.SetInputData(VHM.GetOutPut());
                vD.Title = "LDA - " + ListWellsToProcess.Count + " wells.";
            }
            else if (ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                cDesignerTab CDT = new cDesignerTab();

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    cListWells ListWellsToProcess = new cListWells(null);
                    cExtendedList ListClasses = new cExtendedList();
                    ListClasses.Name = "Classes";


                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[item.GetCurrentClassIdx()] == 1)
                            {
                                ListWellsToProcess.Add(item);
                                ListClasses.Add(item.GetCurrentClassIdx());
                            }
                        }
                    }

                    cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);
                    NewTable.Add(ListClasses);
                    NewTable.Name = TmpPlate.GetName();

                    cProjectorLDA LDA = new cProjectorLDA();
                    LDA.SetInputData(NewTable);
                    cFeedBackMessage FM = LDA.Run();
                    if (!FM.IsSucceed)
                    {
                        MessageBox.Show(FM.Message, "Error !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    cExtendedTable CT = LDA.GetOutPut();

                    foreach (var item in CT)
                    {
                        cDescriptorsLinearCombination DLC = new cDescriptorsLinearCombination(item);

                        foreach (cDescriptorType Desc in item.ListTags)
                            DLC.Add(Desc);

                        item.Tag = DLC;
                    }

                    cViewerTable VHM = new cViewerTable();
                    VHM.SetInputData(CT);
                    VHM.Run();
                    CDT.SetInputData(VHM.GetOutPut());
                }
                CDT.Run();
                vD.SetInputData(CDT.GetOutPut());
            }
            else
                return;

            vD.Run();
            vD.Display();
        }
示例#15
0
        private void covarianceMatrixToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (checkedListBoxActiveDescriptors.CheckedItems.Count <= 1)
            {
                MessageBox.Show("At least two descriptors have to be selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            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 vD = new cDisplayToWindow();
            cDesignerTab DT = new cDesignerTab();

            cCovarianceMatrix CM = new cCovarianceMatrix();
            // CM.FTestTails = eFTestTails.BOTH;

            if (this.ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                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 = new cExtendedTable(ListWellsToProcess, true);


                    CM.SetInputData(NewTable);
                    CM.Run();

                    //cViewerHeatMap VHM = new cViewerHeatMap();
                    cViewerTable VHM = new cViewerTable();
                    VHM.SetInputData(CM.GetOutPut());
                    //VHM.IsDisplayValues = true;
                    vD.Title = "Covariance - " + TmpPlate.GetName() + " (" + ListWellsToProcess.Count + " wells)";
                    VHM.Run();

                    DT.SetInputData(VHM.GetOutPut());
                }
            }
            else if (this.ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);
                }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                //  cTwoSampleFTest CM = new cTwoSampleFTest();
                CM.SetInputData(NewTable);
                CM.Run();

                // cViewerHeatMap VHM = new cViewerHeatMap();
                cViewerTable VHM = new cViewerTable();
                VHM.SetInputData(CM.GetOutPut());
                //VHM.IsDisplayValues = true;
                vD.Title = "Covariance - Entire screening (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }
            else
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                    if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                // cTwoSampleFTest CM = new cTwoSampleFTest();
                CM.SetInputData(NewTable);
                CM.Run();

                //cViewerHeatMap VHM = new cViewerHeatMap();
                cViewerTable VHM = new cViewerTable();
                VHM.SetInputData(CM.GetOutPut());
                //VHM.IsDisplayValues = true;
                vD.Title = "Covariance - " + cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName() + " (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }

            DT.Run();

            vD.SetInputData(DT.GetOutPut());
            // vD.Title = "F-Test";
            vD.Run();
            vD.Display();
        }
示例#16
0
        private void testLinearRegressionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cListWells ListWellsToProcess = new cListWells(null);

            foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);

            cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

            cLinearRegression LR = new cLinearRegression();
            LR.SetInputData(NewTable);
            LR.Run();



            cViewerTable VT = new cViewerTable();
            VT.SetInputData(LR.GetOutPut());
            VT.Run();


            cDisplayToWindow vD = new cDisplayToWindow();
            vD.SetInputData(VT.GetOutPut());
            vD.Title = "Linear regression (Test)";
            vD.Run();
            vD.Display();

        }
示例#17
0
        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();
        }
示例#18
0
        private void ftestdescBasedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (checkedListBoxActiveDescriptors.CheckedItems.Count <= 1)
            {
                MessageBox.Show("At least two descriptors have to be selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            cDesignerTab DT = new cDesignerTab();

            cTwoSampleFTest CM = new cTwoSampleFTest();
            CM.FTestTails = eFTestTails.BOTH;

            if (this.ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    cListWells ListWellsToProcess = new cListWells(null);
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);

                    cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);


                    CM.SetInputData(NewTable);
                    CM.Run();

                    cViewerHeatMap VHM = new cViewerHeatMap();
                    VHM.SetInputData(CM.GetOutPut());
                    VHM.IsDisplayValues = true;
                    VHM.Title = "F-Test - " + TmpPlate.GetName() + " (" + ListWellsToProcess.Count + " wells)";
                    VHM.Run();

                    DT.SetInputData(VHM.GetOutPut());
                }
            }
            else if (this.ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);
                }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                //  cTwoSampleFTest CM = new cTwoSampleFTest();
                CM.SetInputData(NewTable);
                CM.Run();

                cViewerHeatMap VHM = new cViewerHeatMap();
                VHM.SetInputData(CM.GetOutPut());
                VHM.IsDisplayValues = true;
                VHM.Title = "F-Test - Entire screening (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }
            else
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                    if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                // cTwoSampleFTest CM = new cTwoSampleFTest();
                CM.SetInputData(NewTable);
                CM.Run();

                cViewerHeatMap VHM = new cViewerHeatMap();
                VHM.SetInputData(CM.GetOutPut());
                VHM.IsDisplayValues = true;
                VHM.Title = "F-Test - " + cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName() + " (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }

            DT.Run();
            cDisplayToWindow vD = new cDisplayToWindow();
            vD.SetInputData(DT.GetOutPut());
            vD.Title = "F-Test";
            vD.Run();
            vD.Display();
        }
示例#19
0
        private void correlationMatrixToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (checkedListBoxActiveDescriptors.CheckedItems.Count <= 1)
            {
                MessageBox.Show("At least two descriptors have to be selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            if (checkedListBoxActiveDescriptors.CheckedItems.Count <= 1)
            {
                MessageBox.Show("At least two descriptors have to be selected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            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;
            }


            cDesignerTab DT = new cDesignerTab();

            if (this.ProcessModeplateByPlateToolStripMenuItem.Checked)
            {
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    //ListWellsToProcess.AddRange(TmpPlate.ListActiveWells);
                    cListWells ListWellsToProcess = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);
                    }

                    cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                    cCorrelationMatrix CM = new cCorrelationMatrix();
                    CM.SetInputData(NewTable);
                    CM.Run();


                    cExtendedTable CorrelationMatrix = CM.GetOutPut();
                    weka.core.Instances Insts = CorrelationMatrix.CreateWekaInstances();


                    weka.clusterers.HierarchicalClusterer ClustererToReturn = new weka.clusterers.HierarchicalClusterer();
                    // string OptionDistance = " -N " + (int)Parameters.ListDoubleValues.Get("numericUpDownNumClasses").Value;

                    //string DistanceType = (string)Parameters.ListTextValues.Get("comboBoxDistance").Value;
                    //OptionDistance += " -A \"weka.core.";
                    //switch (DistanceType)
                    //{
                    //    case "Euclidean":
                    //        OptionDistance += "EuclideanDistance";
                    //        break;
                    //    case "Manhattan":
                    //        OptionDistance += "ManhattanDistance";
                    //        break;
                    //    case "Chebyshev":
                    //        OptionDistance += "ChebyshevDistance";
                    //        break;
                    //    default:
                    //        break;
                    //}

                    //if (!(bool)Parameters.ListCheckValues.Get("checkBoxNormalize").Value)
                    //    OptionDistance += " -D";
                    //OptionDistance += " -R ";


                    //OptionDistance += "first-last\"";
                    //string WekaOption = "-L " + (string)Parameters.ListTextValues.Get("comboBoxLinkType").Value + OptionDistance;
                    ((weka.clusterers.HierarchicalClusterer)ClustererToReturn).setOptions(weka.core.Utils.splitOptions("-N 1 -L SINGLE -P -A \"weka.core.EuclideanDistance -R first-last\" "));

                    ClustererToReturn.buildClusterer(Insts);
                    //this.NumberOfClusters = ClustererToReturn.numberOfClusters();
                    cInfoForHierarchical IFH = new cInfoForHierarchical();
                    IFH.ListInstances = Insts;

                    cDendoGram DENDO = new cDendoGram(((weka.clusterers.HierarchicalClusterer)ClustererToReturn), IFH, GlobalInfo);



                    //cViewerHeatMap VHM = new cViewerHeatMap();
                    cViewerTable VHM = new cViewerTable();
                    VHM.SetInputData(CM.GetOutPut());
                    //VHM.IsDisplayValues = true;
                    VHM.Title = "Correlation - " + TmpPlate.GetName() + " (" + ListWellsToProcess.Count + " wells)";
                    VHM.Run();
                    VHM.GetOutPut().Title = TmpPlate.GetName();
                    DT.SetInputData(VHM.GetOutPut());
                }
            }
            else if (this.ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                {
                    foreach (cWell item in TmpPlate.ListActiveWells)
                        if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);
                }

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                cCorrelationMatrix CM = new cCorrelationMatrix();
                CM.SetInputData(NewTable);
                CM.Run();

                //cViewerHeatMap VHM = new cViewerHeatMap();
                cViewerTable VHM = new cViewerTable();
                VHM.SetInputData(CM.GetOutPut());
                //VHM.IsDisplayValues = true;
                VHM.Title = "Correlation - Entire screening (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }
            else
            {
                cListWells ListWellsToProcess = new cListWells(null);

                foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                    if ((item.GetCurrentClassIdx() != -1) && (ListClassSelected[item.GetCurrentClassIdx()] == 1)) ListWellsToProcess.Add(item);

                cExtendedTable NewTable = new cExtendedTable(ListWellsToProcess, true);

                cCorrelationMatrix CM = new cCorrelationMatrix();
                CM.SetInputData(NewTable);
                CM.Run();

                //cViewerHeatMap VHM = new cViewerHeatMap();
                cViewerTable VHM = new cViewerTable();
                VHM.SetInputData(CM.GetOutPut());
                //VHM.IsDisplayValues = true;
                VHM.Title = "Correlation - " + cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName() + " (" + ListWellsToProcess.Count + " wells)";
                VHM.Run();

                DT.SetInputData(VHM.GetOutPut());
            }

            DT.Run();

            //  DT.SetInputData(VT.GetOutPut());

            //cDesignerColumn DC = new cDesignerColumn();  
            //DC.SetInputData(VHM.GetOutPut());
            //DC.SetInputData(VT.GetOutPut());
            //DC.Run();

            //cDisplayDesigner DD = new cDisplayDesigner();
            // DD.SetInputData(VHM.GetOutPut());
            // DD.Run();

            cDisplayToWindow vD = new cDisplayToWindow();
            vD.SetInputData(DT.GetOutPut());
            vD.Title = "Pearson Correlation";
            vD.Run();
            vD.Display();

            //ComputeAndDisplayCorrelationMatrix(false, true, null);
        }
示例#20
0
        private void aNOVAToolStripMenuItem1_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;
            cExtendedTable ListClassSelected = GUI_ListClasses.GetOutPut();

            string SubTitle = "ANOVA (One-Way)";


            #region single plate and plate by plate

            cDesignerTab DT = new cDesignerTab();
            if ((ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) || (ProcessModeplateByPlateToolStripMenuItem.Checked)/*||(ProcessModeEntireScreeningToolStripMenuItem.Checked)*/)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                if ((ProcessModeplateByPlateToolStripMenuItem.Checked)/*||(ProcessModeEntireScreeningToolStripMenuItem.Checked)*/)
                {
                    foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                        ListPlatesToProcess.Add(TmpPlate);
                }
                else
                    ListPlatesToProcess.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate());

                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {
                    cExtendedTable NewTable1 = new cExtendedTable();
                    List<cListWells> ListListWells = new List<cListWells>();


                    int NumWells = 0;

                    for (int IdxClassWell = 0; IdxClassWell < ListClassSelected[0].Count; IdxClassWell++)
                    {
                        if (ListClassSelected[0][IdxClassWell] >= 1)
                        {
                            List<cWellClassType> LCT = new List<cWellClassType>();
                            LCT.Add(cGlobalInfo.ListWellClasses[IdxClassWell]);

                            cListWells TmpList = TmpPlate.ListWells.Filter(LCT);

                            if (TmpList.Count >= 3)
                            {
                                ListListWells.Add(TmpList);
                                NumWells += TmpList.Count;
                            }
                        }
                    }

                    if (ListListWells.Count <= 1)
                    {
                        if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                        {
                            MessageBox.Show("Insufficient number of control wells", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        else
                            continue;
                    }


                    cExtendedTable CompleteReport = null;
                    cExtendedList ListZ = new cExtendedList();
                    List<cDescriptorType> ListDescForZFactor = new List<cDescriptorType>();
                    List<string> ListNames = new List<string>();
                    int RealIdx = 0;
                    for (int IDxDesc = 0; IDxDesc < cGlobalInfo.CurrentScreening.ListDescriptors.Count; IDxDesc++)
                    {
                        if (!cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc].IsActive()) continue;

                        cExtendedTable TableForZ = new cExtendedTable();

                        foreach (var item in ListListWells)
                        {
                            List<cDescriptorType> LType = new List<cDescriptorType>();
                            LType.Add(cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc]);
                            cExtendedTable TTable = item.GetAverageDescriptorValues(LType, false, false);
                            TableForZ.Add(TTable[0]);
                        }
                        RealIdx++;

                        cANOVA ZF = new cANOVA();
                        ZF.SetInputData(TableForZ);
                        ZF.Run();
                        ListZ.Add(ZF.GetOutPut()[0][0]);

                        ZF.GetOutPut()[0].Name = cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc].GetName();

                        if (CompleteReport == null)
                            CompleteReport = new cExtendedTable(ZF.GetOutPut());
                        else
                        {
                            cMerge M = new cMerge();
                            M.IsHorizontal = true;
                            M.SetInputData(CompleteReport, ZF.GetOutPut());
                            M.Run();
                            CompleteReport = M.GetOutPut();
                        }

                        ListDescForZFactor.Add(cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc]);
                    }

                    cExtendedTable ET = new cExtendedTable(new cExtendedTable(ListZ));
                    ET[0].ListTags = new List<object>();
                    ET[0].ListTags.AddRange(ListDescForZFactor);
                    ET.Name = TmpPlate.GetName() + "\n" + SubTitle + " - " + NumWells + " wells";// +" - " +cGlobalInfo.ListWellClasses[IdxClassNeg].Name + " (" + NewTable1[0].Count + " wells) vs. " +cGlobalInfo.ListWellClasses[IdxClassPos].Name + " (" + NewTable2[0].Count + " wells)";
                    ET[0].Name = ET.Name;

                    cSort S = new cSort();
                    S.SetInputData(ET);
                    S.IsAscending = false;
                    S.ColumnIndexForSorting = 0;
                    S.Run();

                    //ZFactorList.Sort(delegate(cSimpleSignature p1, cSimpleSignature p2) { return p1.AverageValue.CompareTo(p2.AverageValue); });

                    cViewerGraph1D VG1 = new cViewerGraph1D();
                    VG1.SetInputData(S.GetOutPut());

                    VG1.Chart.LabelAxisY = SubTitle;
                    VG1.Chart.LabelAxisX = "Descriptor";
                    VG1.Chart.IsZoomableX = true;
                    VG1.Chart.IsBar = true;
                    VG1.Chart.IsBorder = true;
                    VG1.Chart.IsDisplayValues = true;
                    VG1.Chart.IsShadow = true;
                    VG1.Chart.MarkerSize = 4;

                    //VG1.Chart.Max
                    VG1.Title = TmpPlate.GetName();

                    // Classes.Base_Classes.General.cLineHorizontalForGraph VLZ05 = new Classes.Base_Classes.General.cLineHorizontalForGraph(.05);
                    // VLZ05.IsAllowMoving = true;
                    //  VG1.Chart.ListHorizontalLines.Add(VLZ05);

                    VG1.Run();

                    cDesignerSplitter DS = new cDesignerSplitter();
                    DS.Orientation = Orientation.Vertical;
                    DS.SetInputData(VG1.GetOutPut());


                    cTranspose T = new cTranspose();
                    T.SetInputData(CompleteReport);
                    T.Run();
                    CompleteReport = T.GetOutPut();
                    CompleteReport[0].Name = "P-Value";
                    CompleteReport[1].Name = "Is significant ?";

                    cSort S1 = new cSort();
                    S1.SetInputData(CompleteReport);
                    S1.ColumnIndexForSorting = 0;
                    S1.IsAscending = true;
                    S1.Run();



                    cViewerTable VT = new cViewerTable();
                    VT.SetInputData(S1.GetOutPut());
                    VT.DigitNumber = -1;
                    VT.Run();

                    DS.SetInputData(VT.GetOutPut());
                    DS.Title = TmpPlate.GetName();
                    DS.Run();

                    DT.SetInputData(DS.GetOutPut());
                }
                DT.Run();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(DT.GetOutPut());//VG1.GetOutPut());


                if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                    CDW.Title = SubTitle + " - " + ListPlatesToProcess[0].GetName();
                else
                    CDW.Title = SubTitle + " - " + ListPlatesToProcess.Count + " plates";

                CDW.Run();
                CDW.Display();
            }
            #endregion

            #region entire screening
            else if (ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                    ListPlatesToProcess.Add(TmpPlate);

                cExtendedList ListZ = new cExtendedList();
                List<cPlate> ListPlatesForZFactor = new List<cPlate>();
                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {
                    cListWells ListWellsToProcess1 = new cListWells(null);
                    cListWells ListWellsToProcess2 = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[0][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess1.Add(item);
                            if (ListClassSelected[1][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess2.Add(item);
                        }
                    }

                    cExtendedTable NewTable1 = new cExtendedTable(ListWellsToProcess1, cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorIndex(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()));
                    cExtendedTable NewTable2 = new cExtendedTable(ListWellsToProcess2, cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorIndex(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()));
                    //cExtendedTable NewTable2 = new cExtendedTable(ListWellsToProcess2, false);

                    if ((NewTable1.Count == 0) || (NewTable1[0].Count < 2) || (NewTable2.Count == 0) || (NewTable2[0].Count < 2))
                    {
                        if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                        {
                            MessageBox.Show("Insufficient number of control wells", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        else
                            continue;
                    }

                    cExtendedTable TableForZ = new cExtendedTable();

                    TableForZ.Add(NewTable1[0]);
                    TableForZ.Add(NewTable2[0]);

                    cStudent_tTest ZF = new cStudent_tTest();
                    ZF.SetInputData(TableForZ);
                    ZF.Run();
                    double Zfactor = ZF.GetOutPut()[0][1];
                    ListZ.Add(Zfactor);

                    // update plate quality
                    //TmpPlate.ListProperties.UpdateValueByName("Quality", Math.Exp(Zfactor - 1));
                    //cProperty Prop = TmpPlate.ListProperties.FindByName("Quality");
                    //Prop.Info = ZF.GetInfo();

                    ListPlatesForZFactor.Add(TmpPlate);
                }


                cExtendedTable ET = new cExtendedTable(new cExtendedTable(ListZ));
                ET[0].ListTags = new List<object>();
                ET[0].ListTags.AddRange(ListPlatesForZFactor);
                ET.Name = SubTitle + " - " + cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();// +" - " +cGlobalInfo.ListWellClasses[IdxClassNeg].Name + /*" (" + NewTable1[0].Count + " wells)*/ " vs. " +cGlobalInfo.ListWellClasses[IdxClassPos].Name;// +" (" + NewTable2[0].Count + " wells)";
                ET[0].Name = ET.Name;

                cViewerGraph1D VG1 = new cViewerGraph1D();
                VG1.SetInputData(ET);

                VG1.Chart.LabelAxisY = SubTitle;
                VG1.Chart.LabelAxisX = "Plate";
                VG1.Chart.IsZoomableX = true;
                VG1.Chart.IsBar = true;
                VG1.Chart.IsBorder = true;
                VG1.Chart.IsDisplayValues = true;
                VG1.Chart.IsShadow = true;
                VG1.Chart.MarkerSize = 4;



                VG1.Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();
                VG1.Run();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(VG1.GetOutPut());
                CDW.Title = SubTitle + " - " + ListPlatesToProcess.Count + " plates";
                CDW.Run();
                CDW.Display();
            #endregion
            }

        }
示例#21
0
        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();
            }

        }
示例#22
0
        private void testMultiScatterToolStripMenuItem_Click(object sender, EventArgs e)
        {

            //V1D.Chart.LabelAxisX = "Well Index";
            //V1D.Chart.LabelAxisY = CompleteScreening.ListDescriptors[CompleteScreening.ListDescriptors.CurrentSelectedDescriptor].GetName();
            //V1D.Chart.BackgroundColor = Color.LightYellow;
            //V1D.Chart.IsXAxis = true;


            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;
            }


            cDesignerSplitter CDC = new cDesignerSplitter();
            cListWells ListWellsToProcess = new cListWells(null);

            //foreach (cPlate TmpPlate in CompleteScreening.ListPlatesActive)
            foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                if (item.GetCurrentClassIdx() != -1)
                    if (ListClassSelected[item.GetCurrentClassIdx()] == 1) ListWellsToProcess.Add(item);

            cExtendedTable DataFromPlate = new cExtendedTable(ListWellsToProcess, true);
            DataFromPlate.Name = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName();

            //if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
            {


                for (int IdxDesc0 = 0; IdxDesc0 < DataFromPlate.Count; IdxDesc0++)
                    for (int IdxDesc1 = 1; IdxDesc1 < DataFromPlate.Count; IdxDesc1++)
                    {


                        cViewer2DScatterPoint V1D = new cViewer2DScatterPoint();
                        V1D.Chart.CurrentTitle.Tag = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate();
                        V1D.Chart.IdxDesc0 = IdxDesc0;
                        V1D.Chart.IdxDesc1 = IdxDesc1;
                        V1D.SetInputData(DataFromPlate);
                        V1D.Run();
                        V1D.Chart.Width = 0;
                        V1D.Chart.Height = 0;

                        cDesignerSinglePanel Designer0 = new cDesignerSinglePanel();
                        Designer0.SetInputData(V1D.GetOutPut());
                        Designer0.Run();

                        CDC.SetInputData(Designer0.GetOutPut());
                    }
            }

            CDC.Run();

            cDisplayToWindow Disp0 = new cDisplayToWindow();
            Disp0.SetInputData(CDC.GetOutPut());
            Disp0.Title = "2D Scatter points graph - wells.";
            if (!Disp0.Run().IsSucceed) return;
            Disp0.Display();

        }
示例#23
0
        private void dToolStripMenuItemScatterPlot3D_Click(object sender, EventArgs e)
        {
            int MaxNumberOfPts = (int)cGlobalInfo.OptionsWindow.FFAllOptions.numericUpDownMinNumPointForFastDisp.Value;

            if (cGlobalInfo.CurrentScreening.ListPlatesActive.GetListActiveWells().Count > MaxNumberOfPts)
            {
                cExtendedTable ET = cGlobalInfo.CurrentScreening.ListPlatesActive.GetListActiveWells().GetAverageDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptors(), false, false);
                cNormalize N = new cNormalize();
                N.SetInputData(ET);
                N.NormalizationType = eNormalizationType.MIN_MAX;
                N.Run();
                cExtendedTable NormTable = N.GetOutPut();

                cViewer3D V3D = new cViewer3D();
                c3DPointCloud _3DPtCloud = new c3DPointCloud(NormTable);
                _3DPtCloud.AutomatedPtColorMode = 1;
                _3DPtCloud.Create(new cPoint3D(0, 0, 0));
                _3DPtCloud.SetName("_3DPtCloud");
                cListGeometric3DObject GlobalList = new cListGeometric3DObject("3D Point Cloud MetaObject");

                GlobalList.Add(_3DPtCloud);

                c3DObject_Axis Axis = new c3DObject_Axis();
                cExtendedTable T = new cExtendedTable();
                T.Add(new cExtendedList(ET[0].Name));

                T[0].Tag = ET[0].Tag;
                T[0].Add(0);
                T[0].Add(1);
                T.Add(new cExtendedList(ET[1].Name));
                T[1].Tag = ET[1].Tag;
                T[1].Add(0);
                T[1].Add(1);

                if (ET.Count > 2)
                {
                    T.Add(new cExtendedList(ET[2].Name));
                    T[2].Tag = ET[2].Tag;
                    T[2].Add(0);
                    T[2].Add(1);
                }

                Axis.SetInputData(T);

                c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1));
                Axis.Run(MyWorld);

                GlobalList.AddRange(Axis.GetOutPut());

                // GlobalList.Add(Axis);

                foreach (var item in GlobalList)
                {
                    MyWorld.AddGeometric3DObject(item);
                }

                //  MyWorld.BackGroundColor = cGlobalInfo.OptionsWindow.FFAllOptions.panelFor3DBackColor.BackColor;

                V3D.SetInputData(MyWorld);
                V3D.Run();

                cDisplayToWindow DTW = new cDisplayToWindow();
                DTW.SetInputData(V3D.GetOutPut());
                DTW.Title = "3D Cloud Point - " + ET[0].Count + " points";
                DTW.Run();

                DTW.Display();
            }
            else
            {
                cGlobalInfo.OptionsWindow.checkBoxConnectDRCPts.Checked = false;
                FormFor3DDataDisplay FormToDisplayXYZ = new FormFor3DDataDisplay(ProcessModeEntireScreeningToolStripMenuItem.Checked, cGlobalInfo.CurrentScreening);
                for (int i = 0; i < (int)cGlobalInfo.CurrentScreening.ListDescriptors.Count; i++)
                {
                    FormToDisplayXYZ.comboBoxDescriptorX.Items.Add(cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName());
                    FormToDisplayXYZ.comboBoxDescriptorY.Items.Add(cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName());
                    FormToDisplayXYZ.comboBoxDescriptorZ.Items.Add(cGlobalInfo.CurrentScreening.ListDescriptors[i].GetName());
                }
                FormToDisplayXYZ.Show();
                FormToDisplayXYZ.comboBoxDescriptorX.Text = cGlobalInfo.CurrentScreening.ListDescriptors[0].GetName() + " ";
                FormToDisplayXYZ.comboBoxDescriptorY.Text = cGlobalInfo.CurrentScreening.ListDescriptors[0].GetName() + " ";
                FormToDisplayXYZ.comboBoxDescriptorZ.Text = cGlobalInfo.CurrentScreening.ListDescriptors[0].GetName() + " ";
            }
            return;
        }
示例#24
0
        private void statisticsToolStripMenuItem1_Click_1(object sender, EventArgs e)
        {
            string NameFunction = "";

            if (_StatCVItem.Checked)
                NameFunction = "Coeff. of Variation";
            else if (_StatMeanItem.Checked)
                NameFunction = "Mean";
            else if (_StatSumItem.Checked)
                NameFunction = "Sum";
            else if (_StatJarqueBeraItem.Checked)
                NameFunction = "Jarque-Bera";

            cGUI_ListClasses GUI_ListClasses = new cGUI_ListClasses();

            GUI_ListClasses.IsCheckBoxes = true;
            GUI_ListClasses.IsSelectAll = true;

            if (GUI_ListClasses.Run().IsSucceed == false) return;
            cExtendedTable ListClassSelected = new cExtendedTable(GUI_ListClasses.GetOutPut());// GetOutPut();


            int IdxClass = -1;
            for (int IdxC = 0; IdxC < ListClassSelected[0].Count; IdxC++)
            {
                if (ListClassSelected[0][IdxC] == 1) IdxClass = IdxC;
            }

            #region single plate and plate by plate

            cDesignerTab DT = new cDesignerTab();
            if ((ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) || (ProcessModeplateByPlateToolStripMenuItem.Checked)/*||(ProcessModeEntireScreeningToolStripMenuItem.Checked)*/)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                if ((ProcessModeplateByPlateToolStripMenuItem.Checked)/*||(ProcessModeEntireScreeningToolStripMenuItem.Checked)*/)
                {
                    foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                        ListPlatesToProcess.Add(TmpPlate);
                }
                else
                    ListPlatesToProcess.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate());

                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {
                    cListWells ListWellsToProcess1 = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[0][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess1.Add(item);
                        }
                    }

                    cExtendedTable NewTable1 = new cExtendedTable(ListWellsToProcess1, true);

                    if ((NewTable1.Count == 0) || (NewTable1[0].Count < 3))
                    {
                        if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                        {
                            MessageBox.Show("Insufficient number of control wells", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        else
                            continue;
                    }

                    cExtendedList ListValues = new cExtendedList();
                    List<cDescriptorType> ListDescs = new List<cDescriptorType>();
                    List<string> ListNames = new List<string>();
                    int RealIdx = 0;
                    for (int IDxDesc = 0; IDxDesc < cGlobalInfo.CurrentScreening.ListDescriptors.Count; IDxDesc++)
                    {
                        if (!cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc].IsActive()) continue;

                        cExtendedTable TableForValues = new cExtendedTable();

                        TableForValues.Add(NewTable1[RealIdx]);

                        RealIdx++;

                        if (_StatJarqueBeraItem.Checked)
                        {
                            cNormalityJarqueBera JB = new cNormalityJarqueBera();
                            JB.SetInputData(TableForValues);
                            JB.Run();
                            ListValues.Add(JB.GetOutPut()[0][0]);
                        }
                        else
                        {
                            cStatistics CS = new cStatistics();
                            CS.UnselectAll();

                            if (_StatCVItem.Checked)
                                CS.IsCV = true;
                            else if (_StatMeanItem.Checked)
                                CS.IsMean = true;
                            else if (_StatSumItem.Checked)
                                CS.IsSum = true;

                            CS.SetInputData(TableForValues);
                            CS.Run();
                            ListValues.Add(CS.GetOutPut()[0][0]);
                        }

                        ListDescs.Add(cGlobalInfo.CurrentScreening.ListDescriptors[IDxDesc]);

                    }

                    cExtendedTable ET = new cExtendedTable(new cExtendedTable(ListValues));
                    ET[0].ListTags = new List<object>();
                    ET[0].ListTags.AddRange(ListDescs);
                    ET.Name = TmpPlate.GetName() + "\n" + NameFunction + " - " + cGlobalInfo.ListWellClasses[IdxClass].Name + " (" + NewTable1[0].Count + " wells)";
                    ET[0].Name = ET.Name;

                    cSort S = new cSort();
                    S.SetInputData(ET);
                    S.ColumnIndexForSorting = 0;
                    S.Run();

                    //ZFactorList.Sort(delegate(cSimpleSignature p1, cSimpleSignature p2) { return p1.AverageValue.CompareTo(p2.AverageValue); });
                    cViewerGraph1D VG1 = new cViewerGraph1D();
                    VG1.SetInputData(S.GetOutPut());

                    VG1.Chart.LabelAxisY = NameFunction;
                    VG1.Chart.LabelAxisX = "Descriptor";
                    VG1.Chart.IsZoomableX = true;
                    VG1.Chart.IsBar = true;
                    VG1.Chart.IsBorder = true;
                    VG1.Chart.IsDisplayValues = true;
                    VG1.Chart.IsShadow = true;
                    VG1.Chart.MarkerSize = 4;
                    VG1.Title = TmpPlate.GetName();
                    VG1.Run();

                    DT.SetInputData(VG1.GetOutPut());
                }
                DT.Run();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(DT.GetOutPut());//VG1.GetOutPut());


                if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                    CDW.Title = NameFunction + " - " + ListPlatesToProcess[0].GetName();
                else
                    CDW.Title = NameFunction + " - " + ListPlatesToProcess.Count + " plates";

                CDW.Run();
                CDW.Display();
            }
            #endregion
            #region entire screening
            else if (ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                    ListPlatesToProcess.Add(TmpPlate);

                cExtendedList ListZ = new cExtendedList();
                List<cPlate> ListPlatesForZFactor = new List<cPlate>();
                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {
                    cListWells ListWellsToProcess1 = new cListWells(null);

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[0][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess1.Add(item);
                        }
                    }


                    cExtendedTable NewTable1 = new cExtendedTable(ListWellsToProcess1, cGlobalInfo.CurrentScreening.ListDescriptors.GetDescriptorIndex(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor()));


                    if ((NewTable1.Count == 0) || (NewTable1[0].Count < 3))
                    {
                        if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                        {
                            MessageBox.Show("Insufficient number of control wells", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        else
                            continue;
                    }


                    if (_StatJarqueBeraItem.Checked)
                    {
                        cNormalityJarqueBera JB = new cNormalityJarqueBera();
                        JB.SetInputData(NewTable1);
                        JB.Run();
                        ListZ.Add(JB.GetOutPut()[0][0]);
                    }
                    else
                    {
                        cStatistics CS = new cStatistics();
                        CS.UnselectAll();

                        if (_StatCVItem.Checked)
                            CS.IsCV = true;
                        else if (_StatMeanItem.Checked)
                            CS.IsMean = true;
                        else if (_StatSumItem.Checked)
                            CS.IsSum = true;

                        CS.SetInputData(NewTable1);
                        CS.Run();
                        ListZ.Add(CS.GetOutPut()[0][0]);
                    }
                    ListPlatesForZFactor.Add(TmpPlate);
                }
            #endregion

                cExtendedTable ET = new cExtendedTable(new cExtendedTable(ListZ));
                ET[0].ListTags = new List<object>();
                ET[0].ListTags.AddRange(ListPlatesForZFactor);
                ET.Name = NameFunction + " - " + cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();// +" - " +cGlobalInfo.ListWellClasses[IdxClassNeg].Name + " (" + NewTable1[0].Count + " wells) vs. " +cGlobalInfo.ListWellClasses[IdxClassPos].Name + " (" + NewTable2[0].Count + " wells)";
                ET[0].Name = ET.Name;

                cViewerGraph1D VG1 = new cViewerGraph1D();
                VG1.SetInputData(ET);

                VG1.Chart.LabelAxisY = NameFunction;
                VG1.Chart.LabelAxisX = "Plate";
                VG1.Chart.IsZoomableX = true;
                VG1.Chart.IsBar = true;
                VG1.Chart.IsBorder = true;
                VG1.Chart.IsDisplayValues = true;
                VG1.Chart.IsShadow = true;
                VG1.Chart.MarkerSize = 4;
                VG1.Title = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();
                VG1.Run();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(VG1.GetOutPut());
                CDW.Title = NameFunction + " - " + ListPlatesToProcess.Count + " plates";
                CDW.Run();
                CDW.Display();
            }
        }
示例#25
0
        private void drawSingleDRCToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int NumberOfReplicate = 4;
            int DRCNumberofPoints = 20;

            cExtendedTable FullResults = new cExtendedTable();
            FullResults.ListRowNames = new List<string>();



            cExtendedList ListPValues = new cExtendedList("DRC");


            cDataGeneratorTitration GT = new cDataGeneratorTitration();
            GT.NumberOfPoint = DRCNumberofPoints;
            GT.Start = 100;
            GT.DilutionFactor = 3;
            GT.Run();


            Random RND = new Random();

            cExtendedTable FinalTable = new cExtendedTable();

            cDataGeneratorSigmoid DGS = null;
            DGS = new cDataGeneratorSigmoid();
            DGS.SetInputData(GT.GetOutPut()[0]);
            DGS.EC50 = 0.01;
            DGS.Bottom = 10;
            DGS.Top = 110;
            DGS.Slope = 1;
            DGS.Run();

            // cAddNoise AN = new cAddNoise();
            // AN.DistributionType = eRandDistributionType.GAUSSIAN;

            double NoiseLevel = 10;
            //   EXT[0].Add(NoiseLevel);
            //   EXT[1].Add(DGS.EC50);

            #region loop over the replicates
            for (int NumReplic = 0; NumReplic < NumberOfReplicate; NumReplic++)
            {

                cExtendedList NewL = DGS.GetOutPut()[1];
                for (int k = 0; k < NewL.Count; k++)
                {
                    NewL[k] += RND.NextDouble() * NoiseLevel;
                }

                cExtendedTable TmpTable = new cExtendedTable();
                TmpTable.Add(GT.GetOutPut()[0]);
                TmpTable.Add(NewL);

                if (NumReplic >= 1)
                {
                    cMerge M = new cMerge();
                    M.IsHorizontal = false;
                    M.SetInputData(TmpTable, FinalTable);
                    M.Run();
                    FinalTable = M.GetOutPut();
                }
                else
                    FinalTable = new cExtendedTable(TmpTable);

            }
            #endregion


            cSigmoidFitting SF = new cSigmoidFitting();
            SF.SetInputData(FinalTable);
            SF.Run();

            cGlobalInfo.ConsoleWriteLine("Slope :" + DGS.Slope + " - Evaluated:" + SF.GetOutPut()[0][3]);
            cGlobalInfo.ConsoleWriteLine("Top :" + DGS.Top + " - Evaluated:" + SF.GetOutPut()[0][1]);
            cGlobalInfo.ConsoleWriteLine("Bottom :" + DGS.Bottom + " - Evaluated:" + SF.GetOutPut()[0][0]);
            cGlobalInfo.ConsoleWriteLine("EC50 :" + DGS.EC50 + " - Evaluated:" + SF.GetOutPut()[0][2]);


            // return;


            cCurveForGraph CFG = new cCurveForGraph();
            CFG.SetInputData(FinalTable);
            CFG.Run();

            cExtendedTable Sigmoid = SF.GetFittedRawValues(GT.GetOutPut()[0]);
            FinalTable[0] = Sigmoid[1];


            cViewerGraph1D VS1 = new cViewerGraph1D();
            VS1.SetInputData(new cExtendedTable(Sigmoid[1]));
            VS1.AddCurve(CFG);
            VS1.Chart.X_AxisValues = Sigmoid[0];//DGS.GetOutPut()[0];
            VS1.Chart.IsLogAxis = true;
            VS1.Chart.IsLine = true;
            VS1.Chart.IsShadow = true;
            VS1.Chart.Opacity = 210;
            VS1.Chart.LineWidth = 3;
            VS1.Chart.LabelAxisX = "Concentration";
            VS1.Chart.LabelAxisY = "Readout";
            VS1.Chart.XAxisFormatDigitNumber = -1;
            VS1.Chart.IsZoomableX = true;
            VS1.Chart.IsZoomableY = true;
            VS1.Run();

            cDesignerSinglePanel CD = new cDesignerSinglePanel();
            CD.SetInputData(VS1.GetOutPut());
            CD.Run();

            cDisplayToWindow DTW = new cDisplayToWindow();
            DTW.SetInputData(CD.GetOutPut());//DS.GetOutPut());
            DTW.Run();
            DTW.Display();

        }
示例#26
0
        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();

        }
示例#27
0
        private void basic3DToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cViewer3D V3D = new cViewer3D();
            c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1));

            c3DTexturedPlan Plan = new c3DTexturedPlan(new cPoint3D(0, 0, 0), new cImage(256, 256, 1, 1));
            Plan.Run();
            MyWorld.AddGeometric3DObject(Plan);

            V3D.SetInputData(MyWorld);
            V3D.Run();

            cDisplayToWindow DTW = new cDisplayToWindow();
            DTW.SetInputData(V3D.GetOutPut());
            DTW.Run();
            DTW.Display();
        }
示例#28
0
        private void dRC3DToolStripMenuItem_Click(object sender, EventArgs e)
        {

            if (cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptors().Count < 3)
            {
                MessageBox.Show("At least 3 descriptors are required for this operation !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            cListExtendedTable LET = new cListExtendedTable();

            //List<cListWells> ListWells = new List<cListWells>();
            //ListWells.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells);

            // firstly, wells are grouped by class
            //foreach (var item in cGlobalInfo.ListWellClasses)
            //{
            //    List<cWellClassType> TypeForFilter = new List<cWellClassType>();
            //    TypeForFilter.Add(item);
            //    cListWells TmpListWells = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.Filter(TypeForFilter);
            //    cGeneralDRC gDRC = new cGeneralDRC(TmpListWells);
            //    LET.Add(gDRC.ListAverageValues);
            //}


            for (int i = 0; i < 3; i++)
            {
                List<int> GroupForFilter = new List<int>();
                GroupForFilter.Add(i);
                cListWells TmpListWells = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.FilterByGroup(GroupForFilter);
                cGeneralDRC gDRC = new cGeneralDRC(TmpListWells);
                LET.Add(gDRC.ListAverageValues);
            }



            cViewer3D V3D = new cViewer3D();
            c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(1, 1, 1), new cPoint3D(1, 1, 1));

            c3DObjectScatterPoints _3DScatterPt = new c3DObjectScatterPoints();
            //_3DScatterPt.SetInputData(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells.GetDescriptorValues(cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptors(), false));
            //  _3DScatterPt.GlobalInfo = this.GlobalInfo;
            _3DScatterPt.SetInputData(LET);
            // _3DScatterPt.IsLinked = true;
            _3DScatterPt.Run(MyWorld);

            cListGeometric3DObject GlobalList = _3DScatterPt.GetOutPut();

            foreach (var item in GlobalList)
            {
                MyWorld.AddGeometric3DObject(item);
            }


            MyWorld.BackGroundColor = cGlobalInfo.OptionsWindow.FFAllOptions.panelFor3DBackColor.BackColor;

            V3D.SetInputData(MyWorld);
            V3D.Run();

            cDisplayToWindow DTW = new cDisplayToWindow();
            DTW.SetInputData(V3D.GetOutPut());
            DTW.Title = "3D Dose Response Visualization";
            DTW.Run();
            DTW.Display();
        }
示例#29
0
        private void testPieChartToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cListWells LW = cGlobalInfo.CurrentScreening.GetListWells();
            cExtendedTable T = LW.GetListWellClasses();

            cViewerPie VP = new cViewerPie();
            VP.SetInputData(T);
            VP.Run();


            cDisplayToWindow DTW = new cDisplayToWindow();
            DTW.SetInputData(VP.GetOutPut());
            DTW.Run();
            DTW.Display();

            //cDisplayExtendedTable DET = new cDisplayExtendedTable();
            //DET.SetInputData(T);
            //DET.Run();
        }
示例#30
0
        private void normalProbabilityPlotToolStripMenuItem2_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;
            cExtendedTable ListClassSelected = new cExtendedTable(GUI_ListClasses.GetOutPut());// GetOutPut();

            int IdxClass = -1;
            for (int IdxC = 0; IdxC < ListClassSelected[0].Count; IdxC++)
            {
                if (ListClassSelected[0][IdxC] == 1) IdxClass = IdxC;
            }

            #region single plate and plate by plate
            cDescriptorType CurrentDesc = cGlobalInfo.CurrentScreening.ListDescriptors.GetActiveDescriptor();
            cDesignerTab DT = new cDesignerTab();
            if ((ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked) || (ProcessModeplateByPlateToolStripMenuItem.Checked)/*||(ProcessModeEntireScreeningToolStripMenuItem.Checked)*/)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                if ((ProcessModeplateByPlateToolStripMenuItem.Checked))
                {
                    foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                        ListPlatesToProcess.Add(TmpPlate);
                }
                else
                    ListPlatesToProcess.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate());

                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {
                    cListWells ListWellsToProcess1 = new cListWells(null);
                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[0][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess1.Add(item);
                        }
                    }

                    cComputeAndDisplayNormalPlot CADP = new cComputeAndDisplayNormalPlot();
                    CADP.SetInputData(ListWellsToProcess1);
                    CADP.Run();
                    cExtendedControl ControlForTab = CADP.GetOutPut();

                    ControlForTab.Title = TmpPlate.GetName();

                    DT.SetInputData(ControlForTab);
                }
                DT.Run();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(DT.GetOutPut());//VG1.GetOutPut());


                if (ProcessModeCurrentPlateOnlyToolStripMenuItem.Checked)
                    CDW.Title = "Normal Probability Plot - " + CurrentDesc.GetName() + " - " + ListPlatesToProcess[0].GetName();
                else
                    CDW.Title = "Normal Probability Plot - " + CurrentDesc.GetName() + " - " + ListPlatesToProcess.Count + " plates";

                CDW.Run();
                CDW.Display();
            }
            #endregion
            //#region entire screening
            else if (ProcessModeEntireScreeningToolStripMenuItem.Checked)
            {
                List<cPlate> ListPlatesToProcess = new List<cPlate>();
                foreach (cPlate TmpPlate in cGlobalInfo.CurrentScreening.ListPlatesActive)
                    ListPlatesToProcess.Add(TmpPlate);

                cListWells ListWellsToProcess1 = new cListWells(null);

                foreach (cPlate TmpPlate in ListPlatesToProcess)
                {

                    foreach (cWell item in TmpPlate.ListActiveWells)
                    {
                        if (item.GetCurrentClassIdx() != -1)
                        {
                            if (ListClassSelected[0][item.GetCurrentClassIdx()] == 1)
                                ListWellsToProcess1.Add(item);
                        }
                    }
                }

                cComputeAndDisplayNormalPlot CADP = new cComputeAndDisplayNormalPlot();
                CADP.SetInputData(ListWellsToProcess1);
                CADP.Run();

                cExtendedControl ControlForTab = CADP.GetOutPut();

                cDisplayToWindow CDW = new cDisplayToWindow();
                CDW.SetInputData(ControlForTab);//VG1.GetOutPut());

                CDW.Title = "Normal Probability Plot - " + CurrentDesc.GetName() + " - " + ListPlatesToProcess.Count + " plates";

                CDW.Run();
                CDW.Display();
            }


            //  ComputeAndDisplayMormalProbabilityPlot(false);
        }