class DcmDict::Dictionary::DataElementDictionary
Main class to handle data element data as dictionary
Public Class Methods
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 36 def initialize super end
Calls superclass method
DcmDict::Dictionary::BaseDictionary::new
Private Instance Methods
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 56 def atomic_feature_at(tag, key) try_to_find_feature(tag, key) rescue Exception => ex raise DictionaryError.new("Unable to find feature #{key.inspect} for tag '#{tag}' (#{ex.class}: #{ex.message.inspect})") end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 67 def atomic_record_at(tag) try_to_find(tag) rescue Exception => ex raise DictionaryError.new("Unable to find reference for tag '#{tag}' as #{tag.class} (#{ex.class}: #{ex.message.inspect})") end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 51 def freeze_source_data @standard_dict.freeze @multi_dict.freeze end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 41 def map_source_data @standard_dict = {} @multi_dict = [] SourceData::DataElementsData.each do |data| record = DataElementRecord.new(data).freeze DataElementIndexKey.each { |key| @standard_dict[data[key]] = record } @multi_dict << record if record.tag_multiple? end end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 73 def try_to_find(tag) try_to_find_standard_tag(tag) || try_to_find_group_length_tag(tag) || try_to_find_multiple_tag(tag) || try_to_find_private_creator_tag(tag) || try_to_find_unknown_tag(tag) end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 63 def try_to_find_feature(tag, key) atomic_record_at(tag).send(key) end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 93 def try_to_find_group_length_tag(tag) if (tag.group_length_tag?) return DataElementRecord.new( SourceData::DetachedData.make_group_length_data(tag)) end end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 85 def try_to_find_multiple_tag(tag) @multi_dict.each do |record| mrec = record.extract_multiple_tag_record(tag) return mrec if mrec end nil end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 100 def try_to_find_private_creator_tag(tag) if ( tag.private_creator_tag? ) return DataElementRecord.new( SourceData::DetachedData.make_private_creator_data(tag)) end end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 81 def try_to_find_standard_tag(tag) @standard_dict[tag] end
Source
# File lib/dcm_dict/dictionary/data_element_dictionary.rb, line 107 def try_to_find_unknown_tag(tag) DataElementRecord.new( SourceData::DetachedData.make_unknown_data(tag)) end