Interface RotatableROI

All Known Implementing Classes:
ContourROI, CurvedLineROI, EllipticalROI, HollowROI, IrregularROI, IrregularROIInProgress, LineROI, Marker, OpenSplineROI, SplineROI, Text

public interface RotatableROI
Interface that rotatable ROIs implement. Rotatable ROIs have a getable and setable rotation angle, and can be rotated about their own 'natural' centre, or a different centre of rotation.
  • Method Summary

    Modifier and Type
    Method
    Description
    getAllRotatableROIs(List<ROI> selectedROIs)
    Returns a List of RotatableROIs, if all the supplied ROIs are rotatable.
    org.jogamp.vecmath.Point2d
    Gets the centre (about which rotation will occur) of this RotatableROI, in mm coordinates.
    static org.jogamp.vecmath.Point2d
    Gets the centre (about which rotation will occur) of this List of RotatableROIs, in mm coordinates.
    double
    Returns the current rotation angle for this RotatableROI.
    static org.jogamp.vecmath.Point2d
    rotatePoint(org.jogamp.vecmath.Point2d point, double deltaTheta, org.jogamp.vecmath.Point2d centreOfRotation)
    Rotates a point about a centre of rotation, by an angle deltaTheta, in 2-D.
    default void
    setTheta(double theta)
    Rotates this RotatableROI, rotating about the ROI's natural centre-of-rotation.
    void
    setTheta(double theta, org.jogamp.vecmath.Point2d centreOfRotation)
    Sets the rotation angle for this RotatableROI.
  • Method Details

    • getTheta

      double getTheta()
      Returns the current rotation angle for this RotatableROI.
      Returns:
      theta the current rotation angle.
    • setTheta

      void setTheta(double theta, org.jogamp.vecmath.Point2d centreOfRotation)
      Sets the rotation angle for this RotatableROI.
      Parameters:
      theta - the rotation angle, in radians.
      centreOfRotation - the centre of rotation, in image coordinates.
    • setTheta

      default void setTheta(double theta)
      Rotates this RotatableROI, rotating about the ROI's natural centre-of-rotation.
      Parameters:
      theta - the rotation angle, in radians.
    • getCentre

      org.jogamp.vecmath.Point2d getCentre()
      Gets the centre (about which rotation will occur) of this RotatableROI, in mm coordinates.
      Returns:
      the point about which rotation will occur.
    • getCentreOfRotation

      static org.jogamp.vecmath.Point2d getCentreOfRotation(List<RotatableROI> rotatableROIs)
      Gets the centre (about which rotation will occur) of this List of RotatableROIs, in mm coordinates.
      Parameters:
      rotatableROIs - the List of ROIs to rotate.
      Returns:
      the point about which rotation will occur.
    • getAllRotatableROIs

      static List<RotatableROI> getAllRotatableROIs(List<ROI> selectedROIs)
      Returns a List of RotatableROIs, if all the supplied ROIs are rotatable.
      Parameters:
      selectedROIs - the List of ROIs to test whether all of them are rotatable.
      Returns:
      a List of RotatableROIs if all the supplied selected ROIs are rotatable. Returns an empty List otherwise.
    • rotatePoint

      static org.jogamp.vecmath.Point2d rotatePoint(org.jogamp.vecmath.Point2d point, double deltaTheta, org.jogamp.vecmath.Point2d centreOfRotation)
      Rotates a point about a centre of rotation, by an angle deltaTheta, in 2-D.
      Parameters:
      point - the point to rotate.
      deltaTheta - the rotation angle (positive clockwise).
      centreOfRotation - the centre of rotation.
      Returns:
      the position of the rotated point,