dcm_dict 0.32.0 → 0.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +46 -46
- data/bin/dcm_dict_converter.rb +10 -1
- data/lib/dcm_dict/source_data/data_elements_data.rb +5030 -4983
- data/lib/dcm_dict/source_data/uid_values_data.rb +482 -476
- data/lib/dcm_dict/version.rb +2 -2
- data/spec/dcm_dict/dictionary/uid_dictionary_spec.rb +30 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12990da8af18c65a8aff44d249713568517ac86667412ba2af3d972be5940514
|
4
|
+
data.tar.gz: c9ece7e89b43c1375ac3a861c8a8fb7f2668ee55a75336c91d8fe5a78b84410c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fcb4659d88ded3776f9a084e1bdb877f6d1ba3bd77aa97561f7087335c641ed4369023fdae1af3228010ec241dccea38bfe4b45ab63d140cd7c7b115cc8a1fe
|
7
|
+
data.tar.gz: 07bb5b4dc8fe596fc1bb28bf177440b6af8bdf926701bade8602358ed9e75dbc898a4c2f4f1b3f943ffa4f99b6c7bff335e6bc99d5aeac722a5ae682c76722f9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# DcmDict project Changelog
|
2
2
|
|
3
|
+
## v0.36.0 (2021-11-23)
|
4
|
+
* Update to 2021e Base Standard
|
5
|
+
___
|
6
|
+
## v0.35.0 (2021-09-16)
|
7
|
+
* Update to 2021d Base Standard
|
8
|
+
___
|
9
|
+
## v0.34.0 (2021-08-09)
|
10
|
+
* Update to 2021c Base Standard
|
11
|
+
___
|
12
|
+
## v0.33.0 (2021-04-13)
|
13
|
+
* Update to 2021b Base Standard
|
14
|
+
___
|
3
15
|
## v0.32.0 (2021-02-07)
|
4
16
|
* Update to 2021a Base Standard
|
5
17
|
___
|
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* **2021e**
|
291
291
|
|
292
292
|
## Install
|
293
293
|
|
data/bin/dcm_dict_converter.rb
CHANGED
@@ -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|
|