Exemple #1
0
		public KeyImageContentItem(string imageSopInstanceUid, string presentationSopInstanceUid, KeyObjectSelectionDocumentIod source)
		{
			this.ReferencedImageSopInstanceUid = imageSopInstanceUid;
			this.PresentationStateSopInstanceUid = presentationSopInstanceUid;
			this.FrameNumber = null;
			this._source = source;
		}
Exemple #2
0
		public KeyImageContentItem(string imageSopInstanceUid, int frameNumber, string presentationSopInstanceUid, KeyObjectSelectionDocumentIod source)
			: this(imageSopInstanceUid, presentationSopInstanceUid, source)
		{
			this.FrameNumber = frameNumber;
		}
		/// <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 KeyObjectDescriptionContentItem(string description, KeyObjectSelectionDocumentIod source)
		{
			_source = source;

			Description = description;
		}
		public PersonObserverContextContentItem(string personObserverName, KeyObjectSelectionDocumentIod source)
		{
			_source = source;

			PersonObserverName = personObserverName;
		}
		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)
								{
									ISopDataSource dataSource = keyObjectSop.DataSource;
									KeyObjectSelectionDocumentIod iod = new KeyObjectSelectionDocumentIod(dataSource);
									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();
		}
		/// <summary>
		/// Constructs a new instance of <see cref="KeyImageDeserializer"/>.
		/// </summary>
		/// <remarks>
		/// <para>Due to the relatively new nature of key object support in the ClearCanvas Framework, this API may be more prone to changes in the next release.</para>
		/// </remarks>
		public KeyImageDeserializer(KeyObjectSelectionDocumentIod iod)
		{
			_document = iod;
		}
		/// <summary>
		/// Constructs a new instance of <see cref="KeyImageDeserializer"/>.
		/// </summary>
		/// <remarks>
		/// <para>Due to the relatively new nature of key object support in the ClearCanvas Framework, this API may be more prone to changes in the next release.</para>
		/// </remarks>
		public KeyImageDeserializer(Sop sourceSop)
		{
			_document = new KeyObjectSelectionDocumentIod(sourceSop);
		}