public ReferenceLineGraphic this[int index] { get { for (int i = base.Graphics.Count; i <= index; ++i) { ReferenceLineGraphic newGraphic = new ReferenceLineGraphic(); newGraphic.Changed += OnChildChanged; base.Graphics.Add(newGraphic); } return (ReferenceLineGraphic)base.Graphics[index]; } }
public ReferenceLineGraphic this[int index] { get { for (int i = base.Graphics.Count; i <= index; ++i) { ReferenceLineGraphic newGraphic = new ReferenceLineGraphic(); newGraphic.Changed += OnChildChanged; base.Graphics.Add(newGraphic); } return((ReferenceLineGraphic)base.Graphics[index]); } }
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()); } }
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; } }