本文整理汇总了C#中Dicom.DicomTag类的典型用法代码示例。如果您正苦于以下问题:C# DicomTag类的具体用法?C# DicomTag怎么用?C# DicomTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DicomTag类属于Dicom命名空间,在下文中一共展示了DicomTag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DatabaseQueryTransformRule
public DatabaseQueryTransformRule(string connectionString, DatabaseType dbType, string query, DicomTag[] outputTags, DicomTag[] paramTags) {
_connectionString = connectionString;
_dbType = dbType;
_query = query;
_output = new List<DicomTag>(outputTags);
_params = new List<DicomTag>(paramTags);
}
示例2: GetDateTime
/// <summary>
/// Get a composite <see cref="DateTime"/> instance based on <paramref name="date"/> and <paramref name="time"/> values.
/// </summary>
/// <param name="dataset">Dataset from which data should be retrieved.</param>
/// <param name="date">Tag associated with date value.</param>
/// <param name="time">Tag associated with time value.</param>
/// <returns>Composite <see cref="DateTime"/>.</returns>
public static DateTime GetDateTime(this DicomDataset dataset, DicomTag date, DicomTag time)
{
var dd = dataset.Contains(date) ? dataset.Get<DicomDate>(date) : null;
var dt = dataset.Contains(time) ? dataset.Get<DicomTime>(time) : null;
var da = dd != null && dd.Count > 0 ? dd.Get<DateTime>(0) : DateTime.MinValue;
var tm = dt != null && dt.Count > 0 ? dt.Get<DateTime>(0) : DateTime.MinValue;
return new DateTime(da.Year, da.Month, da.Day, tm.Hour, tm.Minute, tm.Second);
}
示例3: AddTagAndReadOut
public void AddTagAndReadOut()
{
var dict = new DicomDictionary();
var tag = new DicomTag(0x0010, 0x0020);
var dictEntry = new DicomDictionaryEntry(tag, "TestTagName", "TestTagKeyword", DicomVM.VM_1, false, DicomVR.DT);
dict.Add(dictEntry);
Assert.Equal(dictEntry, dict[tag]);
}
示例4: 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());
}
示例5: tryGetImageDateTime
private static bool tryGetImageDateTime(DicomTag dateTag, DicomTag timeTag, DicomDataset dataset,
ref DateTime imageDate, ref DateTime imageTime)
{
var dateValue = dataset.Get<DateTime>(dateTag);
var result = dateValue > DateTime.MinValue;
if (result)
{
imageDate = dateValue;
imageTime = dataset.Get<DateTime>(timeTag);
}
return result;
}
示例6: GetCorrectedString
public static string GetCorrectedString(this DicomDataset dataset, ServerOptions serverOptions, DicomTag dicomTag)
{
var result = dataset.Get<string>(dicomTag);
if (serverOptions.Codepage > 0)
{
var dicomItem = dataset.FirstOrDefault(x => x.Tag == dicomTag);
var bytes = ((DicomElement)dicomItem).Buffer.Data;
result = Encoding.GetEncoding(serverOptions.Codepage).GetString(bytes);
result = result.Replace('^', ' ');
}
return result;
}
示例7: ToJsonStringTest
public void ToJsonStringTest()
{
const ushort @group = 0x7FE0;
const ushort element = 0x00FF;
var target = new DicomTag(group, element);
const string format = "J";
IFormatProvider formatProvider = null;
const string expected = "7FE000FF";
string actual = string.Empty;
actual = target.ToString(format, formatProvider);
Assert.Equal(expected, actual);
}
示例8: GetDateTime
public static DateTime GetDateTime(this DicomDataset dataset, DicomTag date, DicomTag time)
{
DicomDate dd = dataset.Get<DicomDate>(date);
DicomTime dt = dataset.Get<DicomTime>(time);
DateTime da = DateTime.Today;
if (dd != null && dd.Count > 0) da = dd.Get<DateTime>(0);
DateTime tm = DateTime.Today;
if (dt != null && dt.Count > 0) tm = dt.Get<DateTime>(0);
return new DateTime(da.Year, da.Month, da.Day, tm.Hour, tm.Minute, tm.Second);
}
示例9: DicomDictionaryEntry
public DicomDictionaryEntry(DicomTag tag, string name, string keyword, DicomVM vm, bool retired, params DicomVR[] vrs) {
Tag = tag;
if (String.IsNullOrWhiteSpace(name))
Name = Tag.ToString();
else
Name = name;
if (String.IsNullOrWhiteSpace(keyword))
Keyword = Name;
else
Keyword = keyword;
ValueMultiplicity = vm;
ValueRepresentations = vrs;
IsRetired = retired;
}
示例10: EnumerateBothPublicAndPrivateEntries
public void EnumerateBothPublicAndPrivateEntries()
{
var dict = new DicomDictionary();
var tag1 = new DicomTag(0x0010, 0x0020);
var dictEntry1 = new DicomDictionaryEntry(tag1, "TestPublicTagName", "TestPublicTagKeyword", DicomVM.VM_1, false, DicomVR.DT);
var privCreatorDictEntry = new DicomDictionaryEntry(new DicomTag(0x0011, 0x0010), "Private Creator", "PrivateCreator", DicomVM.VM_1, false, DicomVR.LO);
dict.Add(privCreatorDictEntry);
DicomPrivateCreator privateCreator = dict.GetPrivateCreator("TESTCREATOR");
DicomDictionary privDict = dict[privateCreator];
var dictEntry2 = new DicomDictionaryEntry(DicomMaskedTag.Parse("0011", "xx10"), "TestPrivTagName", "TestPrivTagKeyword", DicomVM.VM_1, false, DicomVR.DT);
privDict.Add(dictEntry2);
dict.Add(dictEntry1);
Assert.True(dict.Contains(dictEntry1));
Assert.True(dict.Contains(privCreatorDictEntry));
Assert.True(dict[dictEntry2.Tag.PrivateCreator].Contains(dictEntry2));
Assert.True(dict.PrivateCreators.Any(pc => dict[pc].Contains(dictEntry2)));
}
示例11: EndsWithDicomMatchRule
public EndsWithDicomMatchRule(DicomTag tag, string value) {
_tag = tag;
_value = value;
}
示例12: IsEmptyDicomMatchRule
public IsEmptyDicomMatchRule(DicomTag tag) {
_tag = tag;
}
示例13: EqualsDicomMatchRule
public EqualsDicomMatchRule(DicomTag tag, string value) {
_tag = tag;
_value = value;
}
示例14: AppendDicomTransformRule
public AppendDicomTransformRule(DicomTag tag, string append) {
_tag = tag;
_append = append;
}
示例15: ExistsDicomMatchRule
public ExistsDicomMatchRule(DicomTag tag) {
_tag = tag;
}