private void LoadMacros(ObservableCollection <TagMacro> macros) { treeGridViewTags.Nodes.Clear(); foreach (TagMacro macro in macros) { DicomTag dicomTag = DicomTagTable.Instance.Find(macro.Tag); string name = dicomTag != null ? dicomTag.Name : string.Empty; DicomTagNode node = new DicomTagNode(); treeGridViewTags.Nodes.Add(node); node.SetValues(string.Format("({0:X4},{1:X4})", macro.Tag.GetGroup(), macro.Tag.GetElement()), name, macro.Macro); node.DicomTag = dicomTag; node.Tag = macro; AddToList(macro.Macro); if (dicomTag != null) { if (dicomTag.VR == DicomVRType.SQ) { node.Image = Resources.Tags_16x16; } else { node.Image = Resources.Tag_16x16; } } } }
private DicomTagNode AddAnonymizationTag(long tag, string name, string macro) { DicomTagNode node = null; DicomTag dicomTag = DicomTagTable.Instance.Find(tag); node = new DicomTagNode(); treeGridViewTags.Nodes.Add(node); node.SetValues(string.Format("({0:X4},{1:X4})", tag.GetGroup(), tag.GetElement()), name, macro); node.DicomTag = dicomTag; node.Image = Resources.Tag_16x16; if (dicomTag != null && dicomTag.VR == DicomVRType.SQ) { node.Image = Resources.Tags_16x16; } _Anonymizer[tag] = macro; node.Tag = _Anonymizer.FindTag(tag); return(node); }