Beispiel #1
0
        internal KeyImageInformation()
        {
            _description       = "";
            _seriesDescription = "KEY IMAGES";
            _docTitle          = KeyObjectSelectionDocumentTitleContextGroup.OfInterest;

            ClipboardItems = new BindingList <IClipboardItem>();
        }
Beispiel #2
0
		internal KeyImageInformation()
		{
			_description = "";
			_seriesDescription = "KEY IMAGES";
			_docTitle = KeyObjectSelectionDocumentTitleContextGroup.OfInterest;

			ClipboardItems = new BindingList<IClipboardItem>();
		}
 internal KeyImageInformation()
 {
     _parentStudyInstanceUid = string.Empty;
     _documentInstanceUid    = string.Empty;
     _description            = string.Empty;
     _seriesDescription      = SR.DefaultKeyObjectSelectionSeriesDescription;
     _documentTitle          = KeyObjectSelectionDocumentTitleContextGroup.OfInterest;
     _author          = GetUserName();
     _name            = SR.LabelNewKeyImageSelection;
     _seriesNumber    = null;
     _contentDateTime = null;
 }
		internal KeyImageInformation()
		{
			_parentStudyInstanceUid = string.Empty;
			_documentInstanceUid = string.Empty;
			_description = string.Empty;
			_seriesDescription = SR.DefaultKeyObjectSelectionSeriesDescription;
			_documentTitle = KeyObjectSelectionDocumentTitleContextGroup.OfInterest;
			_author = GetUserName();
			_name = SR.LabelNewKeyImageSelection;
			_seriesNumber = null;
			_contentDateTime = null;
		}
        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));
        }
        public IImageProperty[] GetProperties(IPresentationImage image)
        {
            List <IImageProperty> properties = new List <IImageProperty>();

            if (image != null && image.ParentDisplaySet != null)
            {
                IImageViewer viewer = image.ImageViewer;
                if (viewer != null)
                {
                    IDicomDisplaySetDescriptor descriptor = image.ParentDisplaySet.Descriptor as IDicomDisplaySetDescriptor;
                    if (descriptor != null && descriptor.SourceSeries != null)
                    {
                        string uid = descriptor.SourceSeries.SeriesInstanceUid;
                        if (!String.IsNullOrEmpty(uid))
                        {
                            StudyTree studyTree       = viewer.StudyTree;
                            Series    keyObjectSeries = studyTree.GetSeries(uid);
                            if (keyObjectSeries != null && keyObjectSeries.Sops.Count > 0)
                            {
                                Sop keyObjectSop = keyObjectSeries.Sops[0];
                                if (keyObjectSop.SopClassUid == SopClass.KeyObjectSelectionDocumentStorageUid)
                                {
                                    KeyObjectSelectionDocumentIod iod       = new KeyObjectSelectionDocumentIod(keyObjectSop);
                                    SrDocumentContentModuleIod    content   = iod.SrDocumentContent;
                                    GeneralEquipmentModuleIod     equipment = iod.GeneralEquipment;

                                    if (content != null)
                                    {
                                        string            codeValue       = "";
                                        CodeSequenceMacro conceptSequence = content.ConceptNameCodeSequence;
                                        if (conceptSequence != null)
                                        {
                                            KeyObjectSelectionDocumentTitle documentTitle = KeyObjectSelectionDocumentTitleContextGroup.LookupTitle(conceptSequence);
                                            if (documentTitle != null)
                                            {
                                                codeValue = documentTitle.ToString();
                                            }
                                        }

                                        string             documentDescription = "";
                                        IContentSequence[] contentSequences    = content.ContentSequence ?? new IContentSequence[0];
                                        for (int i = contentSequences.Length - 1; i >= 0; --i)
                                        {
                                            IContentSequence  contentSequence = contentSequences[i];
                                            CodeSequenceMacro sequenceMacro   = contentSequence.ConceptNameCodeSequence;
                                            if (sequenceMacro != null && sequenceMacro.CodeValue == KeyObjectSelectionCodeSequences.KeyObjectDescription.CodeValue)
                                            {
                                                documentDescription = contentSequence.TextValue;
                                                break;
                                            }
                                        }

                                        properties.Add(
                                            new ImageProperty("KeyImageDocumentTitle",
                                                              SR.CategoryKeyImageSeries,
                                                              SR.NameKeyImageDocumentTitle,
                                                              SR.DescriptionKeyImageDocumentTitle,
                                                              codeValue));

                                        properties.Add(
                                            new ImageProperty("KeyImageDocumentDescription",
                                                              SR.CategoryKeyImageSeries,
                                                              SR.NameKeyImageDocumentDescription,
                                                              SR.DescriptionKeyImageDocumentDescription,
                                                              documentDescription));

                                        properties.Add(
                                            new ImageProperty("KeyImageEquipmentManufacturer",
                                                              SR.CategoryKeyImageEquipment,
                                                              SR.NameManufacturer,
                                                              SR.DescriptionManufacturer,
                                                              equipment.Manufacturer ?? ""));
                                        properties.Add(
                                            new ImageProperty("KeyImageEquipmentManufacturersModelName",
                                                              SR.CategoryKeyImageEquipment,
                                                              SR.NameManufacturersModelName,
                                                              SR.DescriptionManufacturersModelName,
                                                              equipment.ManufacturersModelName ?? ""));
                                        properties.Add(
                                            new ImageProperty("KeyImageEquipmentSoftwareVersions",
                                                              SR.CategoryKeyImageEquipment,
                                                              SR.NameSoftwareVersions,
                                                              SR.DescriptionSoftwareVersions,
                                                              equipment.SoftwareVersions ?? ""));
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return(properties.ToArray());
        }
		private bool AreEqual(CodeSequenceMacro x, KeyObjectSelectionDocumentTitle y)
		{
			return x == null ? y == null : (y != null && x.CodeValue == y.CodeValue && x.CodingSchemeDesignator == y.CodingSchemeDesignator);
		}
 private bool AreEqual(CodeSequenceMacro x, KeyObjectSelectionDocumentTitle y)
 {
     return(x == null ? y == null : (y != null && x.CodeValue == y.CodeValue && x.CodingSchemeDesignator == y.CodingSchemeDesignator));
 }
		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));
		}