private void treeDump_NodeMouseDoubleClick(object sender, TreeNodeAdvMouseEventArgs e) { if (e.Node.Tag is DicomNode) { DicomNode dn = e.Node.Tag as DicomNode; if (dn.VR != "SQ" || e.Button == MouseButtons.Right) { DicomDictionaryForm ddf = new DicomDictionaryForm(dn.ElementTag.Substring(1, 9)); ddf.ShowDialog(this); } } }
private void LoadDataset(DcmDataset ds, Collection <Node> parent) { if (ds == null) { return; } foreach (DcmItem di in ds.Elements) { Image icon = LoadTreeViewAdvResourceImage("Leaf", di.VR.VR, Color.Blue); DicomNode dn = new DicomNode(icon, di); parent.Add(dn); if (di is DcmItemSequence) { dn.Icon = LoadTreeViewAdvResourceImage("FolderClosed", "SQ", Color.Blue); DcmItemSequence sq = di as DcmItemSequence; foreach (DcmItemSequenceItem item in sq.SequenceItems) { icon = LoadTreeViewAdvResourceImage("Folder", "", Color.Black); DicomTagNode din = new DicomTagNode(icon, DicomTags.Item, item.StreamLength); dn.Nodes.Add(din); LoadDataset(item.Dataset, din.Nodes); if (item.StreamLength == 0xffffffff) { icon = LoadTreeViewAdvResourceImage("FolderClosed", "", Color.Black); din.Nodes.Add(new DicomTagNode(icon, DicomTags.ItemDelimitationItem, 0)); } } if (sq.StreamLength == 0xffffffff) { icon = LoadTreeViewAdvResourceImage("FolderClosed", "", Color.Black); dn.Nodes.Add(new DicomTagNode(icon, DicomTags.SequenceDelimitationItem, 0)); } } } }
private void LoadDataset(DcmDataset ds, Collection<Node> parent) { if (ds == null) return; foreach (DcmItem di in ds.Elements) { Image icon = LoadTreeViewAdvResourceImage("Leaf", di.VR.VR, Color.Blue); DicomNode dn = new DicomNode(icon, di); parent.Add(dn); if (di is DcmItemSequence) { dn.Icon = LoadTreeViewAdvResourceImage("FolderClosed", "SQ", Color.Blue); DcmItemSequence sq = di as DcmItemSequence; foreach (DcmItemSequenceItem item in sq.SequenceItems) { icon = LoadTreeViewAdvResourceImage("Folder", "", Color.Black); DicomTagNode din = new DicomTagNode(icon, DicomTags.Item, item.StreamLength); dn.Nodes.Add(din); LoadDataset(item.Dataset, din.Nodes); if (item.StreamLength == 0xffffffff) { icon = LoadTreeViewAdvResourceImage("FolderClosed", "", Color.Black); din.Nodes.Add(new DicomTagNode(icon, DicomTags.ItemDelimitationItem, 0)); } } if (sq.StreamLength == 0xffffffff) { icon = LoadTreeViewAdvResourceImage("FolderClosed", "", Color.Black); dn.Nodes.Add(new DicomTagNode(icon, DicomTags.SequenceDelimitationItem, 0)); } } } }