def to_item
      # FIXME: We need to decide on how to principally handle the situation when an image series has not been
      # loaded, and how to set up the ROI slices. A possible solution is to create Image instances if they hasn't been loaded.
      item = DICOM::Item.new
      item.add(DICOM::Sequence.new(CONTOUR_IMAGE_SQ))
      item[CONTOUR_IMAGE_SQ].add_item
      item[CONTOUR_IMAGE_SQ][0].add(DICOM::Element.new(REF_SOP_CLASS_UID, @slice.image ? @slice.image.series.class_uid : '1.2.840.10008.5.1.4.1.1.2')) # Deafult to CT if image ref. doesn't exist.
      item[CONTOUR_IMAGE_SQ][0].add(DICOM::Element.new(REF_SOP_UID, @slice.uid))
      item.add(DICOM::Element.new(CONTOUR_GEO_TYPE, @type))
      item.add(DICOM::Element.new(NR_CONTOUR_POINTS, @coordinates.length.to_s))
      item.add(DICOM::Element.new(CONTOUR_NUMBER, @number.to_s))
      item.add(DICOM::Element.new(CONTOUR_DATA, contour_data))
      return item
    end
def to_item
      # FIXME: We need to decide on how to principally handle the situation when an image series has not been
      # loaded, and how to set up the ROI slices. A possible solution is to create Image instances if they hasn't been loaded.
      item = DICOM::Item.new
      item.add(DICOM::Sequence.new(CONTOUR_IMAGE_SQ))
      item[CONTOUR_IMAGE_SQ].add_item
      item[CONTOUR_IMAGE_SQ][0].add(DICOM::Element.new(REF_SOP_CLASS_UID, @slice.image ? @slice.image.series.class_uid : '1.2.840.10008.5.1.4.1.1.2')) # Deafult to CT if image ref. doesn't exist.
      item[CONTOUR_IMAGE_SQ][0].add(DICOM::Element.new(REF_SOP_UID, @slice.uid))
      item.add(DICOM::Element.new(CONTOUR_GEO_TYPE, @type))
      item.add(DICOM::Element.new(NR_CONTOUR_POINTS, @coordinates.length.to_s))
      item.add(DICOM::Element.new(CONTOUR_NUMBER, @number.to_s))
      item.add(DICOM::Element.new(CONTOUR_DATA, contour_data))
      return item
    end
Creates a Contour Sequence Item from the attributes of the Contour.

 @return [DICOM::Item] the created DICOM item