I'm trying to read dicom tags from a text file as (####,####)
and create the corresponding DicomTag from the clear canvas library
//parsing txt string to find the corresponding dicomtag
foreach (String elem in settings)
{
String tag = elem.Replace("(", "").Replace(")", "");
String[] arr = tag.Split(',');
DicomTag dTag = DicomTagDictionary.GetDicomTag(ushort.Parse(arr[0]), ushort.Parse(arr[1]));
if (dTag != null)
{
toRemove.Add(dTag);
}
else
{
MessageBox.Show("Tag: (" + arr[0] + "," + arr[1] + ") is not valid");
}
}
Some of the time even though a tag does exist the DicomTagDictionary.GetDicomTag(ushort group, ushort element)
method cannot find the tag, for example (0008,0008) works but the tag (0008,1070) doesn't work.
the tags can be found here: http://medical.nema.org/Dicom/2011/11_06pu.pdf
the clear canvas equivalent can be found here: https://github.com/ClearCanvas/ClearCanvas/blob/master/Dicom/DicomTags.cs