/// <summary> /// Renders DICOM image to <see cref="System.Windows.Media.ImageSource"/> /// </summary> /// <param name="frame">Zero indexed frame nu,ber</param> /// <returns>Rendered image</returns> public ImageSource RenderImageSource(int frame = 0) { if (frame != _currentFrame || _pixelData == null) { Load(Dataset, frame); } var graphic = new ImageGraphic(_pixelData); if (ShowOverlays) { foreach (var overlay in _overlays) { if ((frame + 1) < overlay.OriginFrame || (frame + 1) > (overlay.OriginFrame + overlay.NumberOfFrames - 1)) { continue; } var og = new OverlayGraphic(PixelDataFactory.Create(overlay), overlay.OriginX - 1, overlay.OriginY - 1, OverlayColor); graphic.AddOverlay(og); } } return(graphic.RenderImageSource(_pipeline.LUT)); }
public ImageSource RenderImageSource() { ImageGraphic graphic = new ImageGraphic(_pixelData); foreach (var overlay in _overlays) { OverlayGraphic og = new OverlayGraphic(PixelDataFactory.Create(overlay), overlay.OriginX, overlay.OriginY, OverlayColor); graphic.AddOverlay(og); } return graphic.RenderImageSource(_pipeline.LUT); }
/// <summary> /// Renders DICOM image to <see cref="System.Windows.Media.ImageSource"/> /// </summary> /// <param name="frame">Zero indexed frame nu,ber</param> /// <returns>Rendered image</returns> public ImageSource RenderImageSource(int frame = 0) { if (frame != _currentFrame || _pixelData == null) { Load(Dataset, frame); } ImageGraphic graphic = new ImageGraphic(_pixelData); foreach (var overlay in _overlays) { // DICOM overlay origin begins at (1,1) OverlayGraphic og = new OverlayGraphic(PixelDataFactory.Create(overlay), overlay.OriginX - 1, overlay.OriginY - 1, OverlayColor); graphic.AddOverlay(og); } return(graphic.RenderImageSource(_pipeline.LUT)); }
public ImageSource RenderImageSource() { ImageGraphic graphic = new ImageGraphic(_pixelData); return(graphic.RenderImageSource(_pipeline.LUT)); }