Method: RTKIT::Setup#initialize

Defined in:
lib/rtkit/setup.rb

#initialize(position, number, plan, options = {}) ⇒ Setup

Creates a new Setup instance.

Parameters

  • position – String. The patient position (orientation).

  • number – Integer. The Setup number.

  • plan – The Plan instance that this Beam belongs to.

  • options – A hash of parameters.

Options

  • :technique – String. Setup technique.

  • :offset_vertical – Float. Table top vertical setup displacement.

  • :offset_longitudinal – Float. Table top longitudinal setup displacement.

  • :offset_lateral – Float. Table top lateral setup displacement.

Raises:

  • (ArgumentError)


66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/rtkit/setup.rb', line 66

def initialize(position, number, plan, options={})
  raise ArgumentError, "Invalid argument 'plan'. Expected Plan, got #{plan.class}." unless plan.is_a?(Plan)
  # Set values:
  self.position = position
  self.number = number
  # Set options:
  self.technique = options[:technique] if options[:technique]
  self.offset_vertical = options[:offset_vertical] if options[:offset_vertical]
  self.offset_longitudinal = options[:offset_longitudinal] if options[:offset_longitudinal]
  self.offset_lateral = options[:offset_lateral] if options[:offset_lateral]
  # Set references:
  @plan = plan
  # Register ourselves with the Plan:
  @plan.add_setup(self)
end