Beispiel #1
0
        public static BitMap3d CreateSampleForLobsterX2()
        {
            BitMap3d image = new BitMap3d(602, 648, 112, BitMap3d.BLACK);

            image.ReadRaw("D://VTKproj//lobsterx2.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;
                }
            }
            for (int k = 0; k < image.depth; k++)
            {
                for (int j = 0; j < image.height; j++)
                {
                    for (int i = 0; i < image.width; i++)
                    {
                        int index = k * image.width * image.height + j * image.width + i;
                        if (i == 0 || i == image.width - 1 || j == 0 || j == image.height - 1 || k == 0 || k == image.depth - 1)
                        {
                            data[index] = BitMap3d.BLACK;
                        }
                    }
                }
            }
            return(image);
        }
Beispiel #2
0
        public static BitMap3d CreateSampleTedVolume(int is400_300_200_100)
        {
            BitMap3d image = new BitMap3d(is400_300_200_100, is400_300_200_100, is400_300_200_100, BitMap3d.BLACK);

            image.ReadRaw(string.Format("D://VTKproj//Ted_{0}.raw", is400_300_200_100));
            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);
        }
Beispiel #3
0
        public static BitMap3d CreateSampleEngineVolume(string x2)
        {
            BitMap3d image;

            if (x2 == "")
            {
                image = new BitMap3d(256, 256, 128, BitMap3d.BLACK);
                image.ReadRaw("D://VTKproj//engine.raw");
            }
            else
            {
                image = new BitMap3d(512, 512, 256, BitMap3d.BLACK);
                image.ReadRaw("D://VTKproj//enginex2.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;
                }
            }
            for (int k = 0; k < image.depth; k++)
            {
                for (int j = 0; j < image.height; j++)
                {
                    for (int i = 0; i < image.width; i++)
                    {
                        int index = k * image.width * image.height + j * image.width + i;
                        if (i == 0 || i == image.width - 1 || j == 0 || j == image.height - 1 || k == 0 || k == image.depth - 1)
                        {
                            data[index] = BitMap3d.BLACK;
                        }
                    }
                }
            }
            return(image);
        }