Exemplo n.º 1
0
        public override DcmElement Put(DcmElement newElem)
        {
            uint tag = newElem.tag();
            if ((tag & 0xFFFF0000) != 0x00020000)
            {
                throw new System.ArgumentException(newElem.ToString());
            }

            try
            {
                switch (tag)
                {
                    case Tags.MediaStorageSOPClassUID:
                        sopClassUID = newElem.GetString(null);
                        break;

                    case Tags.MediaStorageSOPInstanceUID:
                        sopInstanceUID = newElem.GetString(null);
                        break;

                    case Tags.TransferSyntaxUID:
                        tsUID = newElem.GetString(null);
                        break;

                    case Tags.ImplementationClassUID:
                        implClassUID = newElem.GetString(null);
                        break;

                    case Tags.ImplementationVersionName:
                        implVersionName = newElem.GetString(null);
                        break;

                }
            }
            catch (DcmValueException ex)
            {
                throw new System.ArgumentException(newElem.ToString());
            }
            return base.Put(newElem);
        }
Exemplo n.º 2
0
        public override DcmElement Put(DcmElement newElem)
        {
            uint tag = newElem.tag();
            if ((tag & 0xFFFF0000) != 0x00000000)
            {
                throw new System.ArgumentException(newElem.ToString());
            }

            if (newElem.GetByteBuffer().GetOrder() != ByteOrder.LITTLE_ENDIAN)
                throw new ArgumentException( "The byte order must be LITTLE_ENDIAN: " + newElem.GetByteBuffer().ToString());

            try
            {
                switch (tag)
                {
                    case Tags.AffectedSOPClassUID:
                    case Tags.RequestedSOPClassUID:
                        sopClassUID = newElem.GetString(null);
                        break;

                    case Tags.CommandField:
                        cmdField = newElem.Int;
                        break;

                    case Tags.MessageID: case
                    Tags.MessageIDToBeingRespondedTo:
                        msgID = newElem.Int;
                        break;

                    case Tags.DataSetType:
                        dataSetType = newElem.Int;
                        break;

                    case Tags.Status:
                        status = newElem.Int;
                        break;

                    case Tags.AffectedSOPInstanceUID:
                    case Tags.RequestedSOPInstanceUID:
                        sopInstUID = newElem.GetString(null);
                        break;

                }
            }
            catch (DcmValueException ex)
            {
                throw new System.ArgumentException(newElem.ToString(), ex);
            }
            return base.Put(newElem);
        }