internal static Bitmap QuickRender(DICOMData data, int frameNum, bool calcWL, short window, short level) { RenderAssistant assistant = new RenderAssistant(); assistant.SetSource(data); if (calcWL) { assistant.CalculateWindowLevel(frameNum); } else { assistant.Window = window; assistant.Level = level; } ushort imWidth = (ushort)data.Elements[DICOMTags.ImageWidth].Data; ushort imHeight = (ushort)data.Elements[DICOMTags.ImageHeight].Data; assistant.Resize(new Size(imWidth, imHeight)); assistant.RenderFrame(frameNum, true); return(assistant.RenderedImage); }
/// <summary> /// Create a new SimpleViewerPane with no images and default render settings (Automatic filtering). /// </summary> public SimpleViewerPane() { InitializeComponent(); MouseWheel += new MouseEventHandler(SimpleViewerPane_MouseWheel); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.DoubleBuffer, true); FilteringMode = FilteringModeType.AutoFilter; dataList = new List <DICOMData>(); assistant = new RenderAssistant(); ClearImages(); this.OnResize(null); }