dcm_dict 0.33.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/LICENSE +1 -1
- data/README.md +47 -47
- data/bin/dcm_dict_converter.rb +12 -3
- data/lib/dcm_dict/dictionary/base_dictionary.rb +1 -1
- data/lib/dcm_dict/dictionary/base_record.rb +1 -1
- data/lib/dcm_dict/dictionary/data_element_dictionary.rb +1 -1
- data/lib/dcm_dict/dictionary/data_element_record.rb +1 -1
- data/lib/dcm_dict/dictionary/uid_record.rb +1 -1
- data/lib/dcm_dict/encoder/data_to_code.rb +1 -1
- data/lib/dcm_dict/error/dictionary_error.rb +1 -1
- data/lib/dcm_dict/ext/object_extension.rb +1 -1
- data/lib/dcm_dict/refine/array_refine.rb +1 -1
- data/lib/dcm_dict/refine/data_element_refine.rb +1 -1
- data/lib/dcm_dict/refine/internal/array_refine_internal.rb +1 -1
- data/lib/dcm_dict/refine/internal/hash_refine_internal.rb +1 -1
- data/lib/dcm_dict/refine/internal/string_refine_internal.rb +1 -1
- data/lib/dcm_dict/refine/string_refine.rb +1 -1
- data/lib/dcm_dict/refine/symbol_refine.rb +1 -1
- data/lib/dcm_dict/refine/uid_refine.rb +1 -1
- data/lib/dcm_dict/rubies/rb_ext.rb +1 -1
- data/lib/dcm_dict/source_data/data_elements_data.rb +5048 -4983
- data/lib/dcm_dict/source_data/detached_data.rb +1 -1
- data/lib/dcm_dict/source_data/uid_values_data.rb +484 -477
- data/lib/dcm_dict/version.rb +3 -3
- data/lib/dcm_dict/xml/constant.rb +1 -1
- data/lib/dcm_dict/xml/field_data.rb +1 -1
- data/lib/dcm_dict/xml/nokogiri_tool.rb +1 -1
- data/lib/dcm_dict/xml/rexml_tool.rb +1 -1
- data/lib/dcm_dict/xml/tag_field_data.rb +1 -1
- data/lib/dcm_dict/xml/uid_field_data.rb +1 -1
- data/lib/dcm_dict/xml/xml_tool.rb +1 -1
- data/lib/dcm_dict.rb +1 -1
- data/spec/data_element_sample_spec_helper.rb +1 -1
- data/spec/data_element_shared_example_spec_helper.rb +1 -1
- data/spec/dcm_dict/dictionary/data_element_dictionary_spec.rb +1 -1
- data/spec/dcm_dict/dictionary/data_element_record_spec.rb +1 -1
- data/spec/dcm_dict/dictionary/uid_dictionary_spec.rb +30 -0
- data/spec/dcm_dict/dictionary/uid_record_spec.rb +1 -1
- data/spec/dcm_dict/encoder/data_to_code_spec.rb +1 -1
- data/spec/dcm_dict/ext/object_extension_spec.rb +1 -1
- data/spec/dcm_dict/refine/array_refine_spec.rb +1 -1
- data/spec/dcm_dict/refine/internal/array_refine_internal_spec.rb +1 -1
- data/spec/dcm_dict/refine/internal/hash_refine_internal_spec.rb +1 -1
- data/spec/dcm_dict/refine/internal/string_refine_internal_spec.rb +1 -1
- data/spec/dcm_dict/refine/string_refine_spec.rb +1 -1
- data/spec/dcm_dict/refine/symbol_refine_spec.rb +1 -1
- data/spec/dcm_dict/rubies/rb_ext_spec.rb +1 -1
- data/spec/dcm_dict/source_data/data_elements_data_spec.rb +1 -1
- data/spec/dcm_dict/source_data/detached_data_spec.rb +1 -1
- data/spec/dcm_dict/source_data/uid_values_data_spec.rb +1 -1
- data/spec/dcm_dict/version_spec.rb +1 -1
- data/spec/dcm_dict/xml/tag_field_data_spec.rb +1 -1
- data/spec/dcm_dict/xml/uid_field_data_spec.rb +1 -1
- data/spec/dictionary_shared_example_spec_helper.rb +1 -1
- data/spec/refine_shared_example_spec_helper.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/xml_sample_spec_helper.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 720eef7d82c74e43216877a18b747a93497a311b941c225788946ef86a9ef965
|
|
4
|
+
data.tar.gz: 2db5b5ff932943d65e221fb038f26b1753211d1b31558c3193be7780f33cd0b6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f41f34fab029c15a51cc6d353efd76882b7b31adc5f1dd3a31cf04cc594dad6989ffacf6a0cc5bef4e75c4efb9282ae004eb460bdab5427cdc184378bef1a9d2
|
|
7
|
+
data.tar.gz: fba1f1b445f082323013b8a7f2853bf1fe79c76ca15804fd5e368439f879b58b7f89cee57c87859de7a07de7eaf78c3532cfa29858f329c485b497f1024a9062
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# DcmDict project Changelog
|
|
2
2
|
|
|
3
|
+
## v0.37.0 (2022-01-30)
|
|
4
|
+
* Update to 2022a Base Standard
|
|
5
|
+
___
|
|
6
|
+
## v0.36.0 (2021-11-23)
|
|
7
|
+
* Update to 2021e Base Standard
|
|
8
|
+
___
|
|
9
|
+
## v0.35.0 (2021-09-16)
|
|
10
|
+
* Update to 2021d Base Standard
|
|
11
|
+
___
|
|
12
|
+
## v0.34.0 (2021-08-09)
|
|
13
|
+
* Update to 2021c Base Standard
|
|
14
|
+
___
|
|
3
15
|
## v0.33.0 (2021-04-13)
|
|
4
16
|
* Update to 2021b Base Standard
|
|
5
17
|
___
|
data/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
DcmDict is a Ruby gem (dcm_dict) to handle
|
|
2
2
|
in a simple way the Data defined within the DICOM Standard.
|
|
3
3
|
|
|
4
|
-
Copyright (C) 2014-
|
|
4
|
+
Copyright (C) 2014-2022 Enrico Rivarola
|
|
5
5
|
|
|
6
6
|
DcmDict is free software: you can redistribute it and/or modify
|
|
7
7
|
it under the terms of the GNU General Public License as published by
|
data/README.md
CHANGED
|
@@ -100,26 +100,26 @@ For these objects is possible to access to Tag (group/element), Name, Keyword, V
|
|
|
100
100
|
|
|
101
101
|
The main methods supported are:
|
|
102
102
|
|
|
103
|
-
| Method |
|
|
104
|
-
|
|
105
|
-
| **tag** |
|
|
106
|
-
| **tag_name** |
|
|
107
|
-
| **tag_keyword** |
|
|
108
|
-
| **tag_key** |
|
|
109
|
-
| **tag_vr** |
|
|
110
|
-
| **tag_vm** |
|
|
111
|
-
| **tag_ps** |
|
|
112
|
-
| **tag_ary** |
|
|
113
|
-
| **tag_sym** |
|
|
114
|
-
| **tag_ndm** |
|
|
115
|
-
| **tag_str** | tag as string (similar to tag_ps) |
|
|
116
|
-
| **tag_note** |
|
|
117
|
-
| **tag_multiple?** |
|
|
103
|
+
| Method | Note | Type | |
|
|
104
|
+
| :---------------- | :-------------------------------: | :-----------------: | :--------------------------------: |
|
|
105
|
+
| **tag** | tag as Array | Array of two Fixnum | (alias of *tag_ary*) |
|
|
106
|
+
| **tag_name** | name of tag | String | |
|
|
107
|
+
| **tag_keyword** | keyword | String | |
|
|
108
|
+
| **tag_key** | keyword | String | |
|
|
109
|
+
| **tag_vr** | Value Representation | Array of Symbol | |
|
|
110
|
+
| **tag_vm** | Value Multiplicity | Array of Symbol | |
|
|
111
|
+
| **tag_ps** | tag as string (as standard doc) | String | |
|
|
112
|
+
| **tag_ary** | tag as Array | Array of two Fixnum | |
|
|
113
|
+
| **tag_sym** | tag as Symbol | Symbol | |
|
|
114
|
+
| **tag_ndm** | tag as in Native DICOM Model | String | |
|
|
115
|
+
| **tag_str** | tag as string (similar to tag_ps) | String | |
|
|
116
|
+
| **tag_note** | tag note | String | |
|
|
117
|
+
| **tag_multiple?** | is a multiple tag ? | boolean | (useful for 'multi tag' attribute) |
|
|
118
118
|
|
|
119
119
|
each data element is indexed by these fields:
|
|
120
120
|
|
|
121
|
-
| Field |
|
|
122
|
-
|
|
121
|
+
| Field | Type |
|
|
122
|
+
| :----------- | :----: |
|
|
123
123
|
| **tag_key** | String |
|
|
124
124
|
| **tag_ps** | String |
|
|
125
125
|
| **tag_ary** | Array |
|
|
@@ -178,21 +178,21 @@ will produce
|
|
|
178
178
|
The library also manage 'multiple tags' such as *(0020,31XX)* (*Source Image IDs*).
|
|
179
179
|
As an example for this data element the default tag in array form is [0x0020,0x3122] and all fields are expressed as:
|
|
180
180
|
|
|
181
|
-
| Method/field |
|
|
182
|
-
|
|
183
|
-
| **tag** |
|
|
181
|
+
| Method/field | Value |
|
|
182
|
+
| :---------------- | :----------------: |
|
|
183
|
+
| **tag** | [0x0020,0x3122] |
|
|
184
184
|
| **tag_name** | "Source Image IDs" |
|
|
185
|
-
| **tag_keyword** |
|
|
186
|
-
| **tag_key** |
|
|
187
|
-
| **tag_vr** |
|
|
188
|
-
| **tag_vm** |
|
|
189
|
-
| **tag_ps** |
|
|
190
|
-
| **tag_ary** |
|
|
185
|
+
| **tag_keyword** | 'SourceImageIDs' |
|
|
186
|
+
| **tag_key** | 'SourceImageIDs' |
|
|
187
|
+
| **tag_vr** | [:CS] |
|
|
188
|
+
| **tag_vm** | ["1-n"] |
|
|
189
|
+
| **tag_ps** | '(0020,31XX)' |
|
|
190
|
+
| **tag_ary** | [0x0020,0x3122] |
|
|
191
191
|
| **tag_sym** | :source_image_ids |
|
|
192
|
-
| **tag_ndm** |
|
|
193
|
-
| **tag_str** |
|
|
194
|
-
| **tag_note** |
|
|
195
|
-
| **tag_multiple?** |
|
|
192
|
+
| **tag_ndm** | '00203122' |
|
|
193
|
+
| **tag_str** | '(0020,3122)' |
|
|
194
|
+
| **tag_note** | 'RET' |
|
|
195
|
+
| **tag_multiple?** | true |
|
|
196
196
|
|
|
197
197
|
[0x0020,0x3122] is the default value for group/element pair (*[32, 12578]*), but any valid pair of numbers for this tag will be refers that information:
|
|
198
198
|
|
|
@@ -224,19 +224,19 @@ Any UID features can be accessed from a *String* or a *Symbol* object.
|
|
|
224
224
|
For these objects is possible to access to value, name and type values for any single uid.
|
|
225
225
|
Main methods supported are:
|
|
226
226
|
|
|
227
|
-
| Method |
|
|
228
|
-
|
|
229
|
-
| **uid** |
|
|
230
|
-
| **uid_value** |
|
|
231
|
-
| **uid_name** |
|
|
232
|
-
| **uid_key** |
|
|
227
|
+
| Method | Note | Type | |
|
|
228
|
+
| :------------ | :----------------------: | :----: | :--------------------: |
|
|
229
|
+
| **uid** | value of uid | String | (alias of *uid_value*) |
|
|
230
|
+
| **uid_value** | value of uid | String | |
|
|
231
|
+
| **uid_name** | name of uid | String | |
|
|
232
|
+
| **uid_key** | keyword of uid | String | |
|
|
233
233
|
| **uid_sym** | keyword as symbol of uid | Symbol | |
|
|
234
|
-
| **uid_type** |
|
|
234
|
+
| **uid_type** | type of uid | Symbol | |
|
|
235
235
|
|
|
236
236
|
each uid is indexed by:
|
|
237
237
|
|
|
238
238
|
| Field | Type |
|
|
239
|
-
|
|
239
|
+
| :------------ | :----- |
|
|
240
240
|
| **uid_value** | String |
|
|
241
241
|
| **uid_name** | String |
|
|
242
242
|
| **uid_key** | String |
|
|
@@ -248,14 +248,14 @@ Consider the case of the uid *1.2.840.10008.1.1* (*Verification SOP Class*), the
|
|
|
248
248
|
|
|
249
249
|
For this uid all fields are expressed as:
|
|
250
250
|
|
|
251
|
-
| Method/field |
|
|
252
|
-
|
|
253
|
-
| **uid** |
|
|
254
|
-
| **uid_value** |
|
|
251
|
+
| Method/field | Value |
|
|
252
|
+
| :------------ | :----------------------: |
|
|
253
|
+
| **uid** | '1.2.840.10008.1.1' |
|
|
254
|
+
| **uid_value** | '1.2.840.10008.1.1' |
|
|
255
255
|
| **uid_name** | "Verification SOP Class" |
|
|
256
|
-
| **uid_key** |
|
|
257
|
-
| **uid_sym** |
|
|
258
|
-
| **uid_type** |
|
|
256
|
+
| **uid_key** | "Verification" |
|
|
257
|
+
| **uid_sym** | :verification |
|
|
258
|
+
| **uid_type** | :sop_class |
|
|
259
259
|
|
|
260
260
|
### example:
|
|
261
261
|
|
|
@@ -287,7 +287,7 @@ Note: the script use the [Nokogiri][3] as XML parser if installed as gem, otherw
|
|
|
287
287
|
Check the file for other details.
|
|
288
288
|
|
|
289
289
|
## Note
|
|
290
|
-
Current library version is aligned to *DICOM Base Standard* **
|
|
290
|
+
Current library version is aligned to *DICOM Base Standard* **2022a**
|
|
291
291
|
|
|
292
292
|
## Install
|
|
293
293
|
|
|
@@ -310,7 +310,7 @@ There are many possible *candidates* for inclusion in the *dictionary*, here are
|
|
|
310
310
|
TBD
|
|
311
311
|
|
|
312
312
|
## License
|
|
313
|
-
Copyright (C) 2014-
|
|
313
|
+
Copyright (C) 2014-2022 Enrico Rivarola.
|
|
314
314
|
See the `LICENSE` and `COPYING` files for license details.
|
|
315
315
|
|
|
316
316
|
## Ruby Gem
|
data/bin/dcm_dict_converter.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
# -*- ruby -*-
|
|
3
3
|
#
|
|
4
|
-
# Copyright (C) 2014-
|
|
4
|
+
# Copyright (C) 2014-2022 Enrico Rivarola
|
|
5
5
|
#
|
|
6
6
|
# This file is part of DcmDict gem (dcm_dict).
|
|
7
7
|
#
|
|
@@ -29,7 +29,7 @@ require 'dcm_dict'
|
|
|
29
29
|
require 'dcm_dict/xml/xml_tool'
|
|
30
30
|
|
|
31
31
|
LICENSE_TEXT=<<END_LICENSE
|
|
32
|
-
Copyright (C) 2014-
|
|
32
|
+
Copyright (C) 2014-2022 Enrico Rivarola
|
|
33
33
|
|
|
34
34
|
This file is part of DcmDict gem (dcm_dict).
|
|
35
35
|
|
|
@@ -62,7 +62,11 @@ class DcmDictConverter
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
UidSource={
|
|
65
|
-
Part6XmlUrl => ["table_A-1"]
|
|
65
|
+
Part6XmlUrl => ["table_A-1", "table_A-2"]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
UidDataFix={
|
|
69
|
+
"table_A-2" => {:uid_type => :well_known_frame_of_reference}
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
DataElementFix = {
|
|
@@ -145,10 +149,15 @@ class DcmDictConverter
|
|
|
145
149
|
def extract_uid(xml_file, table_to_map)
|
|
146
150
|
extract_node_set(xml_file, table_to_map) do |table, td|
|
|
147
151
|
data = DcmDict::XML::XmlTool.extract_uid_field_from_tr_set(td)
|
|
152
|
+
check_uid_data(data, table)
|
|
148
153
|
yield(data) if block_given?
|
|
149
154
|
end
|
|
150
155
|
end
|
|
151
156
|
|
|
157
|
+
def check_uid_data(data, table)
|
|
158
|
+
data.merge!(UidDataFix.fetch(table, {}))
|
|
159
|
+
end
|
|
160
|
+
|
|
152
161
|
def print_out_uid_data()
|
|
153
162
|
print_out(DcmDict::Encoder::DataToCode.uid_header)
|
|
154
163
|
UidSource.each do |url, table_to_map|
|