예제 #1
0
 public void ToStringTest()
 {
    var tag = new Tag("00020012");
    var asString = tag.ToString();
    var expected = string.Format("({0},{1}) : {2}", tag.Group, tag.Element, "ImplementationClassUID");
    Assert.AreEqual(expected, tag.ToString());
 }
예제 #2
0
 private bool IsProtectedUID(Tag tag)
 {
     return tag.CompleteID == TagHelper.TRANSFER_SYNTAX_UID.CompleteID ||
         tag.CompleteID == TagHelper.SOPCLASS_UID.CompleteID ||
         tag.CompleteID == TagHelper.MEDIA_STORAGE_SOPCLASS_UID.CompleteID ||
         tag.CompleteID == TagHelper.IMPLEMENTATION_CLASS_UID.CompleteID ||
         tag.CompleteID == TagHelper.REFERENCED_SOPCLASS_UID.CompleteID;
 }
예제 #3
0
        public void IsPrivateTest()
        {
            var tag = new Tag("00020012");
            var isPrivate = tag.IsPrivate();
            Assert.IsFalse(isPrivate);

            var privateTag = new Tag("30091047.");
            isPrivate = privateTag.IsPrivate();
            Assert.IsTrue(isPrivate);
        }
예제 #4
0
 public static IDICOMElement ToDICOMElement(this XElement xel)
 {
     if (xel.Name != "DICOMElement") { throw new ArgumentException("XML element must be of type DICOMElement <DICOMElement ..."); }
     var attr = xel.Attributes();
     if (!attr.Any(a => a.Name == "VR")){ throw new ArgumentException("XML element must have attribute 'VR'."); }
     var vr = VRDictionary.GetVRFromAbbreviation(attr.First(a => a.Name == "VR").Value);
     if (!attr.Any(a => a.Name == "Tag")) { throw new ArgumentException("XML element must have attribute 'Tag'."); }
     var tag = new Tag(attr.First(a => a.Name == "Tag").Value);
     var data = xel.Elements("Data").Select(d => d.Value).ToArray();
     return ElementFactory.GenerateElementFromStringData(tag, vr, data);
 }
예제 #5
0
 /// <summary>
 /// This method helps read non-compliant files. Sometimes, an supposed implicit is encoded explicitly. We'll check here
 /// Returns true if element is actually encoded explicitly (VR is written as starting characters).
 /// </summary>
 /// <param name="tag">the read tag</param>
 /// <param name="dr">the binary reader which is reading the DICOM object</param>
 /// <param name="vr">the determined VR from the tag</param>
 /// <returns></returns>
 private static bool CheckForExplicitness(Tag tag, DICOMBinaryReader dr, ref VR vr)
 {
     if (VRReader.PeekVR(dr) != VR.Null)
     {
         vr = VRReader.ReadVR(dr);
         Logging.EvilLogger.Instance.Log($"{tag} was expectd to be implicit LE but is explicit LE. Attempting to read...");
         return true;
     }
     //Implicilty encoded - All is well
     return false;
 }
예제 #6
0
 public VR GetVRFromTag(Tag tag)
 {
     if (tag.Element == GROUP_HEADER)
     {
         return VR.UnsignedLong;
     }
     var found = Tags.FirstOrDefault(t => t.TagID == tag.CompleteID);
     if (found != null)
     {
         return found.VR;
     }
     else
     {
         return VR.Unknown;
     }
 }
예제 #7
0
 public static byte[] WriteLittleEndian(Tag tag)
 {
     byte[] tagBytes = ByteHelper.HexStringToByteArray(tag.CompleteID);
     tagBytes = new byte[] { tagBytes[1], tagBytes[0], tagBytes[3], tagBytes[2] };
     return tagBytes;
 }
예제 #8
0
 public IntegerString(Tag tag, int[] data)
     : base(tag, data)
 {
     VR = VR.IntegerString;
 }
예제 #9
0
 private IDICOMElement GenerateEmptyDICOMString(Tag tag)
 {
     var s = new LongString();
     s.Tag = tag;
     s.Data = string.Empty;
     return s;
 }
