Пример #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();
        }
Пример #4
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();
        }
Пример #5
0
        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();
        }
Пример #6
0
        private void chart_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            HitTestResult Res = this.chart.HitTest(e.X, e.Y, ChartElementType.DataPoint);
            if (Res.Series == null) return;

            DataPoint PtToTransfer = Res.Series.Points[Res.PointIndex];
            cExtendedList CurrentList = new cExtendedList();
            CurrentList.Name = Res.Series.Name;

            foreach (var item in Res.Series.Points)
            {
                CurrentList.Add(item.YValues[0]);
            }

            cExtendedTable CT = new cExtendedTable(CurrentList);
            CT.ListRowNames = new List<string>();
            //foreach (var item in Res.Series.Points)
            //{
            //}

            cViewerTable MyTable = new cViewerTable();
            MyTable.SetInputData(CT);
            MyTable.Run();

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

            cDisplayToWindow MyDisplay = new cDisplayToWindow();
            MyDisplay.SetInputData(MyDesigner.GetOutPut());
            MyDisplay.Run();
            MyDisplay.Display();
        }
Пример #7
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;
        }
Пример #8
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();

        }
Пример #9
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();
        }
Пример #10
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;
        }
Пример #11
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();

        }
Пример #12
0
        private void ToolStripMenuItem_DisplayAs2DScatterPoints(object sender, EventArgs e)
        {
            cListWells ListWellsToProcess = new cListWells(null);

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

            cExtendedTable DataFromPlate = new cExtendedTable(ListWellsToProcess, true);
            DataFromPlate.Name = this.Name;

            cViewer2DScatterPoint V1D = new cViewer2DScatterPoint();
            V1D.Chart.IsSelectable = true;
            V1D.Chart.IsShadow = true;
            V1D.Chart.IsBorder = true;
            V1D.Chart.IsSelectable = true;
            V1D.Chart.CurrentTitle.Tag = this;
            V1D.SetInputData(DataFromPlate);
            cFeedBackMessage 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();
        }
Пример #13
0
        private void ToolStripMenuItem_DisplayElevationMaps(object sender, EventArgs e)
        {
            //cListExtendedTable LTable = new cListExtendedTable(this.AssociatedImage);

            //cExtendedTable Table = new cExtendedTable(.SingleChannelImage[0],0);

            cViewerElevationMap3D VE = new cViewerElevationMap3D();
            VE.SetInputData(this.AssociatedImage);

            // UserControlSingleLUT SingleLUT = (UserControlSingleLUT)this.LUTManager.panelForLUTS.Controls[0];
            // VE.LUT = SingleLUT.SelectedLUT;

            if (VE.Run().IsSucceed == false) return;

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

            cDisplayToWindow CDW = new cDisplayToWindow();
            CDW.SetInputData(CD.GetOutPut());
            CDW.Title = "Elevation Map [" + this.AssociatedImage.Name + "]";
            if (CDW.Run().IsSucceed == false) return;
            CDW.Display();
        }
Пример #14
0
        private void ToolStripMenuItem_Display2DScatterGraph(object sender, EventArgs e)
        {
            cViewer2DScatterPoint V2DSG = new cViewer2DScatterPoint();
            V2DSG.SetInputData(this.Input);
            V2DSG.Run();

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

            cDisplayToWindow DW = new cDisplayToWindow();
            DW.SetInputData(CD.GetOutPut());
            DW.Run();
            DW.Display();
        }
Пример #15
0
        private void DisplayHeatMap(object sender, EventArgs e)
        {
            cViewerHeatMap VHM = new cViewerHeatMap();
            VHM.SetInputData(this.Input);
            VHM.Run();

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

            cDisplayToWindow DW = new cDisplayToWindow();
            DW.SetInputData(CD.GetOutPut());
            DW.Run();
            DW.Display();
        }
Пример #16
0
        private void DisplayElevationMap(object sender, EventArgs e)
        {
            cViewerElevationMap3D VE = new cViewerElevationMap3D();
            VE.SetInputData(new cListExtendedTable(this.Input));
            if (VE.Run().IsSucceed == false) return;

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

            cDisplayToWindow CDW = new cDisplayToWindow();
            CDW.SetInputData(CD.GetOutPut());
            CDW.Title = this.Title + ": Elevation Map";
            if (CDW.Run().IsSucceed == false) return;
            CDW.Display();
        }
