/// <summary> /// 当中调用传输语法类对象从data[idx]开始解码一条数据元素,添加到items, 循环将整个数据集解码,返回items, 同时变化后的idx通过引用(ref)返回。 /// </summary> public virtual List <DCMAbstractType> Decode(byte[] data, ref uint idx) { while (idx < data.Length) { DCMAbstractType item = null; item = syntax.Decode(data, ref idx); items.Add(item); } return(items); }
public override List <DCMAbstractType> Decode(byte[] data, ref uint idx) { DCMAbstractType item = TransferSyntax.Decode(data, ref idx); if (item.gtag == 0xfffe && item.etag == 0xe000) //item start { uint ulidx = 0; byte[] val = (byte[])item.value; base.Decode(val, ref ulidx); //tudo:修正idx位置 if (item.length == 0xffffffff) //修正idx位置 { idx -= (uint)(item.length - ulidx); } } return(items); }
public override List <DCMAbstractType> Decode(byte[] data, ref uint idx) { while (idx < data.Length) { DCMAbstractType item = null; //此处调用传输语法对象解码一条数据元素 item = TransferSyntax.Decode(data, ref idx); if (item.gtag == 0x0002) { items.Add(item); } else { idx -= item.length; idx -= 8; break; } } return(items); }
public virtual List <DCMAbstractType> Decode(byte[] data, ref uint idx) { while (idx < data.Length) { //此处调用传输语法对象解码一条数据元素 //DCMAbstractType item = TransferSyntax.Decode(data, ref idx); DCMAbstractType item = TransferSyntax.Decode(data, ref idx); //判断特殊标记 if (item.gtag == 0xfffe && item.etag == 0xe0dd) { break; } if (item.gtag == 0xfffe && item.etag == 0xe00d) { break; } if (item.vr == "SQ") { DCMDataSequnce sq = new DCMDataSequnce(TransferSyntax); uint ulidx = 0; byte[] val = (byte[])item.value; sq.Decode(val, ref ulidx); item.value = sq; //todo:修正idx位置 if (item.length == 0xffffffff) //修正idx位置 { idx -= (uint)(item.length - ulidx); } } items.Add(item); } return(items); }