예제 #10
0
 /// <summary>
 ///     Reads string data and creates the appropriate DICOM element
 /// </summary>
 /// <param name="data">the string data as an object (fresh from the DICOM reader)</param>
 /// <param name="vr">the VR of the element to be generated</param>
 /// <returns>a concrete DICOM element that uses the interface IDICOMElement</returns>
 private static IDICOMElement ReadString(VR vr, Tag tag, object data)
 {
     switch (vr)
     {
         case VR.AgeString:
             return new AgeString(tag, DICOMString.Read(data as byte[]));
         case VR.ApplicationEntity:
             return new ApplicationEntity(tag, DICOMString.Read(data as byte[]));
         case VR.CodeString:
             return new CodeString(tag, DICOMString.Read(data as byte[]));
         case VR.Date:
             return new Date(tag, DICOMString.Read(data as byte[]));
         case VR.DateTime:
             return new DateTime(tag, DICOMString.Read(data as byte[]));
         case VR.DecimalString:
             return new DecimalString(tag, DICOMString.Read(data as byte[]));
         case VR.IntegerString:
             return new IntegerString(tag, DICOMString.Read(data as byte[]));
         case VR.LongString:
             return new LongString(tag, DICOMString.Read(data as byte[]));
         case VR.LongText:
             return new LongText(tag, DICOMString.Read(data as byte[]));
         case VR.PersonName:
             return new PersonName(tag, DICOMString.Read(data as byte[]));
         case VR.ShortString:
             return new ShortString(tag, DICOMString.Read(data as byte[]));
         case VR.ShortText:
             return new ShortText(tag, DICOMString.Read(data as byte[]));
         case VR.Time:
             return new Time(tag, DICOMString.Read(data as byte[]));
         case VR.UnlimitedText:
             return new UnlimitedText(tag, DICOMString.Read(data as byte[]));
         case VR.UniqueIdentifier:
             return new UniqueIdentifier(tag, DICOMString.Read(data as byte[]));
         default:
             return new Unknown(tag, data as byte[]);
     }
 }
예제 #11
0
 public static AttributeTag AttributeTag(Tag tag, byte[] data)
 {
     Tag aTag = TagReader.ReadBigEndian(data);
     return new AttributeTag(tag, aTag);
 }
예제 #12
0
 /// <summary>
 /// Reads and returns the next DICOM element starting at the current location in the DICOM binary reader after the tag and VR have been read
 /// </summary>
 /// <param name="tag">the DICOM tag of the element</param>
 /// <param name="vr">the read VR of the element</param>
 /// <param name="dr">the binary reader which is reading the DICOM object</param>
 /// <returns></returns>
 private static IDICOMElement ReadElementExplicitLittleEndian(Tag tag, VR vr, DICOMBinaryReader dr)
 {
     int length = LengthReader.ReadLittleEndian(vr, dr);
     byte[] data = DataReader.ReadLittleEndian(length, dr, TransferSyntax.EXPLICIT_VR_LITTLE_ENDIAN);
     return ElementFactory.GenerateElement(tag, vr, data, TransferSyntax.EXPLICIT_VR_LITTLE_ENDIAN);
 }
예제 #13
0
 public SignedLong(Tag tag, int[] data)
     : base(tag, data)
 {
     VR = Enums.VR.SignedLong;
 }
