本文整理汇总了C#中DicomDataset.First方法的典型用法代码示例。如果您正苦于以下问题:C# DicomDataset.First方法的具体用法?C# DicomDataset.First怎么用?C# DicomDataset.First使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DicomDataset
的用法示例。
在下文中一共展示了DicomDataset.First方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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)));
}
示例2: 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));
}
示例3: 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));
}
示例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);
}
示例5: 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));
}
示例6: 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));
}
示例7: 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);
}
示例8: OnElement_ValidData_AddsCorrectTypeToDataset
public void OnElement_ValidData_AddsCorrectTypeToDataset(DicomTag tag, DicomVR vr, string data, Type expected)
{
var dataset = new DicomDataset();
var observer = new DicomDatasetReaderObserver(dataset);
var buffer = new MemoryByteBuffer(Encoding.ASCII.GetBytes(data));
observer.OnElement(null, tag, vr, buffer);
Assert.IsType(expected, dataset.First());
}
示例9: 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());
}
示例10: 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());
}
示例11: 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());
}
示例12: Add_OtherDoubleElement_Succeeds
public void Add_OtherDoubleElement_Succeeds()
{
var dataset = new DicomDataset();
dataset.Add(DicomTag.DoubleFloatPixelData, 3.45);
Assert.IsType(typeof(DicomOtherDouble), dataset.First());
}