def attach_to(series)
      raise ArgumentError, "Invalid argument 'series'. Expected ImageSeries, got #{series.class}." unless series.is_a?(Series)
      # Change struct association if indicated:
      if series.struct != @struct
        @struct.remove_structure(self)
        StructureSet.new(RTKIT.series_uid, series) unless series.struct
        series.struct.add_roi(self)
        @struct = series.struct
      end
      # Change Frame if different:
      if @frame != series.frame
        @frame = series.frame
      end
      # Update slices:
      @slices.each do |slice|
        slice.attach_to(series)
      end
    end
def attach_to(series)
      raise ArgumentError, "Invalid argument 'series'. Expected ImageSeries, got #{series.class}." unless series.is_a?(Series)
      # Change struct association if indicated:
      if series.struct != @struct
        @struct.remove_structure(self)
        StructureSet.new(RTKIT.series_uid, series) unless series.struct
        series.struct.add_roi(self)
        @struct = series.struct
      end
      # Change Frame if different:
      if @frame != series.frame
        @frame = series.frame
      end
      # Update slices:
      @slices.each do |slice|
        slice.attach_to(series)
      end
    end
Attaches a ROI to a specified ImageSeries, by setting the ROIs frame
 reference to the Frame which the ImageSeries belongs to, and setting the
 Image reference of each of the Slices belonging to the ROI to an Image
 instance which matches the coordinates of the Slice's Contour(s).

 This method can be useful when you have multiple segmentations based on
 the same image series from multiple raters (perhaps as part of a
 comparison study), and the rater's software has modified the UIDs of the
 original image series, so that the references of the returned Structure
 Set does not match your original image series. This method uses
 coordinate information to calculate plane equations, which allows it to
 identify the corresponding image slice even in the case of slice geometry
 being non-perpendicular with respect to the patient geometry (direction
 cosine values != [0,1]).

 @param [Series] series the new ImageSeries instance which the ROI shall be associated with
 @raise [ArgumentError] if a suitable match is not found for any of the ROI's slices