Skip to content

Instantly share code, notes, and snippets.

@seki
Last active October 28, 2021 05:55
Show Gist options
  • Save seki/119023e3e78dddbae8ed985f612bb895 to your computer and use it in GitHub Desktop.
Save seki/119023e3e78dddbae8ed985f612bb895 to your computer and use it in GitHub Desktop.
tiny dcm
# coding: us-ascii
require 'pp'
class Dcm
module ImplicitLittle
def read_tag; read(4).unpack('vv') end
def read_vr; nil; end
def read_i2; read(2).unpack('v').first end
def read_i4; read(4).unpack('V').first end
end
def initialize(buf, transfer_syntax=nil)
@data = buf
@cur = 0
@transfer_syntax = transfer_syntax
@in_file_meta = transfer_syntax ? true : false
if transfer_syntax
self.extend(ImplicitLittle) if @transfer_syntax == '1.2.840.10008.1.2'
else
raise 'not dicom file' if !dicm?
end
end
def forward(n)
@cur += n
end
def read(n)
@data[@cur, n]
ensure
forward(n)
end
def read_tag; read(4).unpack('vv') end
def read_vr; read(2).unpack('a2').first end
def read_i2; read(2).unpack('v').first end
def read_i4; read(4).unpack('V').first end
def parse(root={})
stack = []
stack.push(root)
is_in_file_meta?(root)
while it = (visit_attr(stack) rescue nil)
is_in_file_meta?(root)
break if @data.size <= @cur
end
root
end
def parse_sq(items=[])
stack = []
stack.push(items)
while it = (visit_attr(stack) rescue nil)
break if @data.size <= @cur
end
items
end
def is_in_file_meta?(root)
if @in_file_meta
group = @data[@cur, 2].unpack('v').first rescue return
if group != 2
@in_file_meta = false
@transfer_syntax = root.dig("00020010", :value).to_s.strip
self.extend(ImplicitLittle) if @transfer_syntax == '1.2.840.10008.1.2'
end
end
end
def visit_attr(stack)
tag = read_tag
case tag
when nil
return false
when [0xfffe, 0xe000]
len = read_i4
if len == 0xffffffff
node = {}
stack.last << node
stack.push(node)
else
node = self.class.new(read(len), @transfer_syntax || true).parse({})
stack.last << node
end
when [0xfffe, 0xe00d]
# Hash === @stack.last
len = read_i4
stack.pop
when [0xfffe, 0xe0dd]
# Array === @stack.last
len = read_i4
stack.pop
else
vr = read_vr
case vr
when nil
len = read_i4
when 'OB', 'OW', 'OF', 'SQ', 'UN'
forward(2)
len = read_i4
else
len = read_i2
end
tag = sprintf("%04X%04X", *tag)
if len == 0xffffffff
ary = []
stack.last[tag] = {:vr => vr, :value => ary}
stack.push(ary)
elsif vr == 'SQ'
ary = self.class.new(read(len), @transfer_syntax || true).parse_sq
stack.last[tag] = {:vr => vr, :value => ary}
else
stack.last[tag] = {:vr => vr, :value => read(len)}
end
end
tag
end
def dicm?
forward(128)
read(4) == 'DICM'
end
end
def sr_each(root, parent=[], &blk)
parent.push(root)
root.dig('0040A730', :value)&.each do |x|
yield(x, parent)
sr_each(x, parent, &blk)
end
parent.pop
end
if __FILE__ == $0
require 'find'
dcm = Dcm.new(File.binread(ARGV.shift))
tree = dcm.parse
sr_each(tree) do |x, parent|
pp [parent.size, x.dig('0040A043', :value, 0, '00080104', :value)&.strip]
end
exit
dir = ARGV.shift || raise("usage: #{$0} dir")
ary = []
Find.find(dir) do |fname|
begin
dcm = Dcm.new(File.binread(fname, 2048))
if dcm.tree.dig("00020010", :value)
pp [fname,
dcm.tree.dig("00080005", :value),
dcm.tree.dig("00100010", :value),
dcm.tree.dig("00080022", :value),
dcm.tree.dig("00080032", :value)]
date = dcm.tree.dig("00080022", :value)
time = dcm.tree.dig("00080032", :value)
if date && time
ary << [date, time, fname]
end
end
rescue
end
end
pp ary.sort
end
{"00020000"=>{:vr=>"UL", :value=>"\xB0\x00\x00\x00"},
"00020001"=>{:vr=>"OB", :value=>"\x00\x01"},
"00020002"=>{:vr=>"UI", :value=>"1.2.840.10008.1.3.10"},
"00020003"=>{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.5.1175775772.5737.0"},
"00020010"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00020012"=>{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.2"},
"00020013"=>{:vr=>"SH", :value=>"DCTOOL100 "},
"00020016"=>{:vr=>"AE", :value=>"CLUNIE1 "},
"00041130"=>{:vr=>"CS", :value=>""},
"00041200"=>{:vr=>"UL", :value=>"v\x01\x00\x00"},
"00041202"=>{:vr=>"UL", :value=>"\xEE!\x00\x00"},
"00041212"=>{:vr=>"US", :value=>"\x00\x00"},
"00041220"=>
{:vr=>"SQ",
:value=>
[{"00041400"=>{:vr=>"UL", :value=>"f\x04\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xFC\x01\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 138"},
"00100010"=>{:vr=>"PN", :value=>"\xF9\xF8\xE5\xEF^\xE3\xE1\xE5\xF8\xE4"},
"00100020"=>{:vr=>"LO", :value=>"SCSHBRW "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xBC\x02\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 138"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775772.5732.0"},
"00200010"=>{:vr=>"SH", :value=>"SCSHBRW "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"l\x03\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 138"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775772.5732.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSHBRW "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775772.5732.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 138"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"V\a\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xEC\x04\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 144"},
"00100010"=>{:vr=>"PN", :value=>"\xBB\xEE\xDAce\xDC\xD1yp\xD3"},
"00100020"=>{:vr=>"LO", :value=>"SCSRUSS "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xAC\x05\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 144"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775772.5729.0"},
"00200010"=>{:vr=>"SH", :value=>"SCSRUSS "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\\\x06\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 144"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775772.5729.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSRUSS "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775772.5729.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 144"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"H\n" + "\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xDE\a\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 127"},
"00100010"=>
{:vr=>"PN", :value=>"\xE2\xC8\xC7\xE6\xEA^\xE4\xE6\xD2\xC7\xD1 "},
"00100020"=>{:vr=>"LO", :value=>"SCSARAB "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x9E\b\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 127"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775772.5726.0"},
"00200010"=>{:vr=>"SH", :value=>"SCSARAB "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"N\t\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 127"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775772.5726.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSARAB "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775772.5726.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 127"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"<\r\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xD2\n" + "\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00100010"=>{:vr=>"PN", :value=>"\xC4neas^R\xFCdiger "},
"00100020"=>{:vr=>"LO", :value=>"SCSGERM "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x92\v\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775772.5723.0"},
"00200010"=>{:vr=>"SH", :value=>"SCSGERM "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"B\f\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775772.5723.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSGERM "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775772.5723.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>",\x10\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xC2\r\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00100010"=>{:vr=>"PN", :value=>"Buc^J\xE9r\xF4me"},
"00100020"=>{:vr=>"LO", :value=>"SCSFREN "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x82\x0E\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775772.5720.0"},
"00200010"=>{:vr=>"SH", :value=>"SCSFREN "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"2\x0F\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775772.5720.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSFREN "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775772.5720.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 100"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x1C\x13\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xB2\x10\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 126"},
"00100010"=>{:vr=>"PN", :value=>"\xC4\xE9\xEF\xED\xF5\xF3\xE9\xEF\xF2 "},
"00100020"=>{:vr=>"LO", :value=>"SCSGREEK"},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"r\x11\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 126"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775772.5717.0"},
"00200010"=>{:vr=>"SH", :value=>"SCSGREEK"}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\"\x12\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 126"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775772.5717.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSGREEK"},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775772.5717.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 126"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x12\x16\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xAE\x13\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"GB18030 "},
"00100010"=>
{:vr=>"PN", :value=>"Wang^XiaoDong=\xCD\xF5^\xD0\xA1\xB6\xAB="},
"00100020"=>{:vr=>"LO", :value=>"X2EXAMPLE "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"n\x14\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"GB18030 "},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775771.5714.0"},
"00200010"=>{:vr=>"SH", :value=>"X2EXAMPLE "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x1C\x15\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"GB18030 "},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775771.5714.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSX2 "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775771.5714.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"GB18030 "},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x14\x19\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xAA\x16\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 192"},
"00100010"=>
{:vr=>"PN",
:value=>"Wang^XiaoDong=\xE7\x8E\x8B^\xE5\xB0\x8F\xE6\x9D\xB1= "},
"00100020"=>{:vr=>"LO", :value=>"X1EXAMPLE "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"l\x17\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 192"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775771.5711.0"},
"00200010"=>{:vr=>"SH", :value=>"X1EXAMPLE "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x1C\x18\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 192"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775771.5711.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSX1 "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775771.5711.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO_IR 192"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"@\x1C\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xC4\x19\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 149"},
"00100010"=>
{:vr=>"PN",
:value=>
"Hong^Gildong=\e$)C\xFB\xF3^\e$)C\xD1\xCE\xD4\xD7=\e$)C\xC8\xAB^\e$)C\xB1\xE6\xB5\xBF"},
"00100020"=>{:vr=>"LO", :value=>"I2EXAMPLE "},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x8C\x1A\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 149"},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775771.5708.0"},
"00200010"=>{:vr=>"SH", :value=>"I2EXAMPLE "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"B\e\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 149"},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775771.5708.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSI2 "},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775771.5708.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 149"},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\xB0\x1F\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\n" + "\x1D\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"ISO 2022 IR 13\\ISO 2022 IR 87 "},
"00100010"=>
{:vr=>"PN",
:value=>
"\xD4\xCF\xC0\xDE^\xC0\xDB\xB3=\e$B;3ED\e(J^\e$BB@O:\e(J=\e$B$d$^$@\e(J^\e$B$?$m$&\e(J"},
"00100020"=>{:vr=>"LO", :value=>"H32EXAMPLE"},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xE0\x1D\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"ISO 2022 IR 13\\ISO 2022 IR 87 "},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775771.5705.0"},
"00200010"=>{:vr=>"SH", :value=>"H32EXAMPLE"}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xA4\x1E\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"ISO 2022 IR 13\\ISO 2022 IR 87 "},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775771.5705.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSH32"},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775771.5705.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"ISO 2022 IR 13\\ISO 2022 IR 87 "},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"p \x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"PATIENT "},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 87 "},
"00100010"=>
{:vr=>"PN",
:value=>
"Yamada^Tarou=\e$B;3ED\e(B^\e$BB@O:\e(B=\e$B$d$^$@\e(B^\e$B$?$m$&\e(B"},
"00100020"=>{:vr=>"LO", :value=>"H31EXAMPLE"},
"00100030"=>{:vr=>"DA", :value=>""},
"00100040"=>{:vr=>"CS", :value=>""}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"8!\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"STUDY "},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 87 "},
"00080020"=>{:vr=>"DA", :value=>"19000101"},
"00080030"=>{:vr=>"TM", :value=>"000000"},
"00080050"=>{:vr=>"SH", :value=>""},
"00081030"=>{:vr=>"LO", :value=>""},
"0020000D"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.2.0.1175775771.5702.0"},
"00200010"=>{:vr=>"SH", :value=>"H31EXAMPLE"}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\xEE!\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"SERIES"},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 87 "},
"00080060"=>{:vr=>"CS", :value=>"OT"},
"00080080"=>{:vr=>"LO", :value=>""},
"00080081"=>{:vr=>"ST", :value=>""},
"00081050"=>{:vr=>"PN", :value=>""},
"0020000E"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.3.0.1.1175775771.5702.0"},
"00200011"=>{:vr=>"IS", :value=>"1 "}},
{"00041400"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041410"=>{:vr=>"US", :value=>"\xFF\xFF"},
"00041420"=>{:vr=>"UL", :value=>"\x00\x00\x00\x00"},
"00041430"=>{:vr=>"CS", :value=>"IMAGE "},
"00041500"=>{:vr=>"CS", :value=>"SCSH31"},
"00041510"=>{:vr=>"UI", :value=>"1.2.840.10008.5.1.4.1.1.7\x00"},
"00041511"=>
{:vr=>"UI", :value=>"1.3.6.1.4.1.5962.1.1.0.1.1.1175775771.5702.0"},
"00041512"=>{:vr=>"UI", :value=>"1.2.840.10008.1.2.1\x00"},
"00080005"=>{:vr=>"CS", :value=>"\\ISO 2022 IR 87 "},
"00200013"=>{:vr=>"IS", :value=>"1 "},
"00280004"=>{:vr=>"CS", :value=>"MONOCHROME2 "},
"00500004"=>{:vr=>"CS", :value=>""}}]}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment