class DICOM::DictionaryElement
This class handles the various Element
types (data, file meta, directory structuring) found in the DICOM
Data Dictionary.
Attributes
The element's name, e.g. 'SOP Instance UID'.
The element's retired status string, i.e. an empty string or 'R'.
The element's tag, e.g. '0010,0010'.
The element's value multiplicity, e.g. '1', '2-n'.
The element's value representations, e.g. ['UL'], ['US', 'SS'].
Public Class Methods
Creates a new dictionary element.
@param [String] tag the element's tag @param [String] name the element's name @param [Array<String>] vrs the element's value representation(s) @param [String] vm the element's value multiplicity @param [String] retired the element's retired status string
# 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
Public Instance Methods
Checks if the element is private by analyzing its tag string.
@return [Boolean] true if the element is private, and false if not.
# File lib/dicom/dictionary_element.rb, line 39 def private? @tag.private? end
Converts the retired status string to a boolean.
@return [Boolean] true if the element is retired, and false if not.
# File lib/dicom/dictionary_element.rb, line 47 def retired? @retired =~ /R/ ? true : false end
Extracts the first (default) value representation of the element's value representations.
@return [String] the first value representation listed for this particular element
# File lib/dicom/dictionary_element.rb, line 55 def vr @vrs[0] end