当前位置: 首页>>代码示例>>C#>>正文


C# DicomAttributeCollection.LoadDicomFields方法代码示例

本文整理汇总了C#中DicomAttributeCollection.LoadDicomFields方法的典型用法代码示例。如果您正苦于以下问题:C# DicomAttributeCollection.LoadDicomFields方法的具体用法?C# DicomAttributeCollection.LoadDicomFields怎么用?C# DicomAttributeCollection.LoadDicomFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DicomAttributeCollection的用法示例。


在下文中一共展示了DicomAttributeCollection.LoadDicomFields方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PixelDataInfo

		public PixelDataInfo(DicomAttributeCollection dataset)
		{
			dataset.LoadDicomFields(this);

			AspectRatio = PixelAspectRatio.FromString(dataset[DicomTags.PixelAspectRatio].ToString()) ?? new PixelAspectRatio(0, 0);
			PixelSpacing = PixelSpacing.FromString(dataset[DicomTags.PixelSpacing].ToString()) ?? new PixelSpacing(0, 0);
			ImagerPixelSpacing = PixelSpacing.FromString(dataset[DicomTags.ImagerPixelSpacing].ToString()) ?? new PixelSpacing(0, 0);
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:8,代码来源:PixelDataInfo.cs

示例2: DicomPixelData

		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="collection"></param>
		protected DicomPixelData(DicomAttributeCollection collection)
		{
			collection.LoadDicomFields(this);

			SopClass = SopClass.GetSopClass(collection[DicomTags.SopClassUid].GetString(0, string.Empty));

			if (collection.Contains(DicomTags.NumberOfFrames))
				NumberOfFrames = collection[DicomTags.NumberOfFrames].GetInt32(0, 1);
			if (collection.Contains(DicomTags.PlanarConfiguration))
				PlanarConfiguration = collection[DicomTags.PlanarConfiguration].GetUInt16(0, 1);
			if (collection.Contains(DicomTags.LossyImageCompression))
				LossyImageCompression = collection[DicomTags.LossyImageCompression].GetString(0, string.Empty);
			if (collection.Contains(DicomTags.LossyImageCompressionRatio))
				LossyImageCompressionRatio = collection[DicomTags.LossyImageCompressionRatio].GetFloat32(0, 1.0f);
			if (collection.Contains(DicomTags.LossyImageCompressionMethod))
				LossyImageCompressionMethod = collection[DicomTags.LossyImageCompressionMethod].GetString(0, string.Empty);
			if (collection.Contains(DicomTags.DerivationDescription))
				DerivationDescription = collection[DicomTags.DerivationDescription].GetString(0, string.Empty);
			if (collection.Contains(DicomTags.RescaleSlope))
				RescaleSlope = collection[DicomTags.RescaleSlope].ToString();
			if (collection.Contains(DicomTags.RescaleIntercept))
				RescaleIntercept = collection[DicomTags.RescaleIntercept].ToString();
			if (collection.Contains(DicomTags.ModalityLutSequence))
			{
				DicomAttribute attrib = collection[DicomTags.ModalityLutSequence];
				_hasDataModalityLut = !attrib.IsEmpty && !attrib.IsNull;
			}

			_linearVoiLuts = Window.GetWindowCenterAndWidth(collection);
			if (collection.Contains(DicomTags.VoiLutSequence))
			{
				DicomAttribute attrib = collection[DicomTags.VoiLutSequence];
				_hasDataVoiLuts = !attrib.IsEmpty && !attrib.IsNull;
			}

			if (PhotometricInterpretation.Equals(Iod.PhotometricInterpretation.PaletteColor.Code) && collection.Contains(DicomTags.RedPaletteColorLookupTableDescriptor))
			{
				_paletteColorLut = PaletteColorLut.Create(collection);
				_hasPaletteColorLut = true;
			}
		}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:45,代码来源:DicomPixelData.cs

示例3: FieldTest

        public void FieldTest()
        {
            DicomAttributeCollection theSet = new DicomAttributeCollection();
            TestFields theFields = new TestFields();

            SetupMR(theSet);

            theSet.LoadDicomFields(theFields);

            Assert.IsTrue(theFields.AccessionNumber.Equals(theSet[DicomTags.AccessionNumber].GetString(0,"")), "Accession Numbers did not match!");
            Assert.IsTrue(theFields.SopClassUid.UID.Equals(theSet[DicomTags.SopClassUid].GetString(0, "")), "SOP Class UIDs did not match!");
            Assert.IsTrue(theFields.SOPInstanceUID.UID.Equals(theSet[DicomTags.SopInstanceUid].GetString(0, "")), "SOP Class UIDs did not match!");
			Assert.IsTrue(theFields.StudyDate.ToString("yyyyMMdd", CultureInfo.InvariantCulture).Equals(theSet[DicomTags.StudyDate].GetString(0, "")));
            Assert.IsTrue(theFields.Modality.Equals(theSet[DicomTags.Modality].GetString(0, "")), "Modality did not match!");
            Assert.IsTrue(theFields.StudyDescription.Equals(theSet[DicomTags.StudyDescription].GetString(0, "")), "Study Description did not match!");
            Assert.IsTrue(theFields.StudyInstanceUID.UID.Equals(theSet[DicomTags.StudyInstanceUid].GetString(0, "")), "Study Instance UIDs did not match!");
            Assert.IsTrue(theFields.SeriesInstanceUID.UID.Equals(theSet[DicomTags.SeriesInstanceUid].GetString(0, "")), "Series Instance UIDs did not match!");
            Assert.IsTrue(theFields.StudyID.Equals(theSet[DicomTags.StudyId].GetString(0, "")), "StudyID did not match!");
            Assert.IsTrue(theFields.PatientsName.Equals(theSet[DicomTags.PatientsName].GetString(0, "")), "PatientsName did not match!");
            Assert.IsTrue(theFields.PatientID.Equals(theSet[DicomTags.PatientId].GetString(0, "")), "PatientID did not match!");
			Assert.IsTrue(theFields.PatientsBirthDate.ToString("yyyyMMdd", CultureInfo.InvariantCulture).Equals(theSet[DicomTags.PatientsBirthDate].GetString(0, "")));
            Assert.IsTrue(theFields.PatientsSex.Equals(theSet[DicomTags.PatientsSex].GetString(0, "")), "PatientsSex did not match!");
            Assert.IsTrue(theFields.Rows == theSet[DicomTags.Rows].GetUInt16(0,0));
            Assert.IsTrue(theFields.Columns == theSet[DicomTags.Columns].GetUInt16(0,0));
            float floatValue;
            theSet[DicomTags.PixelSpacing].TryGetFloat32(0, out floatValue);
            Assert.IsTrue(theFields.PixelSpacing == floatValue);
            int intValue;
            theSet[DicomTags.InstanceNumber].TryGetInt32(0, out intValue);
            Assert.IsTrue(theFields.InstanceNumber == intValue);
            //Assert.IsTrue(string.Join("\\", theFields.ImageType).Equals(theSet[DicomTags.ImageType].ToString()));
        }
开发者ID:khaha2210,项目名称:radio,代码行数:32,代码来源:DicomFieldTests.cs


注:本文中的DicomAttributeCollection.LoadDicomFields方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。