Class: DICOM::DictionaryElement
- Inherits:
-
Object
- Object
- DICOM::DictionaryElement
- Defined in:
- lib/dicom/dictionary_element.rb
Overview
This class handles the various Element types (data, file meta, directory structuring) found in the DICOM Data Dictionary.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The element’s name, e.g.
-
#retired ⇒ Object
readonly
The element’s retired status string, i.e.
-
#tag ⇒ Object
readonly
The element’s tag, e.g.
-
#vm ⇒ Object
readonly
The element’s value multiplicity, e.g.
-
#vrs ⇒ Object
readonly
The element’s value representations, e.g.
Instance Method Summary collapse
-
#initialize(tag, name, vrs, vm, retired) ⇒ DictionaryElement
constructor
Creates a new dictionary element.
-
#private? ⇒ Boolean
Checks if the element is private by analyzing its tag string.
-
#retired? ⇒ Boolean
Converts the retired status string to a boolean.
-
#vr ⇒ String
Extracts the first (default) value representation of the element’s value representations.
Constructor Details
#initialize(tag, name, vrs, vm, retired) ⇒ DictionaryElement
Creates a new dictionary element.
27 28 29 30 31 32 33 |
# File 'lib/dicom/dictionary_element.rb', line 27 def initialize(tag, name, vrs, vm, retired) @tag = tag @name = name @vrs = vrs @vm = vm @retired = retired end |
Instance Attribute Details
#name ⇒ Object (readonly)
The element’s name, e.g. ‘SOP Instance UID’.
9 10 11 |
# File 'lib/dicom/dictionary_element.rb', line 9 def name @name end |
#retired ⇒ Object (readonly)
The element’s retired status string, i.e. an empty string or ‘R’.
11 12 13 |
# File 'lib/dicom/dictionary_element.rb', line 11 def retired @retired end |
#tag ⇒ Object (readonly)
The element’s tag, e.g. ‘0010,0010’.
13 14 15 |
# File 'lib/dicom/dictionary_element.rb', line 13 def tag @tag end |
#vm ⇒ Object (readonly)
The element’s value multiplicity, e.g. ‘1’, ‘2-n’.
15 16 17 |
# File 'lib/dicom/dictionary_element.rb', line 15 def vm @vm end |
#vrs ⇒ Object (readonly)
The element’s value representations, e.g. [‘UL’], [‘US’, ‘SS’].
17 18 19 |
# File 'lib/dicom/dictionary_element.rb', line 17 def vrs @vrs end |
Instance Method Details
#private? ⇒ Boolean
Checks if the element is private by analyzing its tag string.
39 40 41 |
# File 'lib/dicom/dictionary_element.rb', line 39 def private? @tag.private? end |
#retired? ⇒ Boolean
Converts the retired status string to a boolean.
47 48 49 |
# File 'lib/dicom/dictionary_element.rb', line 47 def retired? @retired =~ /R/ ? true : false end |
#vr ⇒ String
Extracts the first (default) value representation of the element’s value representations.
55 56 57 |
# File 'lib/dicom/dictionary_element.rb', line 55 def vr @vrs[0] end |