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()); } }
private string getValue() { try { int vm = 0; DVR vr = DHelper.ConvertToDVR(DicomVR.UN); if (_element != null) { vr = DHelper.ConvertToDVR(_element.ValueRepresentation); //vm = _element.VM; } if (vr == DVR.UN) { if (_element != null) // do not implement _element yet, because error handler is using Element with (0000,0000), fix this in the future 20080312 { return(""); } } // ---------------- switch (vr) { case DVR.UN: case DVR.OB: case DVR.OF: case DVR.OW: case DVR.SQ: { return(""); } //VRs of LO, LT, SH, ST, and UT plus PN for person name are subject to character set extensions. //VRs AE, AS, CS, DS, and IS always use the default character set and have further restrictions on their contents. case DVR.LO: case DVR.LT: case DVR.SH: case DVR.ST: case DVR.UT: default: { DicomMultiStringElement dicomMultiStringElement = _element as DicomMultiStringElement; StringBuilder sb = new StringBuilder(); for (int i = 0; i < dicomMultiStringElement.Count; i++) { sb.Append(dicomMultiStringElement.Get <string>(i)).Append(DHelper.ValueDelimiter); } return(sb.ToString().TrimEnd(DHelper.ValueDelimiter)); } } } catch (Exception err) { DElement errEle = new DElement(_tag, _vr); LogMgt.Logger.Write(err.ToString()); } return(""); }
public DElement Add(DElement element) { if (element == null) { return(null); } if (element.IsRef) { return(null); } _elementList.Add(element._element); return(base.Add(element) as DElement); }
private void FillBaseCollection(DicomDataset rootEleList) { base.Clear(); foreach (DicomItem item in _elementList) { try { //DicomElement eleRef = _elementList.Get<DicomElement>(item.Tag); DElement element = new DElement(item, rootEleList); base.Add(element); } catch (Exception err) { LogMgt.Logger.Write(err.ToString()); } } }
public void Remove(DElement element) { if (!Contains(element)) { return; } //Tag t; //if (element.IsRef) //{ // t = element._elementRef.element.tag; //} //else //{ // t = element._element.tag; //} //_elementList.deleteElement(t); base.Remove(element); }
public void Insert(int index, DElement value) { }
public int IndexOf(DElement element) { return(base.IndexOf(element)); }
public bool Contains(DElement element) { return(base.Contains(element)); }
public override XBase Add(XBase value) { DElement e = value as DElement; return(Add(e)); }
public DSequence(DElement rootElement) : base(typeof(DElementList)) { _rootElement = rootElement; }