Ejemplo n.º 1
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            Image3D image;

            //string testPath = @"MANIX\CER-CT\ANGIO CT";
            //string testPath = @"BRAINIX\SOUS - 702";
            //string testPath = @"BRAINIX\T2W-FE-EPI - 501";
            string testPath = @"vtkBrain";

            double min, max;
            using (var reader = new DicomReader(TestData.GetPath(testPath)))
            {
                image = reader.ReadImage3D();

                min = reader.MinValue;
                max = reader.MaxValue;
            }

            display = new DisplayImage(image.LengthX, image.LengthY);

            var tf = new TransferFunction1D();
            tf.Add(0, Color.Black);
            tf.Add(max * 0.2, Color.Blue);
            tf.Add(max * 0.6, Color.Red);
            tf.Add(max, Color.Yellow);

            renderer = new TransferFunctionRenderer(image, display, tf);

            scrollBarSlice.Maximum = image.LengthZ - 1;
            pictureBoxDisplay.Image = display.GetBitmap();

            Render();
        }
Ejemplo n.º 2
0
        public TransferFunction1D CreateTransferFunction()
        {
            var tf = new TransferFunction1D();

            var sortedItems = from i in Items orderby i.Value select i;

            foreach (var item in sortedItems)
            {
                tf.Add(item.Value, item.Color);
            }

            return tf;
        }