コード例 #1
0
 private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
 {
     if (e.PresentationImage.Selected)
     {
         UpdateDeleteAllVisible();
     }
 }
コード例 #2
0
 private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
 {
     if (e.PresentationImage == base.SelectedPresentationImage)
     {
         UpdateVisible();
     }
 }
コード例 #3
0
 private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
 {
     if (e.PresentationImage.Selected)
     {
         UpdateEnabled(e.PresentationImage);
     }
 }
コード例 #4
0
        private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
        {
            if (_fusionDisplaySets.Count == 0)
            {
                return;
            }

            if (!(e.PresentationImage is FusionPresentationImage))
            {
                if (e.PresentationImage is IImageSopProvider && e.PresentationImage is IVoiLutProvider)
                {
                    // only synchronize the VOI LUTs if the source LUT is linear - otherwise, leave it alone
                    var sourceVoiLut = ((IVoiLutProvider)e.PresentationImage).VoiLutManager.VoiLut as IVoiLutLinear;
                    if (sourceVoiLut == null)
                    {
                        return;
                    }

                    // find any available display set containing the same series as the individual layers and capture its VOI LUT
                    var seriesInstanceUid = ((IImageSopProvider)e.PresentationImage).ImageSop.SeriesInstanceUid;
                    foreach (IDisplaySet displaySet in _fusionDisplaySets)
                    {
                        var anyVisibleChange = false;

                        var descriptor = (PETFusionDisplaySetDescriptor)displaySet.Descriptor;
                        if (descriptor.SourceSeries.SeriesInstanceUid == seriesInstanceUid)
                        {
                            // replicate the captured VOI LUT to the fusion images
                            foreach (FusionPresentationImage image in displaySet.PresentationImages)
                            {
                                InstallVoiLut(image, sourceVoiLut, ((IImageSopProvider)e.PresentationImage).Frame, false);
                                anyVisibleChange |= (image.Visible);
                            }
                        }
                        else if (descriptor.PETSeries.SeriesInstanceUid == seriesInstanceUid)
                        {
                            // replicate the captured VOI LUT to the fusion images
                            foreach (FusionPresentationImage image in displaySet.PresentationImages)
                            {
                                InstallVoiLut(image, sourceVoiLut, ((IImageSopProvider)e.PresentationImage).Frame, true);
                                anyVisibleChange |= (image.Visible);
                            }
                        }

                        // force a draw only if we replicated the VOI LUT to a visible image somewhere
                        if (anyVisibleChange)
                        {
                            if (_synchronizationContext != null)
                            {
                                _synchronizationContext.Post(s => ((IDisplaySet)s).Draw(), displaySet);
                            }
                            else
                            {
                                displaySet.Draw();
                            }
                        }
                    }
                }
            }
        }
コード例 #5
0
ファイル: ReferenceLineTool.cs プロジェクト: bangush/server-1
 private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
 {
     //make the reference lines on any image invisible when the tool is not active.
     if (!Active)
     {
         RefreshReferenceLines(e.PresentationImage);
     }
 }
コード例 #6
0
 private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
 {
     //make the reference lines on any image invisible when the tool is not active.
     try
     {
         if (!Active)
         {
             RefreshReferenceLines(e.PresentationImage);
         }
     }
     catch (Exception ex)
     {
         Platform.Log(LogLevel.Error, ex.ToString());
     }
 }
