Class IrregularROIInProgress

All Implemented Interfaces:
EditableOutlineROI, RotatableROI, StretchableROI, Cloneable

public class IrregularROIInProgress extends IrregularROI implements Cloneable
A Class representing an IrregularROI being drawn on an image. When being drawn, an IrregularROI looks like a CurvedLineROI.
  • Constructor Details

    • IrregularROIInProgress

      public IrregularROIInProgress(double[] x, double[] y, byte userColour) throws ROIException
      Creates a new IrregularROIInProgress with the specified shape in mm coordinates.
      Parameters:
      x - an array of x-coordinates for the points forming the outline.
      y - an array of y-coordinates for the points forming the outline.
      userColour - the colour of this ROI. A value of 0 indicates that the ROI will be drawn with the default colour for normal ROIs.
      Throws:
      ROIException - if the ROI cannot be created as specified.
  • Method Details

    • appendVertex

      public void appendVertex(Point2D pt)
      Appends a vertex to the end of this IrregularROIInProgress.
      Parameters:
      pt - the location of the vertex to append.
    • appendVertex

      public void appendVertex(double x, double y)
      Appends a vertex to the end of this IrregularROIInProgress.
      Parameters:
      x - the x-location of the vertex to append.
      y - the y-location of the vertex to append.
    • insertVertex

      public void insertVertex(Point2D pt)
      Inserts a vertex at the beginning of this IrregularROIInProgress.
      Parameters:
      pt - the location of the vertex to append.
    • insertVertex

      public void insertVertex(double x, double y)
      Inserts a vertex at the beginning of this IrregularROIInProgress.
      Parameters:
      x - the x-location of the vertex to insert.
      y - the y-location of the vertex to insert.
    • removeLastVertex

      public void removeLastVertex()
      Removes the last vertex from this IrregularROIInProgress.
    • removeFirstVertex

      public void removeFirstVertex()
      Removes the first vertex from this IrregularROIInProgress.
    • draw

      public boolean draw(Graphics g, Rectangle visibleRectangle, int imageDrawCols, int imageDrawRows, int xOffset, int yOffset, int nCols, int nRows, float pixelXSize, float pixelYSize, boolean drawAnnotation)
      Description copied from class: ROI
      Draws this ROI if it needs to be be drawn on screen.
      Overrides:
      draw in class IrregularROI
      Parameters:
      g - the graphics context for the drawing operation.
      visibleRectangle - the part of the image that can be seen on-screen.
      imageDrawCols - width of the area in which this portion of the image is to be drawn.
      imageDrawRows - height of the area in which this portion of the image is to be drawn.
      xOffset - a horizontal offset for drawing operations.
      yOffset - a vertical offset for drawing operations.
      nCols - the number of columns in the image on which this ROI is defined.
      nRows - the number of rows in the image on which this ROI is defined.
      pixelXSize - pixel width for the image on which this ROI is defined.
      pixelYSize - pixel height for the image on which this ROI is defined.
      drawAnnotation - a flag to indicate whether annotation should be drawn.
      Returns:
      true if the ROI is visible and been drawn on screen; false otherwise.
    • clone

      public IrregularROIInProgress clone()
      Description copied from class: ROI
      Returns a clone of this ROI. The copy will be identical in shape and annotation as the original ROI, and with a history identical to the cloned ROI.
      Overrides:
      clone in class IrregularROI
      Returns:
      a clone of this ROI, cast to an Object.