Method: RTKIT::Slice#initialize

Defined in:
lib/rtkit/slice.rb

#initialize(sop_uid, roi) ⇒ Slice

Creates a new Slice instance.

Parameters

  • sop_uid – The SOP Instance UID reference for this slice.

  • contour_item – An array of contour items from the Contour Sequence in ROI Contour Sequence, belonging to the same slice.

  • roi – The ROI instance that this Slice belongs to.

Raises:

  • (ArgumentError)


53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/rtkit/slice.rb', line 53

def initialize(sop_uid, roi)
  raise ArgumentError, "Invalid argument 'sop_uid'. Expected String, got #{sop_uid.class}." unless sop_uid.is_a?(String)
  raise ArgumentError, "Invalid argument 'roi'. Expected ROI, got #{roi.class}." unless roi.is_a?(ROI)
  # Key attributes:
  @contours = Array.new
  @uid = sop_uid
  @roi = roi
  # Set up the Image reference:
  @image = roi.frame.image(@uid)
  # Register ourselves with the ROI:
  @roi.add_slice(self)
end