コード例 #7
0
        private void OnDrawImage(object sender, ImageDrawingEventArgs e)
        {
            try
            {
                _renderer.Draw(null, e);

                // When we call IRenderer.Draw, the normal (non-custom) meaning
                // is that we're drawing to a memory buffer.  IRenderer.Paint
                // "flips" the buffer to the screen.  So, we need to invalidate here
                // so that OnPaint can call IRenderer.Paint

                // If the image box layout has changed, invalidate the
                // entire window; otherwise, just invalidate the tile
                Rectangle area = Rectangle.Empty;
                if (e.ImageBoxLayoutChanged)
                {
                    area = _physicalWorkspace.ClientRectangle;
                }
                else if (e.TileLayoutChanged)
                {
                    area = e.ImageBox.DrawableClientRectangle;
                }
                else
                {
                    area = Rectangle.Inflate(e.ImageBox.DrawableClientRectangle, 1, 1);
                }

                // decide whether to redraw immediately, or simply queue a redraw
                Gdk.Rectangle grect = new Gdk.Rectangle(area.X, area.Y, area.Width, area.Height);
                this.GdkWindow.InvalidateRect(grect, false);

                if (e.PaintNow)
                {
                    this.GdkWindow.ProcessUpdates(false);
                }
            }
            catch (Exception x)
            {
                Platform.Log(x);
            }
        }
コード例 #8
0
 private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
 {
     if (e.PresentationImage != null)
     {
         IOverlayGraphicsProvider graphicsProvider = e.PresentationImage as IOverlayGraphicsProvider;
         if (graphicsProvider != null && graphicsProvider.OverlayGraphics != null)
         {
             AimSettings aimSettings = AimSettings.Default;
             foreach (IGraphic overlayGraphic in graphicsProvider.OverlayGraphics)
             {
                 if (overlayGraphic is AimGraphic)
                 {
                     AimGraphic aimGraphic = (AimGraphic)overlayGraphic;
                     string     userName   = aimGraphic.UserLoginName;
                     aimGraphic.Visible = !_displayMarkupPerUser.ContainsKey(userName) || _displayMarkupPerUser[userName];
                     aimGraphic.Color   = aimSettings.GetAimGraphicColorForUser(userName);
                 }
             }
         }
     }
 }
コード例 #9
0
        private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
        {
            if (_fusionDisplaySets.Count == 0)
            {
                return;
            }

            if ((e.PresentationImage is FusionPresentationImage))
            {
                return;
            }

            if (!(e.PresentationImage is IImageSopProvider) || !(e.PresentationImage is IVoiLutProvider))
            {
                return;
            }

            // only synchronize the VOI LUTs if the source LUT is linear - otherwise, leave it alone
            var sourceVoiLut = ((IVoiLutProvider)e.PresentationImage).VoiLutManager.VoiLut as IVoiLutLinear;

            if (sourceVoiLut == null)
            {
                return;
            }

            if (Equals(_previousWindowCenter, sourceVoiLut.WindowCenter) &&
                Equals(_previousWindowWidth, sourceVoiLut.WindowWidth))
            {
                return;
            }

            _previousWindowCenter = sourceVoiLut.WindowCenter;
            _previousWindowWidth  = sourceVoiLut.WindowWidth;

            _publisher.Publish(e.PresentationImage, EventArgs.Empty);
        }
コード例 #10
0
		private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
		{
			//make the reference lines on any image invisible when the tool is not active.
			if (!Active)
				RefreshReferenceLines(e.PresentationImage);
		}
コード例 #11
0
		private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
		{
			if (e.PresentationImage == base.SelectedPresentationImage)
				UpdateVisible();
		}
コード例 #12
0
		private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
		{
			if (_fusionDisplaySets.Count == 0)
				return;

			if ((e.PresentationImage is FusionPresentationImage))
				return;

			if (!(e.PresentationImage is IImageSopProvider) || !(e.PresentationImage is IVoiLutProvider))
				return;

			// only synchronize the VOI LUTs if the source LUT is linear - otherwise, leave it alone
			var sourceVoiLut = ((IVoiLutProvider) e.PresentationImage).VoiLutManager.VoiLut as IVoiLutLinear;
			if (sourceVoiLut == null)
				return;

			if (Equals(_previousWindowCenter, sourceVoiLut.WindowCenter) &&
				Equals(_previousWindowWidth, sourceVoiLut.WindowWidth))
				return;

			_previousWindowCenter = sourceVoiLut.WindowCenter;
			_previousWindowWidth = sourceVoiLut.WindowWidth;

			_publisher.Publish(e.PresentationImage, EventArgs.Empty);
		}