예제 #14
0
        /// <summary>
        ///     Generates a concrete element class from the VR, tag, data and syntax. Also directs the appropriate data
        ///     interpretation.
        /// </summary>
        /// <param name="tag">the tag of the element to be generated</param>
        /// <param name="vr">the VR of the element to be generated</param>
        /// <param name="data">the raw data to be procesed (byte array)</param>
        /// <param name="syntax">the transfer syntax by which to interepret the data</param>
        /// <returns>a concrete DICOM element that uses the interface IDICOMElement</returns>
        public static IDICOMElement GenerateElement(Tag tag, VR vr, object data, TransferSyntax syntax, StringEncoding enc)
        {
            //HANDLE NUMBERS
            if (syntax == TransferSyntax.EXPLICIT_VR_BIG_ENDIAN)
            {
                switch (vr)
                {
                case VR.AttributeTag:
                    return(new AttributeTag(tag, BigEndianReader.ReadTag(data as byte[])));

                case VR.FloatingPointDouble:
                    return(new FloatingPointDouble(tag, BigEndianReader.ReadDoublePrecision(data as byte[])));

                case VR.FloatingPointSingle:
                    return(new FloatingPointSingle(tag, BigEndianReader.ReadSinglePrecision(data as byte[])));

                case VR.SignedLong:
                    return(new SignedLong(tag, BigEndianReader.ReadSignedLong(data as byte[])));

                case VR.Signed64BitVeryLong:
                    return(new Signed64bitVeryLong(tag, BigEndianReader.ReadSignedVeryLong(data as byte[])));

                case VR.SignedShort:
                    return(new SignedShort(tag, BigEndianReader.ReadSignedShort(data as byte[])));

                case VR.UnsignedLong:
                    return(new UnsignedLong(tag, BigEndianReader.ReadUnsignedLong(data as byte[])));

                case VR.Unsigned64BitVeryLong:
                    return(new Unsigned64bitVeryLong(tag, BigEndianReader.ReadUnsignedVeryLong(data as byte[])));

                case VR.UnsignedShort:
                    return(new UnsignedShort(tag, BigEndianReader.ReadUnsignedShort(data as byte[])));
                }
            }
            else
            {
                switch (vr)
                {
                case VR.AttributeTag:
                    return(new AttributeTag(tag, LittleEndianReader.ReadTag(data as byte[])));

                case VR.FloatingPointDouble:
                    return(new FloatingPointDouble(tag, LittleEndianReader.ReadDoublePrecision(data as byte[])));

                case VR.FloatingPointSingle:
                    return(new FloatingPointSingle(tag, LittleEndianReader.ReadSinglePrecision(data as byte[])));

                case VR.SignedLong:
                    return(new SignedLong(tag, LittleEndianReader.ReadSignedLong(data as byte[])));

                case VR.Signed64BitVeryLong:
                    return(new Signed64bitVeryLong(tag, LittleEndianReader.ReadSignedVeryLong(data as byte[])));

                case VR.SignedShort:
                    return(new SignedShort(tag, LittleEndianReader.ReadSignedShort(data as byte[])));

                case VR.UnsignedLong:
                    return(new UnsignedLong(tag, LittleEndianReader.ReadUnsignedLong(data as byte[])));

                case VR.Unsigned64BitVeryLong:
                    return(new Unsigned64bitVeryLong(tag, LittleEndianReader.ReadUnsignedVeryLong(data as byte[])));

                case VR.UnsignedShort:
                    return(new UnsignedShort(tag, LittleEndianReader.ReadUnsignedShort(data as byte[])));
                }
            }
            //HANDLE ALL OTHERS
            switch (vr)
            {
            //HANDLE STRINGS
            case VR.AgeString:
            case VR.ApplicationEntity:
            case VR.CodeString:
            case VR.Date:
            case VR.DateTime:
            case VR.DecimalString:
            case VR.IntegerString:
            case VR.LongString:
            case VR.LongText:
            case VR.PersonName:
            case VR.ShortString:
            case VR.ShortText:
            case VR.Time:
            case VR.UnlimitedCharacter:
            case VR.UnlimitedText:
            case VR.UniversalResourceId:
            case VR.UniqueIdentifier:
                return(ReadString(vr, tag, data, enc));

            //HANDLE BYTE DATA
            case VR.Sequence:
                return(new Sequence {
                    Tag = tag, Items = SequenceReader.ReadItems(data as byte[], syntax, enc)
                });

            case VR.OtherByteString:
                return(new OtherByteString(tag, data as byte[]));

            case VR.OtherFloatString:
                return(new OtherFloatString(tag, data as byte[]));

            case VR.OtherWordString:
                return(new OtherWordString(tag, data as byte[]));

            case VR.OtherDoubleString:
                return(new OtherDoubleString(tag, data as byte[]));

            case VR.OtherLongString:
                return(new OtherLongString(tag, data as byte[]));

            case VR.Other64BitVeryLongString:
                return(new Other64BitVeryLong(tag, data as byte[]));

            default:
                var unk = new Unknown(tag, data as byte[]);
                unk.TransferSyntax = syntax;
                return(unk);
            }
        }
