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


C# DicomDataset.Add方法代码示例

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


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

示例1: DicomCMoveRequest

		public DicomCMoveRequest(string destinationAe, string studyInstanceUid, string seriesInstanceUid, DicomPriority priority = DicomPriority.Medium) : base(DicomCommandField.CMoveRequest, DicomUID.StudyRootQueryRetrieveInformationModelMOVE, priority) {
			DestinationAE = destinationAe;
			Dataset = new DicomDataset();
			Level = DicomQueryRetrieveLevel.Series;
			Dataset.Add(DicomTag.StudyInstanceUID, studyInstanceUid);
			Dataset.Add(DicomTag.SeriesInstanceUID, seriesInstanceUid);
		}
开发者ID:ZeryZhang,项目名称:fo-dicom,代码行数:7,代码来源:DicomCMoveRequest.cs

示例2: SerializeAndDeserializePrivateTags

        public void SerializeAndDeserializePrivateTags()
        {
            var privCreatorDictEntry = new DicomDictionaryEntry(new DicomTag(0x0011, 0x0010), "Private Creator", "PrivateCreator", DicomVM.VM_1, false, DicomVR.LO);
            DicomDictionary.Default.Add(privCreatorDictEntry);

            DicomPrivateCreator privateCreator1 = DicomDictionary.Default.GetPrivateCreator("TESTCREATOR1");
            DicomDictionary privDict1 = DicomDictionary.Default[privateCreator1];

            var dictEntry = new DicomDictionaryEntry(DicomMaskedTag.Parse("0011", "xx01"), "TestPrivTagName", "TestPrivTagKeyword", DicomVM.VM_1, false, DicomVR.CS);
            privDict1.Add(dictEntry);

            var ds = new DicomDataset();
            ds.Add(dictEntry.Tag, "VAL1");
            ds.Add(DicomTag.SOPClassUID, DicomUID.CTImageStorage);
            ds.Add(DicomTag.SOPInstanceUID, "2.25.123");
            Assert.Equal(DicomVR.CS, ds.Get<DicomVR>(dictEntry.Tag));

            var bytes = SerializeDicom_(ds);

            File.OpenWrite("C:\\Temp\\x.dcm").Write(bytes, 0, bytes.Length);

            var ds2 = ParseDicom_(bytes);

            Assert.Equal(DicomVR.CS, ds2.Get<DicomVR>(dictEntry.Tag));
        }
开发者ID:raysearchlabs,项目名称:fo-dicom,代码行数:25,代码来源:DicomDatasetTest.cs

示例3: Add_UniversalResourceElement_Succeeds

 public void Add_UniversalResourceElement_Succeeds()
 {
     var dataset = new DicomDataset();
     dataset.Add(DicomTag.URNCodeValue, "abc");
     Assert.IsType(typeof(DicomUniversalResource), dataset.First());
     Assert.Equal("abc", dataset.Get<string>(DicomTag.URNCodeValue));
 }
开发者ID:dremerdt,项目名称:fo-dicom,代码行数:7,代码来源:DicomDatasetTest.cs

示例4: Add_OtherDoubleElementWithMultipleDoubles_Succeeds

 public void Add_OtherDoubleElementWithMultipleDoubles_Succeeds()
 {
     var dataset = new DicomDataset();
     dataset.Add(DicomTag.DoubleFloatPixelData, 3.45, 6.78, 9.01);
     Assert.IsType(typeof(DicomOtherDouble), dataset.First());
     Assert.Equal(3, dataset.Get<double[]>(DicomTag.DoubleFloatPixelData).Length);
 }
开发者ID:dremerdt,项目名称:fo-dicom,代码行数:7,代码来源:DicomDatasetTest.cs

示例5: Add_UnlimitedCharactersElementWithMultipleStrings_Succeeds

 public void Add_UnlimitedCharactersElementWithMultipleStrings_Succeeds()
 {
     var dataset = new DicomDataset();
     dataset.Add(DicomTag.LongCodeValue, "a", "b", "c");
     Assert.IsType(typeof(DicomUnlimitedCharacters), dataset.First());
     Assert.Equal("c", dataset.Get<string>(DicomTag.LongCodeValue, 2));
 }
开发者ID:dremerdt,项目名称:fo-dicom,代码行数:7,代码来源:DicomDatasetTest.cs

