class DICOM::UID

This class handles the various UID types (transfer syntax, SOP Class, LDAP OID, etc) found in the DICOM Data Dictionary (Annex A: Registry of DICOM unique identifiers, Table A-1).

Attributes

name[R]

The UID name, e.g. 'Verification SOP Class'.

retired[R]

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

type[R]

The UID type, e.g. 'SOP Class'.

value[R]

The UID value, e.g. '1.2.840.10008.1.1'.

Public Class Methods

new(value, name, type, retired) click to toggle source

Creates a new UID.

@param [String] value the UID's value @param [String] name the UID's name @param [String] type the UID's type @param [String] retired the UID's retired status string

# File lib/dicom/uid.rb, line 25
def initialize(value, name, type, retired)
  @value = value
  @name = name
  @type = type
  @retired = retired
end

Public Instance Methods

big_endian?() click to toggle source

Checks if the UID is a Transfer Syntax that big endian byte order.

@return [Boolean] true if the UID indicates big endian byte order, and false if not

# File lib/dicom/uid.rb, line 36
def big_endian?
  @value == EXPLICIT_BIG_ENDIAN ? true : false
end
compressed_pixels?() click to toggle source

Checks if the UID is a Transfer Syntax that implies compressed pixel data.

@return [Boolean] true if the UID indicates compressed pixel data, and false if not

# File lib/dicom/uid.rb, line 44
def compressed_pixels?
  transfer_syntax? ? (@name =~ /Implicit|Explicit/).nil? : false
end
explicit?() click to toggle source

Checks if the UID is a Transfer Syntax that implies explicit encoding.

@return [Boolean] true if the UID indicates explicit encoding, and false if not

# File lib/dicom/uid.rb, line 52
def explicit?
  transfer_syntax? ? (@name =~ /Implicit/).nil? : false
end
retired?() click to toggle source

Converts the retired status string to a boolean.

@return [Boolean] true if the UID is retired, and false if not

# File lib/dicom/uid.rb, line 60
def retired?
  @retired =~ /R/ ? true : false
end
sop_class?() click to toggle source

Checks if the UID is a SOP Class.

@return [Boolean] true if the UID is of type SOP Class, and false if not

# File lib/dicom/uid.rb, line 68
def sop_class?
  @type =~ /SOP Class/ ? true : false
end
transfer_syntax?() click to toggle source

Checks if the UID is a Transfer Syntax.

@return [Boolean] true if the UID is of type Transfer Syntax, and false if not

# File lib/dicom/uid.rb, line 76
def transfer_syntax?
  @type =~ /Transfer Syntax/ ? true : false
end