Пример #1
0
        //全タグ取得
        public static void GetDicomTagAll(string path, out List <DicomTagItem> items)
        {
            items = new List <DicomTagItem>();

            if (File.Exists(path))
            {
                using (var dcm = DicomData.Open(path))
                {
                    foreach (DicomTag tag in dcm)
                    {
                        var item = new DicomTagItem();
                        item.Tag      = tag.Tag;
                        item.VR       = tag.VR;
                        item.DataSize = tag.DataSize;
                        if (tag.DataSize >= 0 && tag.DataSize <= 1024)
                        {
                            item.Value = tag.ToString();
                        }
                        else
                        {
                            item.Value = "";
                        }

                        var tagData = DicomTagTbl.GetTagData(tag.Tag);
                        if (tagData != null)
                        {
                            item.EName = tagData.EName;
                            item.JName = tagData.JName;
                        }

                        items.Add(item);
                    }
                }
            }
        }
Пример #2
0
        //タグ取得
        public static void GetDicomTag(string path, uint[] tags, out List <DicomTagItem> items)
        {
            items = new List <DicomTagItem>();

            if (File.Exists(path))
            {
                using (var dcm = DicomData.Open(path))
                {
                    var dic = DicomAnalyzer.DicomTagDictionary.Open(dcm, tags);
                    foreach (var dicP in dic)
                    {
                        var tag = dicP.Value;

                        var item = new DicomTagItem();
                        item.Tag      = tag.Tag;
                        item.VR       = tag.VR;
                        item.DataSize = tag.DataSize;
                        if (tag.Tag != 0x7FE00010)
                        {
                            item.Value = tag.ToString();
                        }
                        else
                        {
                            item.Value = "";
                        }

                        var tagData = DicomTagTbl.GetTagData(tag.Tag);
                        if (tagData != null)
                        {
                            item.EName = tagData.EName;
                            item.JName = tagData.JName;
                        }

                        items.Add(item);
                    }
                }
            }
        }