Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
		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);
		}
Ejemplo n.º 3
0
        /// <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));
        }
Ejemplo n.º 4
0
        public ImageSource RenderImageSource()
        {
            ImageGraphic graphic = new ImageGraphic(_pixelData);

            return(graphic.RenderImageSource(_pipeline.LUT));
        }