Example #1
0
        public static DPath GetDPath(DicomTag tag, DVR vr, string description, string sqRootPath, int sqIndex)
        {
            string strG = DHelper.Int2HexString(tag.Group);
            string strE = DHelper.Int2HexString(tag.Element);
            //string name = DHelper.GetTagName((uint)ele.Tag);

            // for shorten the DPath string length 20071010
            string name = "A";

            StringBuilder sb = new StringBuilder();

            if (sqRootPath != null && sqIndex >= 0)
            {
                sb.Append(sqRootPath).Append(Seperator).Append(sqIndex.ToString()).Append(Seperator);
            }
            sb.Append(strG).Append(Seperator).Append(strE).Append(Seperator).Append(name).Append(Seperator);
            string str = sb.ToString();

            DPath dpath = new DPath();

            dpath.Path        = str.TrimEnd(Seperator);
            dpath.Description = description;
            dpath.VR          = vr;
            return(dpath);
        }
Example #2
0
 protected override object GetValueEx(string name)
 {
     if (name == "Tag")
     {
         string str = DHelper.Int2HexString(Tag);
         if (str.Length == 4)
         {
             str = "0000" + str;
         }
         else if (str.Length == 5)
         {
             str = "000" + str;
         }
         else if (str.Length == 6)
         {
             str = "00" + str;
         }
         else if (str.Length == 7)
         {
             str = "0" + str;
         }
         return(str);
     }
     else if (name == "Value")
     {
         // 20110119  To avoid XML-invalid characters such as &,<,> be copied from the DICOM tag into the XML string
         //return string.Format("<![CDATA[{0}]]>", base.GetValueEx(name));
         return(XMLTransformer.ConvertToXMLEscapeString(base.GetValueEx(name).ToString()));
     }
     else
     {
         return(base.GetValueEx(name));
     }
 }
Example #3
0
        private void setTag(int tag)
        {
            DicomTag dicomTag = DicomTag.Parse(DHelper.Int2HexString(tag));

            if (_element != null)
            {
                DicomVR vr = _element.ValueRepresentation;
                //string val = Value;
                _element = CreateEmptyElement(dicomTag, vr);
                //Value = val;
            }
        }
Example #4
0
        public override string ToString()
        {
            if (_element != null)
            {
                return("(" + DHelper.Int2HexString(_element.Tag.Group) + ","
                       + DHelper.Int2HexString(_element.Tag.Element) + ") "
                       + getVRString() + " "
                       + getValue() + "\t\t\t"
                       + DHelper.GetTagName(DHelper.GE2uint(_element.Tag.Group, _element.Tag.Element)));
            }

            return("");
        }