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(); }
public ControlTransferFunction1D() { InitializeComponent(); displayImage = new DisplayImage(500, 100); imageTfBackground.Source = displayImage.GetBitmap(); DataContextChanged += OnDataContextChanged; DataContext = TransferFunction1DBuilder.CreateTestBuilder(); Loaded += OnLoaded; }
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; }