dcm_dict 0.1.0 → 0.1.1
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/README.md +12 -4
- data/lib/dcm_dict/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fac6d8eb75c82c3f5dae1da9c25d0e71c74327c7
|
4
|
+
data.tar.gz: a9d4c489cd0777f5910a78063a26249905f5001c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a0b68132d053f63fe14f221f8ee83d9953f0e87c3986c70f3026e3c917aad7b2db8c725ac89f94bb9f10b1abf69c302459d9105e644ded8815b53ef95c00c95
|
7
|
+
data.tar.gz: 9255d1c280ae075dde25daf1a1abc47fb0cb7cab3b220d0750570d39ff7504e8fe923f18d55153ed81f604581252534010298f1c7439468abec5a0bb7e19eb9e
|
data/README.md
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# Why *DcmDict*
|
5
5
|
With the latest releases in this year (2014) DICOM documents are available in different format including one particularly interesting, the *DocBook* XML version.
|
6
6
|
As written by D. Clunie on [its web site][2]:
|
7
|
+
|
7
8
|
> "... other formats (such as DocBook, HTML, Word and ODT) are also made available for the convenience of implementors who may need to extract machine-readable content, ..."
|
8
9
|
|
9
10
|
This is great news for anyone involved in the study of the standard !
|
@@ -12,6 +13,7 @@ Starting from this thing was born the idea of trying to automate the extraction
|
|
12
13
|
|
13
14
|
# *DcmDict* features
|
14
15
|
The library involve *String*, *Array* and *Symbol* class as *refinements* to access to DICOM information. In this way is possible to *play* with the 'Patient's Birth Date' tag defined as (0010,0030) by:
|
16
|
+
|
15
17
|
```ruby
|
16
18
|
> "(0010,0030)".tag_name
|
17
19
|
=> "Patient's Birth Date"
|
@@ -32,7 +34,9 @@ The library involve *String*, *Array* and *Symbol* class as *refinements* to acc
|
|
32
34
|
> "Patient's Birth Date".tag_element
|
33
35
|
=> 48
|
34
36
|
```
|
37
|
+
|
35
38
|
as well for UIDs
|
39
|
+
|
36
40
|
```ruby
|
37
41
|
> '1.2.840.10008.1.2'.uid_name
|
38
42
|
=> "Implicit VR Little Endian: Default Transfer Syntax for DICOM"
|
@@ -66,12 +70,14 @@ That's it.
|
|
66
70
|
**Note**: It is possible to use also the the *monkey patching* way, this is a *deprecated* utilization but possible, and, may be, useful technique in certain contexts or for some particular test. For the *monkey patching* is possible to include some specific *common modules* into the class you want to use as "keyword": there are two base modules *DcmDict::Refine::DataElementRefine* and *DcmDict::Refine::UidRefine*.
|
67
71
|
|
68
72
|
For example in the String class will have the code:
|
73
|
+
|
69
74
|
```ruby
|
70
75
|
class String
|
71
76
|
include DcmDict::Refine::DataElementRefine
|
72
77
|
include DcmDict::Refine::UidRefine
|
73
78
|
end
|
74
79
|
```
|
80
|
+
|
75
81
|
*The main way remains **Ruby Refinements***.
|
76
82
|
|
77
83
|
**Rubies compatibility**: at this moment the other considered rubies is only [Rubinius][4] (v2.2.10). In order to try to ensure a minimum compatibility there is a file under *lib/dcm_dict/rubies/* called *rb_ext.rb* able to *mask*/*simulates* the refinements through [refine gem][5] and add the required *bit_length* method to *Fixnum* class through [backports gem][6].
|
@@ -98,8 +104,7 @@ The main methods supported are:
|
|
98
104
|
|**tag_ndm** | tag as in Native DICOM Model|String|
|
99
105
|
|**tag_str** | tag as string (similar to tag_ps)|String|
|
100
106
|
|**tag_note** | tag note|String|
|
101
|
-
|**tag_multiple?** | is a multiple tag ? |boolean|
|
102
|
-
||useful for 'multi tag' attribute|
|
107
|
+
|**tag_multiple?** | is a multiple tag ? |boolean|(useful for 'multi tag' attribute)|
|
103
108
|
|
104
109
|
each data element is indexed by these fields:
|
105
110
|
|
@@ -194,11 +199,12 @@ As an example for this data element the default tag in array form is [0x0020,0x3
|
|
194
199
|
=> :source_image_ids
|
195
200
|
> '00203120'.tag_key
|
196
201
|
=> "SourceImageIDs"
|
197
|
-
|
202
|
+
> [0x0020,0x3138].tag_vr
|
198
203
|
=> [:CS]
|
199
|
-
|
204
|
+
> '(0020,3144)'.tag_note
|
200
205
|
=> "RET"
|
201
206
|
```
|
207
|
+
|
202
208
|
and so on.
|
203
209
|
|
204
210
|
## UID data in detail
|
@@ -236,6 +242,7 @@ For this uid all fields are expressed as:
|
|
236
242
|
|**uid_type** | :sop_class|
|
237
243
|
|
238
244
|
### example:
|
245
|
+
|
239
246
|
```ruby
|
240
247
|
> "Verification SOP Class".uid_value
|
241
248
|
=> "1.2.840.10008.1.1"
|
@@ -268,6 +275,7 @@ Check the file for other details.
|
|
268
275
|
## What's next
|
269
276
|
The main idea is that *dictionary* should include only fixed data defined in the DICOM standard to encode and then make it available in easy way.
|
270
277
|
There are many possible *candidates* for inclusion in the *dictionary*, here are some *"ideas"*:
|
278
|
+
|
271
279
|
- Directory Record type data
|
272
280
|
- Well-known Frames of Reference UID Values
|
273
281
|
- Context Group UID Values
|
data/lib/dcm_dict/version.rb
CHANGED