Class: DICOM::DObject

Inherits:
Object
  • Object
show all
Defined in:
lib/metamri/dicom_additions.rb

Overview

Reopen DObject to make tag hash

Instance Method Summary collapse

Instance Method Details

#remove_elements_that_differ_from(other_dobj) ⇒ Object

Remove elements from a dobj that aren’t identical to self’s tags.



48
49
50
51
52
53
54
55
# File 'lib/metamri/dicom_additions.rb', line 48

def remove_elements_that_differ_from(other_dobj)
  @tags.each_key do |k|
    unless @tags[k].eql? other_dobj[k]
      # pp k, [@tags[k].value, other_dobj[k].value]
      remove k
    end
  end
end

#to_hashObject

Return hash of => values



41
42
43
44
45
# File 'lib/metamri/dicom_additions.rb', line 41

def to_hash
  taghash = {}
  @tags.each_key {|k| taghash[k] = value(k) }
  return taghash
end