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 TypeMethodDescriptionstatic List<RotatableROI> getAllRotatableROIs(List<ROI> selectedROIs) org.jogamp.vecmath.Point2dGets the centre (about which rotation will occur) of thisRotatableROI, in mm coordinates.static org.jogamp.vecmath.Point2dgetCentreOfRotation(List<RotatableROI> rotatableROIs) Gets the centre (about which rotation will occur) of thisListofRotatableROIs, in mm coordinates.doublegetTheta()Returns the current rotation angle for this RotatableROI.static org.jogamp.vecmath.Point2drotatePoint(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 voidsetTheta(double theta) Rotates this RotatableROI, rotating about the ROI's natural centre-of-rotation.voidsetTheta(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 thisRotatableROI, in mm coordinates.- Returns:
- the point about which rotation will occur.
-
getCentreOfRotation
Gets the centre (about which rotation will occur) of thisListofRotatableROIs, in mm coordinates.- Parameters:
rotatableROIs- theListof ROIs to rotate.- Returns:
- the point about which rotation will occur.
-
getAllRotatableROIs
-
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,
-