示例6: Contains_PrivateTag_SufficientlyFound

 public void Contains_PrivateTag_SufficientlyFound()
 {
     var dataset = new DicomDataset();
     dataset.Add(new DicomTag(0x0021, 0x0010, "TEST"), "TEST");
     var found = dataset.Contains(new DicomTag(0x0021, 0x0010, "TEST"));
     Assert.True(found);
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:7,代码来源:GH319.cs

示例7: Add_OtherDoubleElement_Succeeds

 public void Add_OtherDoubleElement_Succeeds()
 {
     var tag = DicomTag.DoubleFloatPixelData;
     var dataset = new DicomDataset();
     dataset.Add(tag, 3.45);
     Assert.IsType<DicomOtherDouble>(dataset.First(item => item.Tag.Equals(tag)));
 }
开发者ID:gustavosaita,项目名称:fo-dicom,代码行数:7,代码来源:DicomDatasetTest.cs

示例8: Add_OtherDoubleElementWithMultipleDoubles_Succeeds

 public void Add_OtherDoubleElementWithMultipleDoubles_Succeeds()
 {
     var tag = DicomTag.DoubleFloatPixelData;
     var dataset = new DicomDataset();
     dataset.Add(tag, 3.45, 6.78, 9.01);
     Assert.IsType<DicomOtherDouble>(dataset.First(item => item.Tag.Equals(tag)));
     Assert.Equal(3, dataset.Get<double[]>(tag).Length);
 }
开发者ID:gustavosaita,项目名称:fo-dicom,代码行数:8,代码来源:DicomDatasetTest.cs

示例9: Add_UnlimitedCharactersElementWithMultipleStrings_Succeeds

 public void Add_UnlimitedCharactersElementWithMultipleStrings_Succeeds()
 {
     var tag = DicomTag.LongCodeValue;
     var dataset = new DicomDataset();
     dataset.Add(tag, "a", "b", "c");
     Assert.IsType<DicomUnlimitedCharacters>(dataset.First(item => item.Tag.Equals(tag)));
     Assert.Equal("c", dataset.Get<string>(tag, 2));
 }
开发者ID:gustavosaita,项目名称:fo-dicom,代码行数:8,代码来源:DicomDatasetTest.cs

示例10: Add_UniversalResourceElement_Succeeds

 public void Add_UniversalResourceElement_Succeeds()
 {
     var tag = DicomTag.URNCodeValue;
     var dataset = new DicomDataset();
     dataset.Add(tag, "abc");
     Assert.IsType<DicomUniversalResource>(dataset.First(item => item.Tag.Equals(tag)));
     Assert.Equal("abc", dataset.Get<string>(tag));
 }
开发者ID:gustavosaita,项目名称:fo-dicom,代码行数:8,代码来源:DicomDatasetTest.cs

示例11: DicomCGetRequest

 /// <summary>
 /// Initializes a new instance of the <see cref="DicomCGetRequest"/> class.
 /// </summary>
 /// <param name="studyInstanceUid">
 /// The Study Instance UID confining the C-GET operation.
 /// </param>
 /// <param name="priority">
 /// The priority of the C-GET operation.
 /// </param>
 public DicomCGetRequest(
     string studyInstanceUid,
     DicomPriority priority = DicomPriority.Medium)
     : base(DicomCommandField.CGetRequest, DicomUID.StudyRootQueryRetrieveInformationModelGET, priority)
 {
     Dataset = new DicomDataset();
     Level = DicomQueryRetrieveLevel.Study;
     Dataset.Add(DicomTag.StudyInstanceUID, studyInstanceUid);
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:18,代码来源:DicomCGetRequest.cs

示例12: Add_UniversalResourceElementWithMultipleStrings_OnlyFirstValueIsUsed

        public void Add_UniversalResourceElementWithMultipleStrings_OnlyFirstValueIsUsed()
        {
            var dataset = new DicomDataset();
            dataset.Add(DicomTag.URNCodeValue, "a", "b", "c");
            Assert.IsType(typeof(DicomUniversalResource), dataset.First());

            var data = dataset.Get<string[]>(DicomTag.URNCodeValue);
            Assert.Equal(1, data.Length);
            Assert.Equal("a", data.First());
        }
开发者ID:dremerdt,项目名称:fo-dicom,代码行数:10,代码来源:DicomDatasetTest.cs

示例13: Add_MultiVMStringTags_YieldsMultipleValues

        public void Add_MultiVMStringTags_YieldsMultipleValues(DicomTag tag, string[] values, Type expectedType)
        {
            var dataset = new DicomDataset();
            dataset.Add(tag, values);

            Assert.IsType(expectedType, dataset.First(item => item.Tag.Equals(tag)));

            var data = dataset.Get<string[]>(tag);
            Assert.Equal(values.Length, data.Length);
            Assert.Equal(values.Last(), data.Last());
        }
开发者ID:GMZ,项目名称:fo-dicom,代码行数:11,代码来源:DicomDatasetTest.cs

示例14: RegenerateAll

		public void RegenerateAll(DicomDataset dataset) {
			foreach (var ui in dataset.Where(x => x.ValueRepresentation == DicomVR.UI).ToArray()) {
				dataset.Add(ui.Tag, Generate(dataset.Get<DicomUID>(ui.Tag)));
			}

			foreach (var sq in dataset.Where(x => x.ValueRepresentation == DicomVR.SQ).Cast<DicomSequence>().ToArray()) {
				foreach (var item in sq) {
					RegenerateAll(item);
				}
			}
		}
开发者ID:radyworks,项目名称:fo-dicom,代码行数:11,代码来源:DicomUIDGenerator.cs

示例15: Add_UniversalResourceElementWithMultipleStrings_OnlyFirstValueIsUsed

        public void Add_UniversalResourceElementWithMultipleStrings_OnlyFirstValueIsUsed()
        {
            var tag = DicomTag.URNCodeValue;
            var dataset = new DicomDataset();
            dataset.Add(tag, "a", "b", "c");
            Assert.IsType<DicomUniversalResource>(dataset.First(item => item.Tag.Equals(tag)));

            var data = dataset.Get<string[]>(tag);
            Assert.Equal(1, data.Length);
            Assert.Equal("a", data.First());
        }
开发者ID:gustavosaita,项目名称:fo-dicom,代码行数:11,代码来源:DicomDatasetTest.cs


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