def create_beam_limiting_devices(beam_item, field)
      bl_seq = DICOM::Sequence.new('300A,00B6', :parent => beam_item)
      # The ASYMX item ('backup jaws') doesn't exist on all models:
      if ['SYM', 'ASY'].include?(field.field_x_mode.upcase)
        bl_item_x = DICOM::Item.new(:parent => bl_seq)
        DICOM::Element.new('300A,00B8', "ASYMX", :parent => bl_item_x)
        DICOM::Element.new('300A,00BC', "1", :parent => bl_item_x)
      end
      # The ASYMY item is always created:
      bl_item_y = DICOM::Item.new(:parent => bl_seq)
      # RT Beam Limiting Device Type:
      DICOM::Element.new('300A,00B8', "ASYMY", :parent => bl_item_y)
      # Number of Leaf/Jaw Pairs:
      DICOM::Element.new('300A,00BC', "1", :parent => bl_item_y)
      # MLCX item is only created if leaves are defined:
      # (NB: The RTP file doesn't specify leaf position boundaries, so we
      # have to set these based on a set of known MLC types, their number
      # of leaves, and their leaf boundary positions.)
      if field.control_points.length > 0
        bl_item_mlcx = DICOM::Item.new(:parent => bl_seq)
        DICOM::Element.new('300A,00B8', "MLCX", :parent => bl_item_mlcx)
        num_leaves = field.control_points.first.mlc_leaves.to_i
        DICOM::Element.new('300A,00BC', num_leaves.to_s, :parent => bl_item_mlcx)
        DICOM::Element.new('300A,00BE', "#{RTP.leaf_boundaries(num_leaves).join("\\")}", :parent => bl_item_mlcx)
      end
      bl_seq
    end
def create_beam_limiting_devices(beam_item, field)
      bl_seq = DICOM::Sequence.new('300A,00B6', :parent => beam_item)
      # The ASYMX item ('backup jaws') doesn't exist on all models:
      if ['SYM', 'ASY'].include?(field.field_x_mode.upcase)
        bl_item_x = DICOM::Item.new(:parent => bl_seq)
        DICOM::Element.new('300A,00B8', "ASYMX", :parent => bl_item_x)
        DICOM::Element.new('300A,00BC', "1", :parent => bl_item_x)
      end
      # The ASYMY item is always created:
      bl_item_y = DICOM::Item.new(:parent => bl_seq)
      # RT Beam Limiting Device Type:
      DICOM::Element.new('300A,00B8', "ASYMY", :parent => bl_item_y)
      # Number of Leaf/Jaw Pairs:
      DICOM::Element.new('300A,00BC', "1", :parent => bl_item_y)
      # MLCX item is only created if leaves are defined:
      # (NB: The RTP file doesn't specify leaf position boundaries, so we
      # have to set these based on a set of known MLC types, their number
      # of leaves, and their leaf boundary positions.)
      if field.control_points.length > 0
        bl_item_mlcx = DICOM::Item.new(:parent => bl_seq)
        DICOM::Element.new('300A,00B8', "MLCX", :parent => bl_item_mlcx)
        num_leaves = field.control_points.first.mlc_leaves.to_i
        DICOM::Element.new('300A,00BC', num_leaves.to_s, :parent => bl_item_mlcx)
        DICOM::Element.new('300A,00BE', "#{RTP.leaf_boundaries(num_leaves).join("\\")}", :parent => bl_item_mlcx)
      end
      bl_seq
    end
Creates a beam limiting device sequence in the given DICOM object.

 @param [DICOM::Item] beam_item the DICOM beam item in which to insert the sequence
 @param [Field] field the RTP field to fetch device parameters from
 @return [DICOM::Sequence] the constructed beam limiting device sequence