Class: RTP::SiteSetup

Inherits:
Record
  • Object
show all
Defined in:
lib/rtp-connect/site_setup.rb

Overview

Note:

Relations:

  • Parent: Prescription

  • Children: none

The SiteSetup class.

Constant Summary

Constants inherited from Record

Record::NR_SURPLUS_ATTRIBUTES

Instance Attribute Summary collapse

Attributes inherited from Record

#attributes, #crc, #keyword

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Record

#encode, #get_parent, #load, #to_record, #to_s, #values

Constructor Details

#initialize(parent) ⇒ SiteSetup

Creates a new SiteSetup.

Parameters:

  • parent (Record)

    a record which is used to determine the proper parent of this instance



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/rtp-connect/site_setup.rb', line 53

def initialize(parent)
  super('SITE_SETUP_DEF', 5, 25)
  # Parent relation (always expecting a Prescription here):
  @parent = get_parent(parent.to_prescription, Prescription)
  @parent.add_site_setup(self)
  @attributes = [
    # Required:
    :keyword,
    :rx_site_name,
    :patient_orientation,
    :treatment_machine,
    # Optional:
    :tolerance_table,
    :iso_pos_x,
    :iso_pos_y,
    :iso_pos_z,
    :structure_set_uid,
    :frame_of_ref_uid,
    :couch_vertical,
    :couch_lateral,
    :couch_longitudinal,
    :couch_angle,
    :couch_pedestal,
    :table_top_vert_displacement,
    :table_top_long_displacement,
    :table_top_lat_displacement,
    :mrl_coil_name,
    :mrl_coil_index,
    :couch_reference,
    :couch_reference_index,
    :respiratory_motion_compensation_technique,
    :respiratory_signal_source
  ]
end

Instance Attribute Details

#couch_angleObject

Returns the value of attribute couch_angle.



25
26
27
# File 'lib/rtp-connect/site_setup.rb', line 25

def couch_angle
  @couch_angle
end

#couch_lateralObject

Returns the value of attribute couch_lateral.



23
24
25
# File 'lib/rtp-connect/site_setup.rb', line 23

def couch_lateral
  @couch_lateral
end

#couch_longitudinalObject

Returns the value of attribute couch_longitudinal.



24
25
26
# File 'lib/rtp-connect/site_setup.rb', line 24

def couch_longitudinal
  @couch_longitudinal
end

#couch_pedestalObject

Returns the value of attribute couch_pedestal.



26
27
28
# File 'lib/rtp-connect/site_setup.rb', line 26

def couch_pedestal
  @couch_pedestal
end

#couch_referenceObject

Returns the value of attribute couch_reference.



32
33
34
# File 'lib/rtp-connect/site_setup.rb', line 32

def couch_reference
  @couch_reference
end

#couch_reference_indexObject

Returns the value of attribute couch_reference_index.



33
34
35
# File 'lib/rtp-connect/site_setup.rb', line 33

def couch_reference_index
  @couch_reference_index
end

#couch_verticalObject

Returns the value of attribute couch_vertical.



22
23
24
# File 'lib/rtp-connect/site_setup.rb', line 22

def couch_vertical
  @couch_vertical
end

#frame_of_ref_uidObject

Returns the value of attribute frame_of_ref_uid.



21
22
23
# File 'lib/rtp-connect/site_setup.rb', line 21

def frame_of_ref_uid
  @frame_of_ref_uid
end

#iso_pos_xObject

Returns the value of attribute iso_pos_x.



17
18
19
# File 'lib/rtp-connect/site_setup.rb', line 17

def iso_pos_x
  @iso_pos_x
end

#iso_pos_yObject

Returns the value of attribute iso_pos_y.



18
19
20
# File 'lib/rtp-connect/site_setup.rb', line 18

def iso_pos_y
  @iso_pos_y
end

#iso_pos_zObject

Returns the value of attribute iso_pos_z.



19
20
21
# File 'lib/rtp-connect/site_setup.rb', line 19

def iso_pos_z
  @iso_pos_z
end

#mrl_coil_indexObject

Returns the value of attribute mrl_coil_index.



31
32
33
# File 'lib/rtp-connect/site_setup.rb', line 31

def mrl_coil_index
  @mrl_coil_index
end

#mrl_coil_nameObject

