示例#1
0
        public object this[string index] {
            get {
                if (_dataset == null)
                {
                    return(String.Empty);
                }

                DicomTag tag = null;
                if (!_map.TryGetValue(index, out tag))
                {
                    tag = DicomTag.Parse(index);
                }

                if (tag != null)
                {
                    DcmElement elem = _dataset.GetElement(tag);
                    if (elem.Length == 0)
                    {
                        return(String.Empty);
                    }
                    if (elem != null)
                    {
                        object o = elem.GetValueObject();
#if !SILVERLIGHT
                        if (_xmlEscape && o is string)
                        {
                            return(SecurityElement.Escape((string)o));
                        }
                        else
#endif
                        return(o);
                    }
                }

                return(String.Empty);
            }
        }
示例#2
0
        private void Load(DcmDataset ds)
        {
            _rows    = ds.GetUInt16(OverlayTag(DicomTags.OverlayRows), 0);
            _columns = ds.GetUInt16(OverlayTag(DicomTags.OverlayColumns), 0);
            _type    = ds.GetString(OverlayTag(DicomTags.OverlayType), "Unknown");

            DicomTag tag = OverlayTag(DicomTags.OverlayOrigin);

            if (ds.Contains(tag))
            {
                short[] xy = ds.GetSS(tag).GetValues();
                if (xy != null && xy.Length == 2)
                {
                    _originX = xy[0];
                    _originY = xy[1];
                }
            }

            _bitsAllocated = ds.GetUInt16(OverlayTag(DicomTags.OverlayBitsAllocated), 1);
            _bitPosition   = ds.GetUInt16(OverlayTag(DicomTags.OverlayBitPosition), 0);

            tag = OverlayTag(DicomTags.OverlayData);
            if (ds.Contains(tag))
            {
                DcmElement elem = ds.GetElement(tag);
                _data = elem.ByteBuffer.ToBytes();
            }

            _description = ds.GetString(OverlayTag(DicomTags.OverlayDescription), String.Empty);
            _subtype     = ds.GetString(OverlayTag(DicomTags.OverlaySubtype), String.Empty);
            _label       = ds.GetString(OverlayTag(DicomTags.OverlayLabel), String.Empty);

            _frames      = ds.GetInt32(OverlayTag(DicomTags.NumberOfFramesInOverlay), 1);
            _frameOrigin = ds.GetUInt16(OverlayTag(DicomTags.ImageFrameOrigin), 1);

            //TODO: include ROI
        }