class DICOM::DictionaryElement

This class handles the various Element types (data, file meta, directory structuring) found in the DICOM Data Dictionary.

Attributes

name[R]

The element's name, e.g. 'SOP Instance UID'.

retired[R]

The element's retired status string, i.e. an empty string or 'R'.

tag[R]

The element's tag, e.g. '0010,0010'.

vm[R]

The element's value multiplicity, e.g. '1', '2-n'.

vrs[R]

The element's value representations, e.g. ['UL'], ['US', 'SS'].

Public Class Methods

new(tag, name, vrs, vm, retired) click to toggle source

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

private?() click to toggle source

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
retired?() click to toggle source

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
vr() click to toggle source

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