Example #1
0
        static void Main(string[] args)
        {
            //TestSMC();
            BitMap3d       bmp = BitMap3d.CreateSampleForLobster();
            AdSMCProcessor smc = new AdSMCProcessor(bmp);
            Mesh           m   = smc.GenerateSurface();

            PlyManager.Output(m, "A2.ply");
            Console.WriteLine("cmp");
            Console.Read();
        }
Example #2
0
        private static void TestMC()
        {
            TestParms parm = TestParms.CreateParmsForPhantom();
            BitMap3d  bmp  = new BitMap3d(parm.image.data, parm.image.width, parm.image.height, parm.image.depth);

            for (int i = 0; i < bmp.data.Length; i++)
            {
                if (bmp.data[i] >= parm.min && bmp.data[i] <= parm.max)
                {
                    bmp.data[i] = BitMap3d.WHITE;
                }
                else
                {
                    bmp.data[i] = BitMap3d.BLACK;
                }
            }
            MCProcessor mc = new MCProcessor(bmp);
            Mesh        m  = mc.GeneratorSurface();

            PlyManager.Output(m, "test5.ply");
        }
Example #3
0
        private static void TestSMC()
        {
            TestParms parm = TestParms.CreateParmsForEngine();
            BitMap3d  bmp  = new BitMap3d(parm.image.data, parm.image.width, parm.image.height, parm.image.depth);

            for (int i = 0; i < bmp.data.Length; i++)
            {
                if (bmp.data[i] >= parm.min && bmp.data[i] <= parm.max)
                {
                    bmp.data[i] = BitMap3d.WHITE;
                }
                else
                {
                    bmp.data[i] = BitMap3d.BLACK;
                }
            }
            SMCProcessor smc = new SMCProcessor(bmp);
            Mesh         m   = smc.GenerateSurface();

            PlyManager.Output(m, @"D:\VTKproj\engine.ply");
        }
Example #4
0
        private static void Test()
        {
            BitMap3d bmp = new BitMap3d(301, 324, 56, BitMap3d.BLACK);

            bmp.ReadRaw("D://VTKproj//lobster.raw");
            for (int i = 0; i < bmp.data.Length; i++)
            {
                if (bmp.data[i] >= 37 && bmp.data[i] <= 255)
                {
                    bmp.data[i] = BitMap3d.WHITE;
                }
                else
                {
                    bmp.data[i] = BitMap3d.BLACK;
                }
            }
            MCProcessor mc = new MCProcessor(bmp);
            Mesh        m  = mc.GeneratorSurface();

            Console.WriteLine(m.Vertices.Count);
            Console.WriteLine(m.Faces.Count);
            PlyManager.Output(m, "test2.ply");
        }