/// <summary> /// Creates the presentation images for a given key object selection document. /// </summary> /// <param name="keyObjectDocument">The key object selection document from which presentation images are to be created.</param> /// <returns>A list of created presentation images.</returns> protected virtual List<IPresentationImage> CreateImages(KeyObjectSelectionDocumentIod keyObjectDocument) { List<IPresentationImage> images = new List<IPresentationImage>(); if (_studyTree == null) { Platform.Log(LogLevel.Warn, "Key object document cannot be used to create images because there is no study tree to build from."); } else { IList<IKeyObjectContentItem> content = new KeyImageDeserializer(keyObjectDocument).Deserialize(); foreach (IKeyObjectContentItem item in content) { if (item is KeyImageContentItem) images.AddRange(CreateImages((KeyImageContentItem) item)); else Platform.Log(LogLevel.Warn, "Unsupported key object content value type"); } } return images; }
public KeyImageInformation(StudyTree studyTree, Sop keyObjectSelectionDocument) : base(CreateClipboardItems(studyTree, keyObjectSelectionDocument)) { var koDeserializer = new KeyImageDeserializer(keyObjectSelectionDocument); var description = koDeserializer.DeserializeDescriptions().OfType<KeyObjectDescriptionContentItem>().FirstOrDefault(); var author = koDeserializer.DeserializeObserverContexts().OfType<PersonObserverContextContentItem>().FirstOrDefault(); _parentStudyInstanceUid = keyObjectSelectionDocument.StudyInstanceUid; _documentInstanceUid = keyObjectSelectionDocument.SopInstanceUid; _author = author != null ? author.PersonObserverName : string.Empty; _description = description != null ? description.Description : string.Empty; _documentTitle = koDeserializer.DocumentTitle ?? KeyObjectSelectionDocumentTitleContextGroup.OfInterest; _seriesDescription = keyObjectSelectionDocument.SeriesDescription; _seriesNumber = keyObjectSelectionDocument.SeriesNumber; _contentDateTime = DateTimeParser.ParseDateAndTime(null, keyObjectSelectionDocument.ContentDate, keyObjectSelectionDocument.ContentTime); _name = string.Format(SR.FormatOriginalKeyImageSelection, keyObjectSelectionDocument.SeriesNumber, keyObjectSelectionDocument.SeriesDescription, Format.DateTime(_contentDateTime)); }