Пример #1
0
		/// <summary>
		/// Get a list of tags to be populated into a <see cref="DirectoryRecordSequenceItem"/> for the 
		/// specified <see cref="DirectoryRecordType"/>.
		/// </summary>
		/// <param name="type">The directory record type to get the tag list for.</param>
		/// <param name="tagList">The list of tags to be included.</param>
		/// <returns></returns>
		internal static bool TryGetDirectoryRecordTagList(DirectoryRecordType type, out List<uint> tagList)
		{
			return _tagLookupList.TryGetValue(type, out tagList);
		}
Пример #2
0
        /// <summary>
        /// Adds a sequence item to temporarydictionary with the current offset.
        /// </summary>
        /// <param name="recordType">Type of the record.</param>
        /// <param name="dataSet">The data set.</param>
        /// <param name="tags">The tags.</param>
        /// <returns>The newly created DirectoryRecord</returns>
        /// <remarks>Tags are a dictionary of tags and optional values - if the value is null, then it will get the value from the specified dataset</remarks>
        private static DirectoryRecordSequenceItem AddSequenceItem(DirectoryRecordType recordType, IDicomAttributeProvider dataSet, IDictionary<uint, object> tags)
        {
            DirectoryRecordSequenceItem dicomSequenceItem = new DirectoryRecordSequenceItem();
            dicomSequenceItem[DicomTags.OffsetOfTheNextDirectoryRecord].Values = 0;
            dicomSequenceItem[DicomTags.RecordInUseFlag].Values = 0xFFFF;
            dicomSequenceItem[DicomTags.OffsetOfReferencedLowerLevelDirectoryEntity].Values = 0;

        	string recordName;
        	DirectoryRecordTypeDictionary.TryGetName(recordType, out recordName);
            dicomSequenceItem[DicomTags.DirectoryRecordType].Values = recordName;

        	DicomAttribute charSetAttrib;
			if (dataSet.TryGetAttribute(DicomTags.SpecificCharacterSet, out charSetAttrib))
				dicomSequenceItem[DicomTags.SpecificCharacterSet] = charSetAttrib.Copy();

            foreach (uint dicomTag in tags.Keys)
            {
                try
                {
                    DicomTag dicomTag2 = DicomTagDictionary.GetDicomTag(dicomTag);
                	DicomAttribute attrib;
                    if (tags[dicomTag] != null)
                    {
                        dicomSequenceItem[dicomTag].Values = tags[dicomTag];
                    }
                    else if (dataSet.TryGetAttribute(dicomTag, out attrib))
                    {
                        dicomSequenceItem[dicomTag].Values = attrib.Values;
                    }
                    else
                    {
                        Platform.Log(LogLevel.Info, 
							"Cannot find dicomTag {0} for record type {1}", dicomTag2 != null ? dicomTag2.ToString() : dicomTag.ToString(), recordType);
                    }
                }
                catch (Exception ex)
                {
					Platform.Log(LogLevel.Error, ex, "Exception adding dicomTag {0} to directory record for record type {1}", dicomTag, recordType);
                }
            }

            return dicomSequenceItem;
        }
Пример #3
0
		/// <summary>
		/// Get the <see cref="DirectoryRecordType"/> for a given SopClass UID.
		/// </summary>
		/// <param name="uid">The SOP Class UID string.</param>
		/// <param name="type">The output directory record type.</param>
		/// <returns>Returns true if the directory record type is found, or else false.</returns>
		internal static bool TryGetDirectoryRecordType(string uid, out DirectoryRecordType type)
		{
			return _sopClassLookup.TryGetValue(uid, out type);
		}
Пример #4
0
 /// <summary>
 /// Get the name for a <see cref="DirectoryRecordType"/>
 /// </summary>
 /// <param name="type"></param>
 /// <param name="val"></param>
 /// <returns></returns>
 static public bool TryGetName(DirectoryRecordType type, out string val)
 {
     return(_typeList.TryGetValue(type, out val));
 }
Пример #5
0
 /// <summary>
 /// Get the <see cref="DirectoryRecordType"/> for a string.
 /// </summary>
 /// <param name="val"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 static public bool TryGetType(string val, out DirectoryRecordType type)
 {
     return(_nameList.TryGetValue(val, out type));
 }
Пример #6
0
		/// <summary>
		/// Get the name for a <see cref="DirectoryRecordType"/>
		/// </summary>
		/// <param name="type"></param>
		/// <param name="val"></param>
		/// <returns></returns>
		static public bool TryGetName(DirectoryRecordType type, out string val)
		{
			return _typeList.TryGetValue(type, out val);
		}
Пример #7
0
		/// <summary>
		/// Get the <see cref="DirectoryRecordType"/> for a string.
		/// </summary>
		/// <param name="val"></param>
		/// <param name="type"></param>
		/// <returns></returns>
		static public bool TryGetType(string val, out DirectoryRecordType type)
		{
			return _nameList.TryGetValue(val, out type);
		}