예제 #15
0
        /// <summary>
        ///     Reads string data and creates the appropriate DICOM element
        /// </summary>
        /// <param name="data">the string data as an object (fresh from the DICOM reader)</param>
        /// <param name="vr">the VR of the element to be generated</param>
        /// <returns>a concrete DICOM element that uses the interface IDICOMElement</returns>
        private static IDICOMElement ReadString(VR vr, Tag tag, object data, StringEncoding enc)
        {
            switch (vr)
            {
            case VR.AgeString:
                return(new AgeString(tag, DICOMString.Read(data as byte[], enc)));

            case VR.ApplicationEntity:
                return(new ApplicationEntity(tag, DICOMString.Read(data as byte[], enc)));

            case VR.CodeString:
                return(new CodeString()
                {
                    Tag = tag, Data_ = DICOMString.ReadMultiple(data as byte[], enc)
                });

            case VR.Date:
                return(new Date(tag, DICOMString.Read(data as byte[], enc)));

            case VR.DateTime:
                return(new DateTime(tag, DICOMString.Read(data as byte[], enc)));

            case VR.DecimalString:
                return(new DecimalString(tag, DICOMString.Read(data as byte[], enc)));

            case VR.IntegerString:
                return(new IntegerString(tag, DICOMString.Read(data as byte[], enc)));

            case VR.LongString:
                return(new LongString(tag, DICOMString.Read(data as byte[], enc)));

            case VR.LongText:
                return(new LongText()
                {
                    Tag = tag, Data_ = DICOMString.ReadMultiple(data as byte[], enc)
                });

            case VR.PersonName:
                return(new PersonName()
                {
                    Tag = tag, Data_ = DICOMString.ReadMultiple(data as byte[], enc)
                });

            case VR.ShortString:
                return(new ShortString()
                {
                    Tag = tag, Data_ = DICOMString.ReadMultiple(data as byte[], enc)
                });

            case VR.ShortText:
                return(new ShortText(tag, DICOMString.Read(data as byte[], enc)));

            case VR.Time:
                return(new Time(tag, DICOMString.Read(data as byte[], enc)));

            case VR.UnlimitedCharacter:
                return(new UnlimitedCharacter()
                {
                    Tag = tag, Data_ = DICOMString.ReadMultiple(data as byte[], enc)
                });

            case VR.UnlimitedText:
                return(new UnlimitedText(tag, DICOMString.Read(data as byte[], enc)));

            case VR.UniqueIdentifier:
                return(new UniqueIdentifier(tag, DICOMString.Read(data as byte[], enc)));

            case VR.UniversalResourceId:
                return(new UniversalResourceId(tag, DICOMString.Read(data as byte[], enc)));

            default:
                return(new Unknown(tag, data as byte[]));
            }
        }
예제 #16
0
 public Other64BitVeryLong(Tag tag, byte[] data)
     : base(tag, data)
 {
     VR = VR.Other64BitVeryLongString;
 }
예제 #17
0
 public LongText(Tag tag, string data) : base()
 {
     Tag  = tag;
     Data = data;
     VR   = Enums.VR.LongText;
 }
예제 #18
0
 public static byte[] WriteTag(Tag tag)
 {
     //TODO modify to make VM > 1 possible
     return MultiplicityComposer.ComposeMultipleBinary<Tag>(new Tag[]{tag}, WriteTagSingle);
 }
예제 #19
0
 public UnsignedShort(Tag tag, int data)
     : base(tag, (ushort)data)
 {
     VR = VR.UnsignedShort;
 }
예제 #20
0
 /// <summary>
 ///     Generates a concrete element class from the VR, tag, data and string data (from XML). 
 /// </summary>
 /// <param name="tag">the tag of the element to be generated</param>
 /// <param name="vr">the VR of the element to be generated</param>
 /// <param name="data">the string data of the element</param>
 /// <param name="syntax">the transfer syntax by which to interepret the data</param>
 /// <returns>a concrete DICOM element that uses the interface IDICOMElement</returns>
 public static IDICOMElement GenerateElementFromStringData(Tag tag, VR vr, string[] data)
 {
     switch (vr)
     {
         case VR.AttributeTag:
             return new AttributeTag(tag, new Tag(data.First()));
         case VR.FloatingPointDouble:
             return new FloatingPointDouble(tag, data.Select(d => double.Parse(d)).ToArray());
         case VR.FloatingPointSingle:
             return new FloatingPointSingle(tag, data.Select(d => float.Parse(d)).ToArray());
         case VR.SignedLong:
             return new SignedLong(tag, data.Select(d => int.Parse(d)).ToArray());
         case VR.SignedShort:
             return new SignedShort(tag, data.Select(d => short.Parse(d)).ToArray());
         case VR.UnsignedLong:
             return new UnsignedLong(tag, data.Select(d => uint.Parse(d)).ToArray());
         case VR.UnsignedShort:
             return new UnsignedShort(tag, data.Select(d => ushort.Parse(d)).ToArray());
         //HANDLE STRINGS
         case VR.AgeString: return new AgeString(tag, data.First());
         case VR.ApplicationEntity: return new ApplicationEntity(tag, data.First());
         case VR.CodeString: return new CodeString(tag, data.First());
         case VR.DecimalString: return new DecimalString(tag, data.Select(d => double.Parse(d)).ToArray());
         case VR.IntegerString: return new IntegerString(tag, data.Select(d => int.Parse(d)).ToArray());
         case VR.LongString: return new LongString(tag, data.First());
         case VR.LongText: return new LongText(tag, data.First());
         case VR.PersonName: return new PersonName(tag, data.First());
         case VR.ShortString: return new ShortString(tag, data.First());
         case VR.ShortText: return new ShortText(tag, data.First());
         case VR.UnlimitedText: return new UnlimitedText(tag, data.First());
         case VR.UniqueIdentifier: return new UniqueIdentifier(tag, data.First());
         //HANDLE DATES
         case VR.Date: return new Date(tag, StringDataParser.GetNullableDate(data.First()));
         case VR.DateTime: return new DateTime(tag, StringDataParser.GetNullableDate(data.First()));
         case VR.Time: return new Time(tag, StringDataParser.GetNullableDate(data.First()));
         //HANDLE BYTE DATA
         case VR.Sequence:
             return new Sequence { Tag = tag, Items = data.Select(d => DICOMObject.FromXML(d)).ToList()};
         case VR.OtherByteString:
             return new OtherByteString(tag, ByteHelper.HexStringToByteArray(data.First()));
         case VR.OtherFloatString:
             return new OtherFloatString(tag, ByteHelper.HexStringToByteArray(data.First()));
         case VR.OtherWordString:
             return new OtherWordString(tag, ByteHelper.HexStringToByteArray(data.First()));
         default:
             return new Unknown(tag, ByteHelper.HexStringToByteArray(data.First()));
     }
 }
