Exemplo n.º 1
0
        private void FillSequenceFromElementRef(DicomDataset rootEleList)
        {
            try
            {
                DicomVR vr = _element.ValueRepresentation;

                if (vr == DicomVR.SQ)
                {
                    Sequence = new DSequence(this);
                    DicomSequence sequence = _element as DicomSequence;
                    for (int i = 0; i < sequence.Items.Count; i++)
                    {
                        DicomDataset list = sequence.Items[i];

                        DElementList dlist = new DElementList(list, rootEleList);
                        Sequence._add(dlist);
                    }
                }
            }
            catch (Exception err)
            {
                DElement errEle = new DElement(_tag, _vr);
                LogMgt.Logger.Write(err.ToString());
            }
        }
Exemplo n.º 2
0
        public static DElementList OpenXmlFile(string fileName)
        {
            try
            {
                if (!File.Exists(fileName))
                {
                    return(null);
                }

                string strXml = "";
                using (StreamReader sr = File.OpenText(fileName))
                {
                    strXml = sr.ReadToEnd();
                }

                DElementList list = XObjectManager.CreateObject(strXml, typeof(DElementList)) as DElementList;
                if (list != null)
                {
                    list.FillDicomCollection();
                }
                return(list);
            }
            catch (Exception err)
            {
                LogMgt.Logger.Write(err.ToString());
                return(null);
            }
        }
Exemplo n.º 3
0
        public new DElementList Copy()
        {
            DElementList list = new DElementList();

            foreach (DElement ele in this)
            {
                list.Add(ele);
            }
            return(list);
        }
Exemplo n.º 4
0
        public static DElementList CreateFromXml(string xmlString)
        {
            DElementList list = XObjectManager.CreateObject(xmlString, typeof(DElementList)) as DElementList;

            if (list != null)
            {
                list.FillDicomCollection();
            }
            return(list);
        }
Exemplo n.º 5
0
        public static string ConvertToDicomXml(DElementList list)
        {
            StringBuilder sbXml = new StringBuilder();

            sbXml.AppendFormat("<DICOM xmlns=\"{0}\">", DHelper.XMLNameSpace);
            if (list != null)
            {
                sbXml.Append(list.ToXMLString(""));
            }
            sbXml.Append("</DICOM>");
            string str = sbXml.ToString();

            return(str);
        }
Exemplo n.º 6
0
 public void Remove(DElementList value)
 {
     //int index = IndexOf(value);
     //if (_rootElement.IsRef)
     //{
     //    if (index < 0 || index >= _rootElement._element.value_count) return;
     //    _rootElement._element.remove_value(index);
     //    base.Remove(value);
     //}
     //else
     //{
     //    if (index < 0 || index >= _rootElement._element.VM) return;
     //    _rootElement._element.remove_value(index);
     //    base.Remove(value);
     //}
 }
Exemplo n.º 7
0
        public static DElementList OpenFile(string fileName)
        {
            try
            {
                if (!File.Exists(fileName))
                {
                    return(null);
                }

                var df = DicomFile.Open(fileName);

                DElementList eList = null;
                eList = new DElementList(df.Dataset);

                return(eList);
            }
            catch (Exception err)
            {
                LogMgt.Logger.Write(err.ToString());
                return(null);
            }
        }
Exemplo n.º 8
0
 public void Insert(int index, DElementList value)
 {
 }
Exemplo n.º 9
0
 public int IndexOf(DElementList value)
 {
     return(base.IndexOf(value));
 }
Exemplo n.º 10
0
 public bool Contains(DElementList value)
 {
     return(base.Contains(value));
 }
Exemplo n.º 11
0
 internal DElementList _add(DElementList value)
 {
     return(base.Add(value) as DElementList);
 }