|
using System.Collections.Generic;
using System.Linq;
namespace DICOMViewer.Parsing
{
class PrivateCodeDictionary
{
Dictionary<string, DICOMTagInfo> mPrivateCodeDictionary = new Dictionary<string, DICOMTagInfo>();
public void LoadPrivateCreatorCode(string theGroupNumber, string theCodeValue, string thePrivateCreatorCode)
{
var aPrivateCodeQuery = from entry in PrivateDICOMDictionary.GetPrivateDICOMDictionary()
where entry.PrivateCreatorCode.Equals(thePrivateCreatorCode)
where entry.GroupNumber.Equals(theGroupNumber)
select entry;
foreach (PrivateDICOMTagInfo aPrivateCode in aPrivateCodeQuery)
{
// Tag is of format '(300B,1012)'
string aTag = string.Format("({0},{1}{2})", aPrivateCode.GroupNumber, theCodeValue, aPrivateCode.ElementID);
mPrivateCodeDictionary[aTag] = new DICOMTagInfo(aTag, aPrivateCode.Name, aPrivateCode.VR);
}
}
public void ClearPrivateCreatorCode()
{
mPrivateCodeDictionary.Clear();
}
public string GetVR(string theTagString)
{
// If Tag is not known, return VR value 'UN' (Unknown).
return mPrivateCodeDictionary.ContainsKey(theTagString) ? mPrivateCodeDictionary[theTagString].VR : "UN";
}
public string GetTagName(string theTagString)
{
// If Tag is not know, return TagName 'Not in Dictionary'.
return mPrivateCodeDictionary.ContainsKey(theTagString) ? mPrivateCodeDictionary[theTagString].TagName : "Not in Dictionary";
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Currently working as a Requirement Engineer for Siemens Healthcare in Germany.