예제 #21
0
 public UnsignedShort(Tag tag, ushort[] data)
     : base(tag, data)
 {
     VR = VR.UnsignedShort;
 }
예제 #22
0
        /// <summary>
        ///     Generates a concrete element class from the VR, tag, data and syntax. Also directs the appropriate data
        ///     interpretation.
        /// </summary>
        /// <param name="tag">the tag of the element to be generated</param>
        /// <param name="vr">the VR of the element to be generated</param>
        /// <param name="data">the raw data to be procesed (byte array)</param>
        /// <param name="syntax">the transfer syntax by which to interepret the data</param>
        /// <returns>a concrete DICOM element that uses the interface IDICOMElement</returns>
        public static IDICOMElement GenerateElement(Tag tag, VR vr, object data, TransferSyntax syntax)
        {
            //HANDLE NUMBERS
            if (syntax == TransferSyntax.EXPLICIT_VR_BIG_ENDIAN)
            {
                switch (vr)
                {
                    case VR.AttributeTag:
                        return new AttributeTag(tag, BigEndianReader.ReadTag(data as byte[]));
                    case VR.FloatingPointDouble:
                        return new FloatingPointDouble(tag, BigEndianReader.ReadDoublePrecision(data as byte[]));
                    case VR.FloatingPointSingle:
                        return new FloatingPointSingle(tag, BigEndianReader.ReadSinglePrecision(data as byte[]));
                    case VR.SignedLong:
                        return new SignedLong(tag, BigEndianReader.ReadSignedLong(data as byte[]));
                    case VR.SignedShort:
                        return new SignedShort(tag, BigEndianReader.ReadSignedShort(data as byte[]));
                    case VR.UnsignedLong:
                        return new UnsignedLong(tag, BigEndianReader.ReadUnsignedLong(data as byte[]));
                    case VR.UnsignedShort:
                        return new UnsignedShort(tag, BigEndianReader.ReadUnsignedShort(data as byte[]));
                }
            }
            else
            {
                switch (vr)
                {
                    case VR.AttributeTag:
                        return new AttributeTag(tag, LittleEndianReader.ReadTag(data as byte[]));
                    case VR.FloatingPointDouble:
                        return new FloatingPointDouble(tag, LittleEndianReader.ReadDoublePrecision(data as byte[]));
                    case VR.FloatingPointSingle:
                        return new FloatingPointSingle(tag, LittleEndianReader.ReadSinglePrecision(data as byte[]));
                    case VR.SignedLong:
                        return new SignedLong(tag, LittleEndianReader.ReadSignedLong(data as byte[]));
                    case VR.SignedShort:
                        return new SignedShort(tag, LittleEndianReader.ReadSignedShort(data as byte[]));
                    case VR.UnsignedLong:
                        return new UnsignedLong(tag, LittleEndianReader.ReadUnsignedLong(data as byte[]));
                    case VR.UnsignedShort:
                        return new UnsignedShort(tag, LittleEndianReader.ReadUnsignedShort(data as byte[]));
                }
            }
            //HANDLE ALL OTHERS
            switch (vr)
            {
                //HANDLE STRINGS
                case VR.AgeString:
                case VR.ApplicationEntity:
                case VR.CodeString:
                case VR.Date:
                case VR.DateTime:
                case VR.DecimalString:
                case VR.IntegerString:
                case VR.LongString:
                case VR.LongText:
                case VR.PersonName:
                case VR.ShortString:
                case VR.ShortText:
                case VR.Time:
                case VR.UnlimitedText:
                case VR.UniqueIdentifier:
                    return ReadString(vr, tag, data);

                //HANDLE BYTE DATA
                case VR.Sequence:
                    return new Sequence { Tag = tag, Items = SequenceReader.ReadItems(data as byte[], syntax) };
                case VR.OtherByteString:
                    return new OtherByteString(tag, data as byte[]);
                case VR.OtherFloatString:
                    return new OtherFloatString(tag, data as byte[]);
                case VR.OtherWordString:
                    return new OtherWordString(tag, data as byte[]);
                default:
                    var unk = new Unknown(tag, data as byte[]);
                    unk.TransferSyntax = syntax;
                    return unk;
            }
        }
