Esempio n. 1
0
		internal FileReference(DicomStreamOpener streamOpener, long offset, long length, Endian endian, DicomVr vr)
		{
			StreamOpener = streamOpener;
			Offset = offset;
			_length = length;
			Endian = endian;
			Vr = vr;
		}
Esempio n. 2
0
 /// <summary>
 /// Creates an instance of <see cref="DicomTag"/> representing a private creator code tag.
 /// </summary>
 /// <param name="group">The Group of the private tag.</param>
 /// <param name="element">The Element of the private tag.</param>
 /// <param name="vr">The VR of the private tag.</param>
 public static DicomTag CreatePrivateTag(ushort group, ushort element, DicomVr vr)
 {
     if (vr == null)
     {
         vr = DicomVr.UNvr;
     }
     return(new DicomTag(((uint)group << 16) | element, "Private Tag", "PrivateTag", vr, false, 1, vr.IsMultiValue ? uint.MaxValue : 1, false));
 }
Esempio n. 3
0
 internal FileReference(DicomStreamOpener streamOpener, long offset, long length, Endian endian, DicomVr vr)
 {
     StreamOpener = streamOpener;
     Offset       = offset;
     _length      = length;
     Endian       = endian;
     Vr           = vr;
 }
Esempio n. 4
0
        internal static bool IsWildcardCriterion(DicomVr vr, string criterion)
        {
            if (String.IsNullOrEmpty(criterion))
                return false;

            if (!IsWildcardCriterionAllowed(vr))
                return false;

            return criterion.Contains("*") || criterion.Contains("?");
        }
Esempio n. 5
0
 private DicomTag(uint tag, String name)
 {
     TagValue    = tag;
     _name       = name;
     _vr         = DicomVr.UNvr;
     _multiVrTag = false;
     _vmLow      = 1;
     _vmHigh     = 1;
     _isRetired  = false;
 }
Esempio n. 6
0
 /// <summary>
 /// Primary constructor for dictionary tags
 /// </summary>
 /// <param name="tag"></param>
 /// <param name="name"></param>
 /// <param name="varName"></param>
 /// <param name="vr"></param>
 /// <param name="isMultiVrTag"></param>
 /// <param name="vmLow"></param>
 /// <param name="vmHigh"></param>
 /// <param name="isRetired"></param>
 public DicomTag(uint tag, String name, String varName, DicomVr vr, bool isMultiVrTag, uint vmLow, uint vmHigh, bool isRetired)
 {
     TagValue    = tag;
     _name       = name;
     _varName    = varName;
     _vr         = vr;
     _multiVrTag = isMultiVrTag;
     _vmLow      = vmLow;
     _vmHigh     = vmHigh;
     _isRetired  = isRetired;
 }
Esempio n. 7
0
        /// <summary>
        /// Initialize dictionary with standard tags.
        /// </summary>
        private static void InitStandardTags()
        {
            using (var stream = typeof(DicomTagDictionary).Assembly.GetManifestResourceStream("ClearCanvas.Dicom.DicomTagDictionary.data"))
            {
                if (stream == null)
                {
                    throw new InvalidOperationException("DICOM data dictionary embedded resource not found.");
                }

                using (var reader = new StreamReader(stream))
                {
                    string line;
                    while ((line = reader.ReadLine()) != null)
                    {
                        if (line.StartsWith("#"))
                        {
                            continue;
                        }

                        var items = line.Split(';');
                        var tag   = new DicomTag(
                            uint.Parse(items[0]),
                            items[1],
                            items[2],
                            DicomVr.GetVR(items[3]),
                            bool.Parse(items[4]),
                            uint.Parse(items[5]),
                            uint.Parse(items[6]),
                            bool.Parse(items[7])
                            );
                        _tags.Add(tag.TagValue, tag);
                        _tagNames.Add(tag.VariableName, tag);
                    }
                }
            }
        }
Esempio n. 8
0
 internal static bool IsWildcardCriterionAllowed(DicomVr vr)
 {
     return !WildcardExcludedVRs.Any(excludedVr => excludedVr == vr.Name);
 }
Esempio n. 9
0
		private DicomTag(uint tag, String name)
		{
			TagValue = tag;
			_name = name;
			_vr = DicomVr.UNvr;
			_multiVrTag = false;
			_vmLow = 1;
			_vmHigh = 1;
			_isRetired = false;
		}
Esempio n. 10
0
		/// <summary>
		/// Primary constructor for dictionary tags
		/// </summary>
		/// <param name="tag"></param>
		/// <param name="name"></param>
		/// <param name="varName"></param>
		/// <param name="vr"></param>
		/// <param name="isMultiVrTag"></param>
		/// <param name="vmLow"></param>
		/// <param name="vmHigh"></param>
		/// <param name="isRetired"></param>
		public DicomTag(uint tag, String name, String varName, DicomVr vr, bool isMultiVrTag, uint vmLow, uint vmHigh, bool isRetired)
		{
			TagValue = tag;
			_name = name;
			_varName = varName;
			_vr = vr;
			_multiVrTag = isMultiVrTag;
			_vmLow = vmLow;
			_vmHigh = vmHigh;
			_isRetired = isRetired;
		}
Esempio n. 11
0
		/// <summary>
		/// Creates an instance of <see cref="DicomTag"/> representing a private creator code tag.
		/// </summary>
		/// <param name="group">The Group of the private tag.</param>
		/// <param name="element">The Element of the private tag.</param>
		/// <param name="vr">The VR of the private tag.</param>
		public static DicomTag CreatePrivateTag(ushort group, ushort element, DicomVr vr)
		{
			if (vr == null) vr = DicomVr.UNvr;
			return new DicomTag(((uint) group << 16) | element, "Private Tag", "PrivateTag", vr, false, 1, vr.IsMultiValue ? uint.MaxValue : 1, false);
		}
Esempio n. 12
0
		/// <summary>
		/// Creates an instance of <see cref="DicomTag"/> representing a private creator code tag.
		/// </summary>
		/// <param name="group">The Group of the private tag.</param>
		/// <param name="element">The Private Element of the private tag.</param>
		/// <param name="vr">The VR of the private tag.</param>
		/// <param name="block">The Private Block of the private tag.</param>
		public static DicomTag CreatePrivateTag(ushort group, byte element, DicomVr vr, byte block = 0)
		{
			return CreatePrivateTag(group, (ushort) ((block << 8) | element), vr);
		}
Esempio n. 13
0
 /// <summary>
 /// Creates an instance of <see cref="DicomTag"/> representing a private creator code tag.
 /// </summary>
 /// <param name="group">The Group of the private tag.</param>
 /// <param name="element">The Private Element of the private tag.</param>
 /// <param name="vr">The VR of the private tag.</param>
 /// <param name="block">The Private Block of the private tag.</param>
 public static DicomTag CreatePrivateTag(ushort group, byte element, DicomVr vr, byte block = 0)
 {
     return(CreatePrivateTag(group, (ushort)((block << 8) | element), vr));
 }