コード例 #13
0
		private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
			{
			if (e.PresentationImage.Selected)
				UpdateEnabled(e.PresentationImage);
		}
コード例 #14
0
        private void OnDrawImage(object sender, ImageDrawingEventArgs e)
        {

            try
            {
                _renderer.Draw(null, e);

                // When we call IRenderer.Draw, the normal (non-custom) meaning
                // is that we're drawing to a memory buffer.  IRenderer.Paint
                // "flips" the buffer to the screen.  So, we need to invalidate here
                // so that OnPaint can call IRenderer.Paint

                // If the image box layout has changed, invalidate the
                // entire window; otherwise, just invalidate the tile
                Rectangle area = Rectangle.Empty;
                if (e.ImageBoxLayoutChanged)
                {
                    area = _physicalWorkspace.ClientRectangle;
                }
                else if (e.TileLayoutChanged)
                {

                    area = e.ImageBox.DrawableClientRectangle;
                }
                else
                {
                    area = Rectangle.Inflate(e.ImageBox.DrawableClientRectangle, 1, 1);
                }

                // decide whether to redraw immediately, or simply queue a redraw
				Gdk.Rectangle grect = new Gdk.Rectangle(area.X, area.Y, area.Width, area.Height);
				this.GdkWindow.InvalidateRect(grect, false);
				
                if (e.PaintNow)
                {
					this.GdkWindow.ProcessUpdates(false);
                }
            }
            catch (Exception x)
            {
                Platform.Log(x);
            }

        }
コード例 #15
0
		private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
		{
			if (_fusionDisplaySets.Count == 0)
				return;

			if (!(e.PresentationImage is FusionPresentationImage))
			{
				if (e.PresentationImage is IImageSopProvider && e.PresentationImage is IVoiLutProvider)
				{
					// only synchronize the VOI LUTs if the source LUT is linear - otherwise, leave it alone
					var sourceVoiLut = ((IVoiLutProvider) e.PresentationImage).VoiLutManager.VoiLut as IVoiLutLinear;
					if (sourceVoiLut == null)
						return;

					// find any available display set containing the same series as the individual layers and capture its VOI LUT
					var seriesInstanceUid = ((IImageSopProvider) e.PresentationImage).ImageSop.SeriesInstanceUid;
					foreach (IDisplaySet displaySet in _fusionDisplaySets)
					{
						var anyVisibleChange = false;

						var descriptor = (PETFusionDisplaySetDescriptor) displaySet.Descriptor;
						if (descriptor.SourceSeries.SeriesInstanceUid == seriesInstanceUid)
						{
							// replicate the captured VOI LUT to the fusion images
							foreach (FusionPresentationImage image in displaySet.PresentationImages)
							{
								InstallVoiLut(image, sourceVoiLut, ((IImageSopProvider)e.PresentationImage).Frame, false);
								anyVisibleChange |= (image.Visible);
							}
						}
						else if (descriptor.PETSeries.SeriesInstanceUid == seriesInstanceUid)
						{
							// replicate the captured VOI LUT to the fusion images
							foreach (FusionPresentationImage image in displaySet.PresentationImages)
							{
								InstallVoiLut(image, sourceVoiLut, ((IImageSopProvider)e.PresentationImage).Frame, true);
								anyVisibleChange |= (image.Visible);
							}
						}

						// force a draw only if we replicated the VOI LUT to a visible image somewhere
						if (anyVisibleChange)
						{
							if (_synchronizationContext != null)
								_synchronizationContext.Post(s => ((IDisplaySet) s).Draw(), displaySet);
							else
								displaySet.Draw();
						}
					}
				}
			}
		}
コード例 #16
0
		private void OnImageDrawing(object sender, ImageDrawingEventArgs e)
		{
			if (e.PresentationImage.Selected)
				UpdateDeleteAllVisible();
		}