예제 #23
0
 public static byte[] WriteTagSingle(Tag tag)
 {
     return DICOMTagWriter.WriteLittleEndian(tag);
 }
예제 #24
0
 private IDICOMElement GenerateZeroDecimalString(Tag tag)
 {
     DecimalString ds = new DecimalString(tag, new double[] { 0.0 });
     return ds;
 }
예제 #25
0
        /// <summary>
        /// 获取String类型的属性值
        /// </summary>
        /// <param name="dcm"></param>
        /// <param name="tag"></param>
        /// <returns></returns>
        public static string GetStringTypeTag(DICOMObject dcm, Tag tag)
        {
            string strReturn = string.Empty;

            try
            {
                DICOMData<String> data =
                    dcm.TryGetPublicDataValue<String>(tag, String.Empty);

                strReturn = data.ToString();
            }
            catch (System.Exception) { }

            return strReturn;
        }
예제 #26
0
 public OtherByteString(Tag tag, byte[] data)
     : base(tag, data)
 {
     VR = Enums.VR.OtherByteString;
 }
예제 #27
0
 public IntegerString(Tag tag, string data)
     : base(tag, StringDataParser.ParseIntegerString(data))
 {
     VR = VR.IntegerString;
 }
예제 #28
0
        /// <summary>
        /// 获取时间类型的属性值
        /// </summary>
        /// <param name="dcm"></param>
        /// <param name="tag"></param>
        /// <returns></returns>
        public static string GetTimeTypeTag(DICOMObject dcm, Tag tag)
        {
            string strReturn = string.Empty;

            try
            {
                DICOMData<System.DateTime?> time =
                            dcm.TryGetPublicDataValue<System.DateTime?>(tag, System.DateTime.MinValue);

                if (null != time && null != time.SingleValue)
                {
                    strReturn = time.SingleValue.Value.ToString("HHmmss.ffffff");
                }

            }
            catch (System.Exception) { }

            return strReturn;
        }
예제 #29
0
 public AbstractElement(Tag tag, T[] dataArray)
 {
     DataContainer      = new DICOMData <T>();
     this.Tag           = tag;
     this.DataContainer = DICOMData <T> .CreateFromArray(dataArray);
 }
예제 #30
0
 public static byte[] WriteBigEndian(Tag tag)
 {
     return ByteHelper.HexStringToByteArray(tag.CompleteID);
 }
예제 #31
0
 public AbstractElement(Tag tag, T data)
 {
     DataContainer = new DICOMData <T>();
     this.Tag      = tag;
     this.DataContainer.SingleValue = data;
 }
예제 #32
0
 public static void WriteLittleEndian(DICOMBinaryWriter dw, Tag tag)
 {
     byte[] tagBytes = WriteLittleEndian(tag);
     dw.Write(tagBytes);
 }
예제 #33
0
 /// <summary>
 /// To string override to visualize tag and vr of element
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(string.Format("{0}, {1}, {2}", Tag.ToString(), VR.ToString(), string.Join(" | ", DData_.ToArray())));
 }