Ejemplo n.º 1
0
        private static IEnumerable <Meta> Meta(Stream str)
        {
            var d = new DicomDecoder();

            d.Init(str);
            return(d.GetMeta());
        }
Ejemplo n.º 2
0
        public static Task <Stream> Render(Stream dicomStream, out IEnumerable <Meta> meta)
        {
            var decoder = new DicomDecoder();

            decoder.Init(dicomStream);
            var stream = new MemoryStream();

            decoder.CreateImage16().Save(stream, ImageFormat.Png);
            stream.Position = 0;
            meta            = decoder.GetMeta();
            return(Task.FromResult <Stream>(stream));
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var decoder = new DicomDecoder();

            decoder.Init(File.OpenRead(@"C:\Users\Reality_Shift\Desktop\0.dcm"));
            decoder.dicomInfo.
            Zip(decoder.GetMeta(), (f, second) => $">>{f}<< >>{second}<<")
            .ToList()
            .ForEach(Console.WriteLine);
            var bmp = decoder.CreateImage16();

            try
            {
                bmp.Save("lol.png", ImageFormat.Png);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
            Console.ReadKey();
        }