Пример #17
0
        private void panelForPlate_MouseDown(object sender, MouseEventArgs e)
        {
            if (cGlobalInfo.CurrentScreening == null) return;

            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                cGlobalInfo.CurrentScreening.ClientPosFirst.X = e.X;
                cGlobalInfo.CurrentScreening.ClientPosFirst.Y = e.Y;

                //     if (GlobalInfo.WindowForDRCDesign.Visible) return;
                Point locationOnForm = this.panelForPlate.FindForm().PointToClient(Control.MousePosition);
                // int VertPos = locationOnForm.Y - 163;
                // Make a note that we "have the mouse".
                bHaveMouse = true;

                // Store the "starting point" for this rubber-band rectangle.
                cGlobalInfo.CurrentScreening.ptOriginal.X = locationOnForm.X;// e.X + this.panelForPlate.Location.X/* + 10*/;
                cGlobalInfo.CurrentScreening.ptOriginal.Y = locationOnForm.Y;// e.Y + this.panelForPlate.Location.Y/* + 76*/;
                // Special value lets us know that no previous
                // rectangle needs to be erased.
                cGlobalInfo.CurrentScreening.ptLast.X = -1;
                cGlobalInfo.CurrentScreening.ptLast.Y = -1;
            }
            else if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                int ScrollShiftY = this.panelForPlate.VerticalScroll.Value;
                int ScrollShiftX = this.panelForPlate.HorizontalScroll.Value;
                int Gutter = (int)cGlobalInfo.OptionsWindow.FFAllOptions.numericUpDownGutter.Value;

                int PosX = (int)((e.X - ScrollShiftX) / (cGlobalInfo.SizeHistoWidth + Gutter));
                int PosY = (int)((e.Y - ScrollShiftY) / (cGlobalInfo.SizeHistoHeight + Gutter));

                bool OnlyOnSelected = false;

                cExtendedList cExL = new cExtendedList();
                List<string> Names = new List<string>();
                string CurrentName = "";

                #region Display plate heat map
                if ((PosX == 0) && (PosY == 0))
                {
                    cListWells ListWellsToProcess = new cListWells(null);
                    foreach (cWell item in cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().ListActiveWells)
                        if (item.GetCurrentClassIdx() != -1) ListWellsToProcess.Add(item);

                    cDesignerTab DT = new cDesignerTab();

                    for (int IdxDesc = 0; IdxDesc < cGlobalInfo.CurrentScreening.ListDescriptors.Count; IdxDesc++)
                    {
                        if (!cGlobalInfo.CurrentScreening.ListDescriptors[IdxDesc].IsActive()) continue;

                        bool IsMissing;

                        cExtendedTable NewTable = null;
                        if (!checkBoxDisplayClasses.Checked)
                            NewTable = new cExtendedTable(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetAverageValueDescTable(IdxDesc, out IsMissing));
                        else
                            NewTable = new cExtendedTable(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetWellClassesTable());

                        foreach (var item in NewTable)
                            item.ListTags = new List<object>();

                        for (int i = 0; i < cGlobalInfo.CurrentScreening.Columns; i++)
                            for (int j = 0; j < cGlobalInfo.CurrentScreening.Rows; j++)
                            {
                                cWell currentWell = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetWell(i, cGlobalInfo.CurrentScreening.Rows - j - 1, true);
                                NewTable[i].ListTags.Add(currentWell);
                            }

                        for (int IdxCol = 0; IdxCol < NewTable.Count; IdxCol++)
                            NewTable[IdxCol].Name = "Column " + (IdxCol + 1);

                        List<string> ListRow = new List<string>();
                        for (int IdxRow = 0; IdxRow < NewTable[0].Count; IdxRow++)
                            ListRow.Add("Row " + (NewTable[0].Count - IdxRow));

                        NewTable.ListRowNames = ListRow;
                        if (!checkBoxDisplayClasses.Checked)
                            NewTable.Name = cGlobalInfo.CurrentScreening.ListDescriptors[IdxDesc].GetName() + " (" + ListWellsToProcess.Count + " wells)";
                        else
                            NewTable.Name = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName() + " - Well Associated Classes (" + ListWellsToProcess.Count + " wells)";

                        cViewerHeatMap VHM = new cViewerHeatMap();
                        VHM.SetInputData(NewTable);
                        VHM.GlobalInfo = GlobalInfo;
                        VHM.IsDisplayValues = false;
                        if (!checkBoxDisplayClasses.Checked)
                            VHM.Title = cGlobalInfo.CurrentScreening.ListDescriptors[IdxDesc].GetName() + " (" + ListWellsToProcess.Count + " wells)";
                        else
                        {
                            //VHM.ChartToBeIncluded
                            VHM.CurrentLUT = cGlobalInfo.ListWellClasses.BuildLUT();
                            VHM.IsAutomatedMinMax = false;
                            VHM.Min = 0;
                            VHM.Max = cGlobalInfo.ListWellClasses.Count - 1;
                            VHM.IsWellClassLegend = true;
                            VHM.Title = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetName() + " - Well Associated Classes (" + ListWellsToProcess.Count + " wells)";
                        }
                        VHM.Run();

                        DT.SetInputData(VHM.GetOutPut());

                        if (checkBoxDisplayClasses.Checked) break;

                    }

                    DT.Run();

                    cDisplayToWindow DWForPlate = new cDisplayToWindow();
                    DWForPlate.SetInputData(DT.GetOutPut());
                    DWForPlate.Run();
                    DWForPlate.Display();
                    return;
                }
                #endregion
                #region Display column or row graphs
                else if ((PosX == 0) && (PosY > 0))
                {
                    cExL.ListTags = new List<object>();
                    for (int col = 0; col < cGlobalInfo.CurrentScreening.Columns; col++)
                    {
                        cPlate CurrentPlateToProcess = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate();
                        cWell TmpWell = CurrentPlateToProcess.GetWell(col, PosY - 1, OnlyOnSelected);
                        if (TmpWell == null) continue;
                        cExL.ListTags.Add(TmpWell);
                        cExL.Add(TmpWell.ListSignatures[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetValue());
                        Names.Add("Column " + col);
                    }
                    CurrentName = "Row " + PosY;
                }
                else if ((PosY == 0) && (PosX > 0))
                {
                    cExL.ListTags = new List<object>();
                    for (int row = 0; row < cGlobalInfo.CurrentScreening.Rows; row++)
                    {
                        cPlate CurrentPlateToProcess = cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate();
                        cWell TmpWell = CurrentPlateToProcess.GetWell(PosX - 1, row, OnlyOnSelected);
                        if (TmpWell == null) continue;
                        cExL.ListTags.Add(TmpWell);

                        cExL.Add(TmpWell.ListSignatures[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetValue());
                        Names.Add("Row " + row);
                    }
                    CurrentName = "Column " + PosX;
                }
                #endregion
                else
                {
                    ContextMenuStrip NewMenu = new ContextMenuStrip();
                    NewMenu.Items.Add(cGlobalInfo.CurrentScreening.GetExtendedContextMenu());
                    NewMenu.Items.Add(cGlobalInfo.CurrentScreening.GetCurrentDisplayPlate().GetExtendedContextMenu());
                    NewMenu.Show(Control.MousePosition);
                    return;
                }

                cExtendedTable cExT = new cExtendedTable(cExL);
                cExT.ListRowNames = Names;

                cExT.Name = CurrentName;
                cExT[0].Name = CurrentName;

                cViewerGraph1D CV = new cViewerGraph1D();
                CV.Chart.IsSelectable = true;
                CV.Chart.LabelAxisX = "Well Index";
                CV.Chart.LabelAxisY = cGlobalInfo.CurrentScreening.ListDescriptors[cGlobalInfo.CurrentScreening.ListDescriptors.CurrentSelectedDescriptorIdx].GetName();
                //V1D.Chart.BackgroundColor = Color.LightYellow;
                CV.Chart.IsXGrid = true;
                CV.Chart.IsLine = true;
                CV.SetInputData(cExT);

                cFeedBackMessage Mess = CV.Run();
                if (!Mess.IsSucceed)
                {
                    MessageBox.Show(Mess.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                //cViewerGraph CV = new cViewerGraph();
                //CV.SetInputData(cExT);
                //CV.Run();

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

                cDisplayToWindow DW = new cDisplayToWindow();
                DW.SetInputData(CD.GetOutPut());
                DW.Run();
                DW.Display();
                // CV.Display();
            }
        }
Пример #18
0
        private void DisplayGraph(object sender, EventArgs e)
        {
            cViewerGraph1D VG = new cViewerGraph1D();
            VG.Chart.IsLine = true;
            VG.Chart.IsSelectable = false;
            VG.Chart.IsZoomableX = true;
            VG.Chart.IsLegend = true;

            cExtendedTable CET = new cExtendedTable();
            CET.Name = Input.Name;
            CET.ListRowNames = new List<string>();

            foreach (DataGridViewColumn item in GridView.SelectedColumns)
                CET.Add(Input[item.Index]);

            foreach (var item in this.Input.ListRowNames)
                CET.ListRowNames.Add(item);

            if (this.Input.ListTags != null)
            {
                CET.ListTags = new List<object>();
                for (int i = 0; i < GridView.SelectedColumns.Count; i++)
                    CET[i].ListTags = new List<object>();
            }

            if(this.Input.ListTags!=null)
            foreach (var item in this.Input.ListTags)
            {
                CET.ListTags.Add(item);
            }

            //for (int i = 0; i < GridView.SelectedColumns.Count; i++)
            {
                //if (this.Input[i].ListTags != null)
                //{
                //    int NumTags= this.Input[i].ListTags.Count;
                //    for (int Idx = 0; Idx < NumTags; Idx++)
                //    {
                //        CET[i].ListTags.Add(this.Input[i].ListTags[Idx]);
                //    }
                //}
                    //foreach (var item in this.Input[i].ListTags)
                    //CET[i].ListTags.Add(item);
            }

            VG.SetInputData(CET);
            VG.Run();

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

            cDisplayToWindow DW = new cDisplayToWindow();
            DW.Title = CET.Name + " - Graph Viewer";
            DW.SetInputData(CD.GetOutPut());
            DW.Run();
            DW.Display();
        }