Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //BitMap3d bmp = ImageReader.ReadSegImage(@"D:\Uproj\WI_3093_P_iso.seg");
            //BitMap3d nbmp = ImageReader.GetLayers(bmp, 70, 99);
            //nbmp.SaveRaw(@"D:\Uproj\WI_3093_P_iso70.99.raw");
            BitMap3d bmp = new BitMap3d(512, 512, 30, 0);

            bmp.ReadRaw(@"D:\Uproj\WI_3093_P_iso70.99.raw");
            //ImageReader.ProcessImage(bmp);
            ConcreteMCP mc = new ConcreteMCP(bmp);

            mc.SetThreshold(180.5f);
            Mesh m = mc.GenerateSurface();

            PlyManager.Output(m, @"D:\Uproj\WI_3093_P_iso70.99.180.5r.ply");
        }
Ejemplo n.º 2
0
        public static BitMap3d CreateSampleTedX4()
        {
            BitMap3d image = new BitMap3d(400, 400, 400, BitMap3d.BLACK);

            image.ReadRaw(@"D:\VTKproj\TreeRaw\Ted_400.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] > 128)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            return(image);
        }
Ejemplo n.º 3
0
        public static BitMap3d CreateSampleForProneX1()
        {
            BitMap3d image = new BitMap3d(512, 512, 463, BitMap3d.BLACK);

            image.ReadRaw(@"D:\VTKproj\TreeRaw\prone8_512_512_463.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 88 && data[i] <= 255)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            ClearBoundary(image);
            return(image);
        }
Ejemplo n.º 4
0
        public static BitMap3d CreateSampleForMRIX2()
        {
            BitMap3d image = new BitMap3d(512, 512, 248, BitMap3d.BLACK);

            image.ReadRaw(@"D:\VTKproj\TreeRaw\mri_ventricles_512_512_248.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 84 && data[i] <= 255)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            ClearBoundary(image);
            return(image);
        }
Ejemplo n.º 5
0
        public static BitMap3d CreateSampleForSkullX1()
        {
            BitMap3d image = new BitMap3d(256, 256, 256, BitMap3d.BLACK);

            image.ReadRaw(@"D:\VTKproj\TreeRaw\skull_256_256_256.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 43 && data[i] <= 255)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            ClearBoundary(image);
            return(image);
        }
Ejemplo n.º 6
0
        public static BitMap3d CreateSampleForTeapotX2()
        {
            BitMap3d image = new BitMap3d(512, 512, 356, BitMap3d.BLACK);

            image.ReadRaw(@"D:\VTKproj\TreeRaw\BostonTeapot_512_512_356.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 24 && data[i] <= 255)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            ClearBoundary(image);
            return(image);
        }
Ejemplo n.º 7
0
        public static BitMap3d CreateSampleForTableX4()
        {
            BitMap3d image = new BitMap3d(788, 280, 406, BitMap3d.BLACK);

            image.ReadRaw(@"D:\VTKproj\TreeRaw\table_788_280_406.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 37 && data[i] <= 255)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            ClearBoundary(image);
            return(image);
        }
Ejemplo n.º 8
0
        public static BitMap3d CreateSampleForLobsterX2()
        {
            BitMap3d image = new BitMap3d(602, 648, 112, BitMap3d.BLACK);

            image.ReadRaw(@"D:\VTKproj\TreeRaw\lobster_602_648_112.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 37 && data[i] <= 255)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            ClearBoundary(image);
            return(image);
        }
Ejemplo n.º 9
0
        public static BitMap3d CreateSampleForFanX4()
        {
            BitMap3d image = new BitMap3d(400, 400, 400, BitMap3d.BLACK);

            image.ReadRaw("D://VTKproj//TreeRaw//marschnerlobb_400_400_400.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 89 && data[i] <= 255)
                {
                    data[i] = BitMap3d.BLACK;
                }
                else
                {
                    data[i] = BitMap3d.WHITE;
                }
            }
            ClearBoundary(image);
            return(image);
        }
Ejemplo n.º 10
0
        public static BitMap3d CreateSampleEngineX4()
        {
            BitMap3d image;

            image = new BitMap3d(1024, 1024, 512, BitMap3d.BLACK);
            image.ReadRaw("D://VTKproj//TreeRaw//engine_1024_1024_512.raw");
            byte[] data = image.data;
            for (int i = 0; i < data.Length; i++)
            {
                if (data[i] >= 64 && data[i] <= 255)
                {
                    data[i] = BitMap3d.WHITE;
                }
                else
                {
                    data[i] = BitMap3d.BLACK;
                }
            }
            ClearBoundary(image);
            return(image);
        }