|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xinapse.multisliceimage.roi.ROI
com.xinapse.multisliceimage.roi.EllipticalROI
public class EllipticalROI
A Class representing an elliptical region of an image.
| Field Summary | |
|---|---|
static java.lang.String |
ATOKEN
The token written to ROI output files to represent the first semi-major axis length. |
static java.lang.String |
BTOKEN
The token written to ROI output files to represent the second semi-major axis length. |
static java.lang.String |
THETATOKEN
The token written to ROI output files to represent the rotation angle. |
| Fields inherited from class com.xinapse.multisliceimage.roi.ROI |
|---|
handles, PREFERENCES_NODE_NAME, XTOKEN, YTOKEN |
| Constructor Summary | |
|---|---|
EllipticalROI(double centreX,
double centreY,
double a,
double b,
double theta,
byte userColour,
ROIState state)
Creates a new EllipticalROI with the specified shape in mm coordinates. |
|
EllipticalROI(double centreX,
double centreY,
double a,
double b,
double theta,
ROIState state)
Creates a new EllipticalROI with the specified shape in mm coordinates. |
|
EllipticalROI(java.awt.geom.Point2D.Double centre,
double a,
double b,
double theta)
Creates a new EllipticalROI with the specified shape in mm coordinates. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a clone of this ROI. |
boolean |
contains(ROI roi)
Indicates whether this EllipticalROI contains another ROI entirely within its borders. |
java.util.List<ROI> |
dilate(double radius,
com.xinapse.util.Incrementer incrementer,
com.xinapse.util.CancellableThread.Flag cancelFlag)
|
boolean |
draw(java.awt.Graphics g,
java.awt.Rectangle visibleRectangle,
int imageDrawCols,
int imageDrawRows,
int xOffset,
int yOffset,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
boolean drawAnnotation)
Draws this ROI if it needs to be be drawn on screen. |
boolean |
equals(java.lang.Object o)
Indicates whether some Object is equal to this ROI. |
void |
flipHorizontal(java.awt.geom.Point2D flipPoint)
Flip this ROI horizontally about a given location. |
void |
flipVertical(java.awt.geom.Point2D flipPoint)
Flip this ROI vertically about a given location. |
double |
getA()
Returns the first semi-major axis length in mm. |
double |
getB()
Returns the second semi-major axis length in mm. |
static javax.swing.Icon |
getButtonIcon()
Returns an Icon that can be used to create this type of ROI. |
java.awt.geom.Point2D |
getCentre()
Gets the centre (about which rotation will occur) of this RotatableROI in mm. |
java.awt.geom.Point2D.Double |
getCentrePix(int nCols,
int nRows,
float pixelXSize,
float pixelYSize)
Gets the centre of this ROI in pixel coordinates. |
ROI |
getCopy()
Returns a copy of this ROI. |
static ROICreateDialog |
getCreateDialog(CanAddROIToFrame listener)
Returns a JDialog that can be used to create Elliptical ROIs. |
static InteractionType |
getCreateInteractionType()
Returns the type of interaction needed to create an EllipticalROI. |
java.lang.String |
getDescription()
Return a description of this type of ROI. |
Feret |
getFeret()
Returns the minimum and maximum Feret's diameter for this ROI, in mm. |
static EllipticalROI |
getInstance(java.awt.Rectangle boundingRectangle,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
byte userColour,
ROIState state)
Creates an instance of a EllipticalROI suitable for drawing on a window. |
static java.lang.String |
getName()
Returns a descriptive name for this type of ROI. |
double |
getPerimeter()
Returns the perimeter length of this EllipticalROI. |
double |
getSquareArea()
Returns the area of this regular ROI in square mm. |
double |
getTheta()
Returns the current rotation angle for this RotatableROI. |
int |
hashCode()
Returns a hash code value for this EllipticalROI. |
void |
move(double dx,
double dy)
Move this ROI by specified distances (in mm) in the x and y directions. |
void |
move(EllipticalROI newEllipse,
boolean pixelSnap)
Moves and rehapes this EllipticalROI so that the size and location are the same as the given EllipticalROI. |
void |
set(ROI roi)
Sets the shape of this ROI to the shape of the supplied argument ROI. |
void |
setTheta(double theta)
Sets the rotation angle for this RotatableROI. |
java.lang.String |
toString()
Returns a String describing this ROI. |
| Methods inherited from class com.xinapse.multisliceimage.roi.ROI |
|---|
add, add, clearDeletionHistory, clearStats, dilate, exclusiveOr, getAnnotation, getBoundingRectangle, getBoundingRectangle, getCachedStatistics, getClasses, getColor, getDisplayedBounds2D, getDisplayedBounds2D, getDisplayedRoiArea, getHandles, getHandleUnderPoint, getImageSource, getPixelValue, getROIs, getROIs, getSlice, getState, getStats, getStats, getStats, getTextColor, getTextFontSize, getUserColour, intersect, isDeleted, isEditable, isReloaded, isSelected, join, main, markDeleted, mmPosToPix, moveROIs, pixPosToMm, printStats, selectDeselect, setAnnotation, setCreationHistory, setSlice, setState, setTextColor, setTextSize, setUserColour, subtract, subtract, write, write |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ATOKEN
public static final java.lang.String BTOKEN
public static final java.lang.String THETATOKEN
| Constructor Detail |
|---|
public EllipticalROI(java.awt.geom.Point2D.Double centre,
double a,
double b,
double theta)
throws ROIException
centre - the location of the centre of the ellipse in mm coordinates.a - the first semi-axis length in mm.b - the second semi-axis length in mm.theta - the angle between the first axis and the x-direction.
Theta is positive clockwise.
ROIException - if either the major or the minor axis length is not positive.
public EllipticalROI(double centreX,
double centreY,
double a,
double b,
double theta,
ROIState state)
throws ROIException
centreX - the x-location of the centre of the ellipse in mm.centreY - the y-location of the centre of the ellipse in mm.a - the first semi-axis length in mm.b - the second semi-axis length in mm.theta - the angle between the first axis and the x-direction.
Theta is positive clockwise.state - the selection state of the EllipticalROI.
ROIException - if either the major or the minor semi-axis length is not positive.
public EllipticalROI(double centreX,
double centreY,
double a,
double b,
double theta,
byte userColour,
ROIState state)
throws ROIException
centreX - the x-location of the centre of the ellipse in mm.centreY - the y-location of the centre of the ellipse in mm.a - the first semi-axis length in mm.b - the second semi-axis length in mm.theta - the angle between the first axis and the x-direction.
Theta is positive clockwise.state - the selection state of the EllipticalROI.
ROIException - if either the major or the minor semi-axis length is not positive.| Method Detail |
|---|
public java.awt.geom.Point2D getCentre()
RotatableROI
getCentre in interface RotatableROIpublic double getA()
public double getB()
public java.awt.geom.Point2D.Double getCentrePix(int nCols,
int nRows,
float pixelXSize,
float pixelYSize)
public double getTheta()
RotatableROI
getTheta in interface RotatableROIpublic void setTheta(double theta)
RotatableROI
setTheta in interface RotatableROItheta - the rotation angle.public static InteractionType getCreateInteractionType()
public double getSquareArea()
RegularROI
getSquareArea in interface RegularROI
public void move(double dx,
double dy)
ROI
move in class ROIdx - the distance to move in the x-direction.dy - the distance to move in the y-direction.public void flipVertical(java.awt.geom.Point2D flipPoint)
ROI
flipVertical in class ROIflipPoint - the point about which the ROI will be flipped.public void flipHorizontal(java.awt.geom.Point2D flipPoint)
ROI
flipHorizontal in class ROIflipPoint - the point about which the ROI will be flipped.
public void move(EllipticalROI newEllipse,
boolean pixelSnap)
newEllipse - the EllipticalROI from which to take the location,
size and rotation angle.pixelSnap - indicates whether pixel snap is turned on.
public static EllipticalROI getInstance(java.awt.Rectangle boundingRectangle,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
byte userColour,
ROIState state)
throws ROIException
boundingRectangle - the area of screen into which the ROI must fit.nCols - the number of image columns.nRows - the number of image rows.pixelXSize - the size of image pixels in the horizontal direction.pixelYSize - the size of image pixels in the vertical direction.state - the initial state of this newly-created ROI.
ROIException
public java.util.List<ROI> dilate(double radius,
com.xinapse.util.Incrementer incrementer,
com.xinapse.util.CancellableThread.Flag cancelFlag)
public boolean draw(java.awt.Graphics g,
java.awt.Rectangle visibleRectangle,
int imageDrawCols,
int imageDrawRows,
int xOffset,
int yOffset,
int nCols,
int nRows,
float pixelXSize,
float pixelYSize,
boolean drawAnnotation)
ROI
draw in class ROIg - 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.
public Feret getFeret()
ROI
getFeret in class ROIpublic double getPerimeter()
getPerimeter in class ROIpublic static ROICreateDialog getCreateDialog(CanAddROIToFrame listener)
listener - the CanAddROIToFrame to which the ROI will be added when
the Add button of the Dialog is clicked.
public boolean contains(ROI roi)
contains in class ROIroi - the ROI to be tested for containment within this ROI.
public boolean equals(java.lang.Object o)
ROI
equals in class ROIo - the Object to be tested for equality to this ROI.
public int hashCode()
hashCode in class java.lang.Object
public void set(ROI roi)
throws java.lang.ClassCastException
ROI
set in class ROIjava.lang.ClassCastException - of the sub class of the argument ROI is not the
same as this ROI.public ROI getCopy()
ROI
getCopy in class ROIpublic java.lang.Object clone()
ROI
clone in class ROIpublic java.lang.String toString()
ROI
toString in class ROIpublic java.lang.String getDescription()
ROI
getDescription in class ROIpublic static java.lang.String getName()
public static javax.swing.Icon getButtonIcon()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||