Returns the value of attribute mrl_coil_name.



30
31
32
# File 'lib/rtp-connect/site_setup.rb', line 30

def mrl_coil_name
  @mrl_coil_name
end

#parentObject

The Record which this instance belongs to.



12
13
14
# File 'lib/rtp-connect/site_setup.rb', line 12

def parent
  @parent
end

#patient_orientationObject

Returns the value of attribute patient_orientation.



14
15
16
# File 'lib/rtp-connect/site_setup.rb', line 14

def patient_orientation
  @patient_orientation
end

#respiratory_motion_compensation_techniqueObject

Returns the value of attribute respiratory_motion_compensation_technique.



34
35
36
# File 'lib/rtp-connect/site_setup.rb', line 34

def respiratory_motion_compensation_technique
  @respiratory_motion_compensation_technique
end

#respiratory_signal_sourceObject

Returns the value of attribute respiratory_signal_source.



35
36
37
# File 'lib/rtp-connect/site_setup.rb', line 35

def respiratory_signal_source
  @respiratory_signal_source
end

#rx_site_nameObject

Returns the value of attribute rx_site_name.



13
14
15
# File 'lib/rtp-connect/site_setup.rb', line 13

def rx_site_name
  @rx_site_name
end

#structure_set_uidObject

Returns the value of attribute structure_set_uid.



20
21
22
# File 'lib/rtp-connect/site_setup.rb', line 20

def structure_set_uid
  @structure_set_uid
end

#table_top_lat_displacementObject

Returns the value of attribute table_top_lat_displacement.



29
30
31
# File 'lib/rtp-connect/site_setup.rb', line 29

def table_top_lat_displacement
  @table_top_lat_displacement
end

#table_top_long_displacementObject

Returns the value of attribute table_top_long_displacement.



28
29
30
# File 'lib/rtp-connect/site_setup.rb', line 28

def table_top_long_displacement
  @table_top_long_displacement
end

#table_top_vert_displacementObject

Returns the value of attribute table_top_vert_displacement.



27
28
29
# File 'lib/rtp-connect/site_setup.rb', line 27

def table_top_vert_displacement
  @table_top_vert_displacement
end

#tolerance_tableObject

Returns the value of attribute tolerance_table.



16
17
18
# File 'lib/rtp-connect/site_setup.rb', line 16

def tolerance_table
  @tolerance_table
end

#treatment_machineObject

Returns the value of attribute treatment_machine.



15
16
17
# File 'lib/rtp-connect/site_setup.rb', line 15

def treatment_machine
  @treatment_machine
end

Class Method Details

.load(string, parent) ⇒ SiteSetup

Creates a new SiteSetup by parsing a RTPConnect string line.

Parameters:

  • string (#to_s)

    the site setup definition record string line

  • parent (Record)

    a record which is used to determine the proper parent of this instance

Returns:

  • (SiteSetup)

    the created SiteSetup instance

Raises:

  • (ArgumentError)

    if given a string containing an invalid number of elements



44
45
46
47
# File 'lib/rtp-connect/site_setup.rb', line 44

def self.load(string, parent)
  s = self.new(parent)
  s.load(string)
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Checks for equality.

Other and self are considered equivalent if they are of compatible types and their attributes are equivalent.

Parameters:

  • other

    an object to be compared with self.

Returns:

  • (Boolean)

    true if self and other are considered equivalent



96
97
98
99
100
# File 'lib/rtp-connect/site_setup.rb', line 96

def ==(other)
  if other.respond_to?(:to_site_setup)
    other.send(:state) == state
  end
end

#childrenArray

Gives an empty array, as these instances are child-less by definition.

Returns:

  • (Array)

    an emtpy array



108
109
110
# File 'lib/rtp-connect/site_setup.rb', line 108

def children
  return Array.new
end

#hashFixnum

Note:

Two objects with the same attributes will have the same hash code.

Computes a hash code for this object.

Returns:

  • (Fixnum)

    the object’s hash code



118
119
120
# File 'lib/rtp-connect/site_setup.rb', line 118

def hash
  state.hash
end

#to_site_setupSiteSetup

Returns self.

Returns:



126
127
128
# File 'lib/rtp-connect/site_setup.rb', line 126

def to_site_setup
  self
end