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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/LICENSE +1 -1
  4. data/README.md +47 -47
  5. data/bin/dcm_dict_converter.rb +12 -3
  6. data/lib/dcm_dict/dictionary/base_dictionary.rb +1 -1
  7. data/lib/dcm_dict/dictionary/base_record.rb +1 -1
  8. data/lib/dcm_dict/dictionary/data_element_dictionary.rb +1 -1
  9. data/lib/dcm_dict/dictionary/data_element_record.rb +1 -1
  10. data/lib/dcm_dict/dictionary/uid_record.rb +1 -1
  11. data/lib/dcm_dict/encoder/data_to_code.rb +1 -1
  12. data/lib/dcm_dict/error/dictionary_error.rb +1 -1
  13. data/lib/dcm_dict/ext/object_extension.rb +1 -1
  14. data/lib/dcm_dict/refine/array_refine.rb +1 -1
  15. data/lib/dcm_dict/refine/data_element_refine.rb +1 -1
  16. data/lib/dcm_dict/refine/internal/array_refine_internal.rb +1 -1
  17. data/lib/dcm_dict/refine/internal/hash_refine_internal.rb +1 -1
  18. data/lib/dcm_dict/refine/internal/string_refine_internal.rb +1 -1
  19. data/lib/dcm_dict/refine/string_refine.rb +1 -1
  20. data/lib/dcm_dict/refine/symbol_refine.rb +1 -1
  21. data/lib/dcm_dict/refine/uid_refine.rb +1 -1
  22. data/lib/dcm_dict/rubies/rb_ext.rb +1 -1
  23. data/lib/dcm_dict/source_data/data_elements_data.rb +5048 -4983
  24. data/lib/dcm_dict/source_data/detached_data.rb +1 -1
  25. data/lib/dcm_dict/source_data/uid_values_data.rb +484 -477
  26. data/lib/dcm_dict/version.rb +3 -3
  27. data/lib/dcm_dict/xml/constant.rb +1 -1
  28. data/lib/dcm_dict/xml/field_data.rb +1 -1
  29. data/lib/dcm_dict/xml/nokogiri_tool.rb +1 -1
  30. data/lib/dcm_dict/xml/rexml_tool.rb +1 -1
  31. data/lib/dcm_dict/xml/tag_field_data.rb +1 -1
  32. data/lib/dcm_dict/xml/uid_field_data.rb +1 -1
  33. data/lib/dcm_dict/xml/xml_tool.rb +1 -1
  34. data/lib/dcm_dict.rb +1 -1
  35. data/spec/data_element_sample_spec_helper.rb +1 -1
  36. data/spec/data_element_shared_example_spec_helper.rb +1 -1
  37. data/spec/dcm_dict/dictionary/data_element_dictionary_spec.rb +1 -1
  38. data/spec/dcm_dict/dictionary/data_element_record_spec.rb +1 -1
  39. data/spec/dcm_dict/dictionary/uid_dictionary_spec.rb +30 -0
  40. data/spec/dcm_dict/dictionary/uid_record_spec.rb +1 -1
  41. data/spec/dcm_dict/encoder/data_to_code_spec.rb +1 -1
  42. data/spec/dcm_dict/ext/object_extension_spec.rb +1 -1
  43. data/spec/dcm_dict/refine/array_refine_spec.rb +1 -1
  44. data/spec/dcm_dict/refine/internal/array_refine_internal_spec.rb +1 -1
  45. data/spec/dcm_dict/refine/internal/hash_refine_internal_spec.rb +1 -1
  46. data/spec/dcm_dict/refine/internal/string_refine_internal_spec.rb +1 -1
  47. data/spec/dcm_dict/refine/string_refine_spec.rb +1 -1
  48. data/spec/dcm_dict/refine/symbol_refine_spec.rb +1 -1
  49. data/spec/dcm_dict/rubies/rb_ext_spec.rb +1 -1
  50. data/spec/dcm_dict/source_data/data_elements_data_spec.rb +1 -1
  51. data/spec/dcm_dict/source_data/detached_data_spec.rb +1 -1
  52. data/spec/dcm_dict/source_data/uid_values_data_spec.rb +1 -1
  53. data/spec/dcm_dict/version_spec.rb +1 -1
  54. data/spec/dcm_dict/xml/tag_field_data_spec.rb +1 -1
  55. data/spec/dcm_dict/xml/uid_field_data_spec.rb +1 -1
  56. data/spec/dictionary_shared_example_spec_helper.rb +1 -1
  57. data/spec/refine_shared_example_spec_helper.rb +1 -1
  58. data/spec/spec_helper.rb +1 -1
  59. data/spec/xml_sample_spec_helper.rb +1 -1
  60. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54cb1cbb521a999e12c4f1651266b97f66866e719df0ee02cdda1008ebbadc38
4
- data.tar.gz: ebcc76690fecbeac081481c0c9b2338f6192aef1264e40eb57f7185d1da1626a
3
+ metadata.gz: 720eef7d82c74e43216877a18b747a93497a311b941c225788946ef86a9ef965
4
+ data.tar.gz: 2db5b5ff932943d65e221fb038f26b1753211d1b31558c3193be7780f33cd0b6
5
5
  SHA512:
6
- metadata.gz: 10569d53370dcba56100f1846dd95ac146cb3a20c2093c3e354e1551c7504fa3a380a32151e43f1b293cfa743c7a356ecf8152ea83a2435d2526a865e8a0ef4c
7
- data.tar.gz: 952072006b31e35e005b5da9a93371952f06296a114ecca8c005bc6664ef515d41bc032ae358fd3b0e1a330f6d7a5aca9150e8018de2c00a96bc829022004e55
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-2021 Enrico Rivarola
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 | 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) |
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 | Type |
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 | Value |
182
- |:------------------|:------------------:|
183
- | **tag** | [0x0020,0x3122] |
181
+ | Method/field | Value |
182
+ | :---------------- | :----------------: |
183
+ | **tag** | [0x0020,0x3122] |
184
184
  | **tag_name** | "Source Image IDs" |
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] |
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** | '00203122' |
193
- | **tag_str** | '(0020,3122)' |
194
- | **tag_note** | 'RET' |
195
- | **tag_multiple?** | true |
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 | 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 | |
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** | type of uid | Symbol | |
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 | Value |
252
- |:--------------|:------------------------:|
253
- | **uid** | '1.2.840.10008.1.1' |
254
- | **uid_value** | '1.2.840.10008.1.1' |
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** | "Verification" |
257
- | **uid_sym** | :verification |
258
- | **uid_type** | :sop_class |
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* **2021b**
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-2021 Enrico Rivarola.
313
+ Copyright (C) 2014-2022 Enrico Rivarola.
314
314
  See the `LICENSE` and `COPYING` files for license details.
315
315
 
316
316
  ## Ruby Gem
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # -*- ruby -*-
3
3
  #
4
- # Copyright (C) 2014-2021 Enrico Rivarola
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-2021 Enrico Rivarola
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|
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
  #
3
- # Copyright (C) 2014-2021 Enrico Rivarola
3
+ # Copyright (C) 2014-2022 Enrico Rivarola
4
4
  #
5
5
  # This file is part of DcmDict gem (dcm_dict).
6
6
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (C) 2014-2021 Enrico Rivarola
2
+ # Copyright (C) 2014-2022 Enrico Rivarola
3
3
  #
4
4
  # This file is part of DcmDict gem (dcm_dict).
5
5
  #