Exemplo n.º 1
0
 protected override void OnRenderPixel(Image3D image, DisplayImage display, int x, int y)
 {
     if (MarkerX == x || MarkerY == y)
     {
         display.SetPixel(x, y, Colors.Orange);
     }
 }
Exemplo n.º 2
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();
        }
Exemplo n.º 3
0
        protected override Image3D OnProcess(Image3D image, Progress progress)
        {
            OnValidate(image);
            Size size = OnDetermineDisplaySize(image);
            int w = (int)Math.Round(size.Width);
            int h = (int)Math.Round(size.Height);

            displayImage = Display.GetDisplay(w, h);
            var result = base.OnProcess(image, progress);
            return result;
        }
Exemplo n.º 4
0
        public ControlTransferFunction1D()
        {
            InitializeComponent();

            displayImage = new DisplayImage(500, 100);
            imageTfBackground.Source = displayImage.GetBitmap();

            DataContextChanged += OnDataContextChanged;
            DataContext = TransferFunction1DBuilder.CreateTestBuilder();

            Loaded += OnLoaded;
        }
Exemplo n.º 5
0
        public DisplayImage GetDisplay(int width, int height)
        {
            if (display == null || display.Width != width || display.Height != height)
            {
                Dispatcher.Invoke(
                    () =>
                    {
                        display = new DisplayImage(width, height);
                        image.Source = display.GetBitmap();
                    }
                );
            }

            return display;
        }
Exemplo n.º 6
0
 protected abstract void OnRenderPixel(Image3D image, DisplayImage display, int x, int y);