Ejemplo n.º 1
0
        private void ToolStripMenuItem_3DTest(object sender, EventArgs e)
        {
            Plugin3D NewPlug = new Plugin3D(this.AssociatedImage);
            NewPlug.Show();

            return;

            c3DNewWorld MyWorld = new c3DNewWorld(new cPoint3D(this.AssociatedImage.Width, this.AssociatedImage.Height, this.AssociatedImage.Depth),
                                                    new cPoint3D(1, 1, 1));

            cVolumeDetection Detection = new cVolumeDetection(this.AssociatedImage, 2, false);
            Detection.SetShift(new cPoint3D(0, 0, 0));
            Detection.SetContainers(null);

            List<cInteractive3DObject> AssociatedBiologicalObjectList = Detection.IntensityThreshold(150f,
                                         10,
                                         float.MaxValue);

            for (int i = 0; i < AssociatedBiologicalObjectList.Count; i++)
            {
                cBiological3DVolume TmpVol = (cBiological3DVolume)AssociatedBiologicalObjectList[i];

                // MyWorld.AddGeometric3DObject(TmpVol.AttachText("Object " + i, 5, Color.White));

                //    //if (Obj.checkIsBoxPointingArrow.Checked)
                cGeometric3DObject AssociatedArrow = TmpVol.AttachPointingArrow(5f, Color.Tomato);
                MyWorld.AddGeometric3DObject(AssociatedArrow);

                AssociatedBiologicalObjectList[i].SetOpacity(/*(double)Obj.ColorOpacity.numericUpDownValue.Value*/0.5);
                AssociatedBiologicalObjectList[i].Colour = Color.Red;

                MyWorld.AddBiological3DObject(AssociatedBiologicalObjectList[i]);

            }

            MyWorld.AddVolume3D(new cVolumeRendering3D(this.AssociatedImage.SingleChannelImage[0], new cPoint3D(0, 0, 0), null, MyWorld));

            MyWorld.BackGroundColor = Color.LightGray;// GhostWhite;

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

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