Class: RTKIT::Series
- Inherits:
-
Object
- Object
- RTKIT::Series
- Defined in:
- lib/rtkit/series.rb
Overview
Contains the DICOM data and methods related to a series.
Relations
-
A Series belongs to a Study.
-
Some types of Series (e.g. CT, MR) have many Image instances.
Direct Known Subclasses
DoseVolume, ImageSeries, Plan, RTDose, RTImage, StructureSet
Instance Attribute Summary collapse
-
#class_uid ⇒ Object
readonly
The SOP Class UID.
-
#date ⇒ Object
readonly
The Series Date.
-
#description ⇒ Object
readonly
The Series Description.
-
#modality ⇒ Object
readonly
The Modality of the Series.
-
#series_uid ⇒ Object
readonly
The Series Instance UID.
-
#study ⇒ Object
readonly
The Series’s Study reference.
-
#time ⇒ Object
readonly
The Series Time.
Instance Method Summary collapse
-
#image_modality? ⇒ Boolean
Returns true if the series is of a modality which means it contains multiple images (CT, MR, RTImage, RTDose).
-
#initialize(series_uid, modality, study, options = {}) ⇒ Series
constructor
Creates a new Series instance.
-
#uid ⇒ Object
Returns the unique identifier string, which for an ImageSeries is the Series Instance UID, and for the other types of Series (e.g. StructureSet, Plan, etc) it is the SOP Instance UID.
Constructor Details
#initialize(series_uid, modality, study, options = {}) ⇒ Series
Creates a new Series instance. The Series Instance UID string is used to uniquely identify a Series.
Parameters
-
series_uid
– The Series Instance UID string. -
modality
– The Modality string of the Series, e.g. ‘CT’ or ‘RTSTRUCT’. -
study
– The Study instance that this Series belongs to. -
options
– A hash of parameters.
Options
-
:class_uid
– String. The SOP Class UID (DICOM tag ‘0008,0016’). -
:date
– String. The Series Date (DICOM tag ‘0008,0021’). -
:time
– String. The Series Time (DICOM tag ‘0008,0031’). -
:description
– String. The Series Description (DICOM tag ‘0008,103E’).
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/rtkit/series.rb', line 43 def initialize(series_uid, modality, study, ={}) raise ArgumentError, "Invalid argument 'uid'. Expected String, got #{series_uid.class}." unless series_uid.is_a?(String) raise ArgumentError, "Invalid argument 'modality'. Expected String, got #{modality.class}." unless modality.is_a?(String) raise ArgumentError, "Invalid argument 'study'. Expected Study, got #{study.class}." unless study.is_a?(Study) # Key attributes: @series_uid = series_uid @modality = modality @study = study # Optional attributes: @class_uid = [:class_uid] @date = [:date] @time = [:time] @description = [:description] end |
Instance Attribute Details
#class_uid ⇒ Object (readonly)
The SOP Class UID.
13 14 15 |
# File 'lib/rtkit/series.rb', line 13 def class_uid @class_uid end |
#date ⇒ Object (readonly)
The Series Date.
15 16 17 |
# File 'lib/rtkit/series.rb', line 15 def date @date end |
#description ⇒ Object (readonly)
The Series Description.
17 18 19 |
# File 'lib/rtkit/series.rb', line 17 def description @description end |
#modality ⇒ Object (readonly)
The Modality of the Series.
19 20 21 |
# File 'lib/rtkit/series.rb', line 19 def modality @modality end |
#series_uid ⇒ Object (readonly)
The Series Instance UID.
23 24 25 |
# File 'lib/rtkit/series.rb', line 23 def series_uid @series_uid end |
#study ⇒ Object (readonly)
The Series’s Study reference.
21 22 23 |
# File 'lib/rtkit/series.rb', line 21 def study @study end |
#time ⇒ Object (readonly)
The Series Time.
25 26 27 |
# File 'lib/rtkit/series.rb', line 25 def time @time end |
Instance Method Details
#image_modality? ⇒ Boolean
Returns true if the series is of a modality which means it contains multiple images (CT, MR, RTImage, RTDose). Returns false if not.
61 62 63 64 65 66 67 |
# File 'lib/rtkit/series.rb', line 61 def image_modality? if IMAGE_MODALITIES.include?(@modality) return true else return false end end |
#uid ⇒ Object
Returns the unique identifier string, which for an ImageSeries is the Series Instance UID, and for the other types of Series (e.g. StructureSet, Plan, etc) it is the SOP Instance UID.
72 73 74 |
# File 'lib/rtkit/series.rb', line 72 def uid return @sop_uid || @series_uid end |