Class: DICOM::UID
- Inherits:
-
Object
- Object
- DICOM::UID
- Defined in:
- lib/dicom/uid.rb
Overview
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).
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The UID name, e.g.
-
#retired ⇒ Object
readonly
The UID’s retired status string, i.e.
-
#type ⇒ Object
readonly
The UID type, e.g.
-
#value ⇒ Object
readonly
The UID value, e.g.
Instance Method Summary collapse
-
#big_endian? ⇒ Boolean
Checks if the UID is a Transfer Syntax that big endian byte order.
-
#compressed_pixels? ⇒ Boolean
Checks if the UID is a Transfer Syntax that implies compressed pixel data.
-
#explicit? ⇒ Boolean
Checks if the UID is a Transfer Syntax that implies explicit encoding.
-
#initialize(value, name, type, retired) ⇒ UID
constructor
Creates a new UID.
-
#retired? ⇒ Boolean
Converts the retired status string to a boolean.
-
#sop_class? ⇒ Boolean
Checks if the UID is a SOP Class.
-
#transfer_syntax? ⇒ Boolean
Checks if the UID is a Transfer Syntax.
Constructor Details
#initialize(value, name, type, retired) ⇒ UID
Creates a new UID.
25 26 27 28 29 30 |
# File 'lib/dicom/uid.rb', line 25 def initialize(value, name, type, retired) @value = value @name = name @type = type @retired = retired end |
Instance Attribute Details
#name ⇒ Object (readonly)
The UID name, e.g. ‘Verification SOP Class’.
10 11 12 |
# File 'lib/dicom/uid.rb', line 10 def name @name end |
#retired ⇒ Object (readonly)
The UID’s retired status string, i.e. an empty string or ‘R’.
12 13 14 |
# File 'lib/dicom/uid.rb', line 12 def retired @retired end |
#type ⇒ Object (readonly)
The UID type, e.g. ‘SOP Class’.
14 15 16 |
# File 'lib/dicom/uid.rb', line 14 def type @type end |
#value ⇒ Object (readonly)
The UID value, e.g. ‘1.2.840.10008.1.1’.
16 17 18 |
# File 'lib/dicom/uid.rb', line 16 def value @value end |
Instance Method Details
#big_endian? ⇒ Boolean
Checks if the UID is a Transfer Syntax that big endian byte order.
36 37 38 |
# File 'lib/dicom/uid.rb', line 36 def big_endian? @value == EXPLICIT_BIG_ENDIAN ? true : false end |
#compressed_pixels? ⇒ Boolean
Checks if the UID is a Transfer Syntax that implies compressed pixel data.
44 45 46 |
# File 'lib/dicom/uid.rb', line 44 def compressed_pixels? transfer_syntax? ? (@name =~ /Implicit|Explicit/).nil? : false end |
#explicit? ⇒ Boolean
Checks if the UID is a Transfer Syntax that implies explicit encoding.
52 53 54 |
# File 'lib/dicom/uid.rb', line 52 def explicit? transfer_syntax? ? (@name =~ /Implicit/).nil? : false end |
#retired? ⇒ Boolean
Converts the retired status string to a boolean.
60 61 62 |
# File 'lib/dicom/uid.rb', line 60 def retired? @retired =~ /R/ ? true : false end |
#sop_class? ⇒ Boolean
Checks if the UID is a SOP Class.
68 69 70 |
# File 'lib/dicom/uid.rb', line 68 def sop_class? @type =~ /SOP Class/ ? true : false end |
#transfer_syntax? ⇒ Boolean
Checks if the UID is a Transfer Syntax.
76 77 78 |
# File 'lib/dicom/uid.rb', line 76 def transfer_syntax? @type =~ /Transfer Syntax/ ? true : false end |