dicom 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +17 -0
- data/README.rdoc +16 -3
- data/lib/dicom.rb +3 -1
- data/lib/dicom/anonymizer.rb +35 -54
- data/lib/dicom/d_client.rb +49 -64
- data/lib/dicom/d_object.rb +511 -416
- data/lib/dicom/d_read.rb +21 -34
- data/lib/dicom/d_server.rb +21 -61
- data/lib/dicom/d_write.rb +3 -6
- data/lib/dicom/element.rb +1 -1
- data/lib/dicom/file_handler.rb +14 -9
- data/lib/dicom/image_item.rb +7 -6
- data/lib/dicom/link.rb +42 -77
- data/lib/dicom/logging.rb +158 -0
- data/lib/dicom/parent.rb +9 -8
- data/lib/dicom/sequence.rb +1 -1
- data/lib/dicom/version.rb +1 -1
- metadata +5 -4
data/lib/dicom/parent.rb
CHANGED
@@ -20,7 +20,7 @@ module DICOM
|
|
20
20
|
#
|
21
21
|
# === Parameters
|
22
22
|
#
|
23
|
-
# * <tt>
|
23
|
+
# * <tt>tag_or_index</tt> -- A tag string which identifies the data element to be returned (Exception: In the case where an Item is wanted, an index (Fixnum) is used instead).
|
24
24
|
#
|
25
25
|
# === Examples
|
26
26
|
#
|
@@ -29,8 +29,9 @@ module DICOM
|
|
29
29
|
# # Extract the first Item from a Sequence:
|
30
30
|
# first_item = obj["3006,0020"][1]
|
31
31
|
#
|
32
|
-
def [](
|
33
|
-
|
32
|
+
def [](tag_or_index)
|
33
|
+
formatted = tag_or_index.is_a?(String) ? tag_or_index.upcase : tag_or_index
|
34
|
+
return @tags[formatted]
|
34
35
|
end
|
35
36
|
|
36
37
|
# Adds a Element or Sequence instance to self (where self can be either a DObject or an Item).
|
@@ -282,7 +283,7 @@ module DICOM
|
|
282
283
|
# process_name(obj["0010,0010"]) if obj.exists?("0010,0010")
|
283
284
|
#
|
284
285
|
def exists?(tag)
|
285
|
-
if
|
286
|
+
if self[tag]
|
286
287
|
return true
|
287
288
|
else
|
288
289
|
return false
|
@@ -300,7 +301,7 @@ module DICOM
|
|
300
301
|
raise ArgumentError, "Expected String, got #{group_string.class}." unless group_string.is_a?(String)
|
301
302
|
found = Array.new
|
302
303
|
children.each do |child|
|
303
|
-
found << child if child.tag.group == group_string
|
304
|
+
found << child if child.tag.group == group_string.upcase
|
304
305
|
end
|
305
306
|
return found
|
306
307
|
end
|
@@ -597,7 +598,7 @@ module DICOM
|
|
597
598
|
raise ArgumentError, "Expected String or Integer, got #{tag.class}."
|
598
599
|
end
|
599
600
|
# We need to delete the specified child element's parent reference in addition to removing it from the tag Hash.
|
600
|
-
element =
|
601
|
+
element = self[tag]
|
601
602
|
if element
|
602
603
|
element.parent = nil unless options[:no_follow]
|
603
604
|
@tags.delete(tag)
|
@@ -762,10 +763,10 @@ module DICOM
|
|
762
763
|
raise ArgumentError, "Expected String or Integer, got #{tag.class}."
|
763
764
|
end
|
764
765
|
if exists?(tag)
|
765
|
-
if
|
766
|
+
if self[tag].is_parent?
|
766
767
|
raise ArgumentError, "Illegal parameter '#{tag}'. Parent elements, like the referenced '#{@tags[tag].class}', have no value. Only Element tags are valid."
|
767
768
|
else
|
768
|
-
return
|
769
|
+
return self[tag].value
|
769
770
|
end
|
770
771
|
else
|
771
772
|
return nil
|
data/lib/dicom/sequence.rb
CHANGED
data/lib/dicom/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dicom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.
|
5
|
+
version: 0.9.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Christoffer Lervag
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-10-09 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
56
|
+
version: 0.6.0.0
|
57
57
|
type: :development
|
58
58
|
version_requirements: *id004
|
59
59
|
- !ruby/object:Gem::Dependency
|
@@ -64,7 +64,7 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 2.12.0
|
68
68
|
type: :development
|
69
69
|
version_requirements: *id005
|
70
70
|
- !ruby/object:Gem::Dependency
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- lib/dicom/image_processor_r_magick.rb
|
106
106
|
- lib/dicom/item.rb
|
107
107
|
- lib/dicom/link.rb
|
108
|
+
- lib/dicom/logging.rb
|
108
109
|
- lib/dicom/parent.rb
|
109
110
|
- lib/dicom/ruby_extensions.rb
|
110
111
|
- lib/dicom/sequence.rb
|