public static IEnumerable<DicomGraphicAnnotation> CreateGraphicAnnotations(Frame frame, GraphicAnnotationModuleIod annotationsFromPresentationState, RectangleF displayedArea, bool interactive = false) { GraphicAnnotationSequenceItem[] annotationSequences = annotationsFromPresentationState.GraphicAnnotationSequence; if (annotationSequences == null) return Enumerable.Empty<DicomGraphicAnnotation>().ToList(); return annotationSequences.Select(sqItem => CreateGraphicAnnotation(frame, sqItem, displayedArea, interactive)).Where(g => g != null).ToList(); }
public static IEnumerable<DicomGraphicAnnotation> CreateGraphicAnnotations(Frame frame, GraphicAnnotationModuleIod annotationsFromPresentationState, RectangleF displayedArea) { List<DicomGraphicAnnotation> list = new List<DicomGraphicAnnotation>(); GraphicAnnotationSequenceItem[] annotationSequences = annotationsFromPresentationState.GraphicAnnotationSequence; if (annotationSequences != null) { foreach (GraphicAnnotationSequenceItem sequenceItem in annotationSequences) { ImageSopInstanceReferenceDictionary dictionary = new ImageSopInstanceReferenceDictionary(sequenceItem.ReferencedImageSequence, true); if (dictionary.ReferencesFrame(frame.ParentImageSop.SopInstanceUid, frame.FrameNumber)) { list.Add(new DicomGraphicAnnotation(sequenceItem, displayedArea)); } } } return list.AsReadOnly(); }