Пример #1
0
 internal IEnumerable <IPresentationImage> GetImagesToRedraw()
 {
     foreach (IPresentationImage image in GetAllVisibleImages())
     {
         ReferenceLineCompositeGraphic graphic = _coordinator.GetReferenceLineCompositeGraphic(image);
         if (graphic != null && graphic.Dirty)
         {
             yield return(image);
         }
     }
 }
        private void SetCurrentReferencePlane()
        {
            if (CurrentReferenceImage == this.SelectedPresentationImage)
            {
                return;
            }

            _currentReferenceImagePlane = DicomImagePlane.FromImage(this.SelectedPresentationImage);
            if (_currentReferenceImagePlane == null)
            {
                return;
            }

            ReferenceLineCompositeGraphic referenceLineCompositeGraphic =
                _coordinator.GetReferenceLineCompositeGraphic(CurrentReferenceImage);
        }
        private void RefreshReferenceLines(IPresentationImage targetImage)
        {
            try
            {
                DicomImagePlane targetImagePlane = DicomImagePlane.FromImage(targetImage);
                if (targetImagePlane == null)
                {
                    return;
                }

                ReferenceLineCompositeGraphic referenceLineCompositeGraphic = _coordinator.GetReferenceLineCompositeGraphic(targetImage);
                if (referenceLineCompositeGraphic == null)
                {
                    return;
                }
                //bool showReferenceLines = this.Active && _currentReferenceImagePlane != null &&
                //    _currentReferenceImagePlane.IsInSameFrameOfReference(targetImagePlane);

                bool showReferenceLines = targetImage.ParentDisplaySet.ImageBox.ShowReferenceLine;
                if (!showReferenceLines)
                {
                    referenceLineCompositeGraphic.HideAllReferenceLines();
                    return;
                }

                int i = 0;

                foreach (ReferenceLine referenceLine in GetAllReferenceLines(targetImagePlane))
                {
                    ReferenceLineGraphic referenceLineGraphic = referenceLineCompositeGraphic[i++];
                    referenceLineGraphic.Point1  = referenceLine.StartPoint;
                    referenceLineGraphic.Point2  = referenceLine.EndPoint;
                    referenceLineGraphic.Text    = referenceLine.Label;
                    referenceLineGraphic.Visible = true;
                }
                // make any that aren't valid invisible.

                for (int j = i; j < referenceLineCompositeGraphic.Graphics.Count; ++j)
                {
                    referenceLineCompositeGraphic[j].Visible = false;
                }
            }
            catch (Exception ex)
            {
                Platform.Log(LogLevel.Error, ex.ToString());
            }
        }
Пример #4
0
        private void RefreshReferenceLines(IPresentationImage targetImage)
        {
            DicomImagePlane targetImagePlane = targetImage is BasicPresentationImage3D ? null : DicomImagePlane.FromImage(targetImage);

            if (targetImagePlane == null)
            {
                return;
            }

            ReferenceLineCompositeGraphic referenceLineCompositeGraphic = _coordinator.GetReferenceLineCompositeGraphic(targetImage);

            if (referenceLineCompositeGraphic == null)
            {
                return;
            }

            bool showReferenceLines = this.Active && _currentReferenceImagePlane != null &&
                                      _currentReferenceImagePlane.IsInSameFrameOfReference(targetImagePlane);

            if (!showReferenceLines)
            {
                referenceLineCompositeGraphic.HideAllReferenceLines();
                return;
            }

            int i = 0;

            foreach (ReferenceLine referenceLine in GetAllReferenceLines(targetImagePlane))
            {
                ReferenceLineGraphic referenceLineGraphic = referenceLineCompositeGraphic[i++];
                referenceLineGraphic.Point1  = referenceLine.StartPoint;
                referenceLineGraphic.Point2  = referenceLine.EndPoint;
                referenceLineGraphic.Text    = referenceLine.Label;
                referenceLineGraphic.Visible = true;
            }

            // make any that aren't valid invisible.
            for (int j = i; j < referenceLineCompositeGraphic.Graphics.Count; ++j)
            {
                referenceLineCompositeGraphic[j].Visible = false;
            }
        }
        private void SetCurrentReferencePlane(IPresentationImage image)
        {
            if (CurrentReferenceImage == this.SelectedPresentationImage)
            {
                return;
            }

            _currentReferenceImagePlane = DicomImagePlane.FromImage(image);
            if (_currentReferenceImagePlane == null)
            {
                return;
            }

            ReferenceLineCompositeGraphic referenceLineCompositeGraphic =
                _coordinator.GetReferenceLineCompositeGraphic(CurrentReferenceImage);

            //Hide the current image's reference lines

            //if (referenceLineCompositeGraphic != null)
            //    referenceLineCompositeGraphic.HideAllReferenceLines();
        }