|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectij.gui.AbstractRoi
ij.gui.AttributeRoi
ij.gui.Roi
public class Roi
A rectangular region of interest and superclass for the other ROI classes.
Field Summary | |
---|---|
static java.awt.BasicStroke |
onePixelWide
|
static Roi |
previousRoi
|
java.awt.Shape |
roundRect
|
Fields inherited from interface ij.gui.RoiConstance |
---|
ADD_TO_ROI, ANGLE, COMPOSITE, CONSTRUCTING, DRAW_HANDLE, DUPLICATE_HANDLE, EVT_HANDLE_SIZE, FILL_HANDLE, FREELINE, FREEROI, HANDLE_SIZE, LINE, MAG_HANDLE, MOVING, MOVING_HANDLE, MOVING_ROUNDRECT_HANDLE, NO_MODS, NORMAL, NOT_PASTING, OVAL, POINT, POLYGON, POLYLINE, RECTANGLE, RESIZING, SUBTRACT_FROM_ROI, TRACED_ROI, UNDO_HANDLE |
Constructor Summary | |
---|---|
Roi(double x,
double y,
double width,
double height)
Creates a rounded rectangular ROI using double arguments. |
|
Roi(double x,
double y,
double width,
double height,
double cornerDiameter)
Creates a new rounded rectangular ROI. |
|
Roi(int sx,
int sy,
ImagePlus imp)
Starts the process of creating a user-defined rectangular Roi, where sx and sy are the starting screen coordinates. |
|
Roi(int sx,
int sy,
ImagePlus imp,
int cornerDiameter)
Starts the process of creating a user-defined rectangular Roi, where sx and sy are the starting screen coordinates. |
|
Roi(int x,
int y,
int width,
int height)
Creates a rectangular ROI. |
|
Roi(int x,
int y,
int width,
int height,
ImagePlus imp)
Deprecated. |
|
Roi(int x,
int y,
int width,
int height,
int cornerDiameter)
Creates a new rounded rectangular ROI. |
|
Roi(java.awt.Rectangle r)
Creates a new rectangular Roi. |
|
Roi(java.awt.geom.Rectangle2D.Double r)
Creates a new rectangular Roi. |
Method Summary | |
---|---|
void |
abortPaste()
|
void |
appRoiHandle(java.awt.Graphics g,
double x,
double y,
java.awt.Color color)
|
java.lang.Object |
clone()
Returns a copy of this roi. |
boolean |
contains(int x,
int y)
|
void |
draw(java.awt.Graphics g)
|
void |
drawfillOverlay(java.awt.Graphics g,
boolean fillcolor)
|
void |
drawHandle(java.awt.Graphics g,
int x,
int y)
|
void |
drawOverlay(java.awt.Graphics g)
|
void |
drawPixels()
Deprecated. replaced by drawPixels(ImageProcessor) |
void |
drawPixels(ImageProcessor ip)
Draws the selection outline on the specified ImageProcessor. |
void |
drawPixels(ImageProcessor ip,
java.awt.geom.GeneralPath path)
Draws the selection outline on the specified ImageProcessor. |
void |
drawRoiHandle(java.awt.Graphics g,
double x,
double y)
|
void |
drawStroke(java.awt.Graphics2D g)
|
void |
endPaste()
|
boolean |
equals(java.lang.Object obj)
Checks whether two rectangles are equal. |
void |
fillRoiHandle(java.awt.Graphics g,
double x,
double y)
|
java.awt.Rectangle |
getBoundingRect()
Deprecated. replaced by getBounds() |
java.awt.Rectangle |
getBounds()
Return this selection's bounding rectangle. |
int |
getCornerDiameter()
Returns the rounded rectangle corner diameter (pixels). |
static int |
getCurrentPasteMode()
Returns the current paste transfer mode. |
boolean |
getDrawOffset()
Returns true if this is a PolygonRoi that supports sub-pixel resolution and polygons are drawn on zoomed images offset down and to the right by 0.5 pixels.. |
java.awt.geom.Rectangle2D.Double |
getFloatBounds()
Return this selection's bounding rectangle. |
FloatPolygon |
getFloatPolygon()
|
int |
getHandleSize()
|
double |
getLength()
Returns the perimeter length. |
ImageProcessor |
getMask()
Always returns null for rectangular Roi's |
int |
getPasteMode()
Returns the current paste transfer mode, or NOT_PASTING (-1) if no paste operation is in progress. |
java.awt.Polygon |
getPolygon()
Returns the outline of this selection as a Polygon, or null if this is a straight line selection. |
Overlay |
getPrototypeOverlay()
|
int |
getRoundRectArcSize()
Obsolete; replaced by getCornerDiameter(). |
int |
getState()
|
java.lang.String |
getTypeAsString()
Convenience method that converts Roi type to a human-readable form. |
boolean |
isArea()
Returns 'true' if this is an area selection. |
boolean |
isDrawingTool()
Returns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow). |
int |
isHandle(int sx,
int sy)
Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1. |
boolean |
isLine()
Returns 'true' if this is a line selection. |
boolean |
isVisible()
Returns true if this ROI is currently displayed on an image. |
void |
magRoiHandle(java.awt.Graphics g,
double x,
double y)
|
void |
nudge(int key)
Nudge ROI one pixel on arrow key press. |
void |
nudgeCorner(int key)
Nudge lower right corner of rectangular and oval ROIs by one pixel based on arrow key press. |
void |
setCornerDiameter(int cornerDiameter)
Sets the rounded rectangle corner diameter (pixels). |
void |
setDrawOffset(boolean drawOffset)
|
void |
setImage(ImagePlus imp)
|
void |
setInstanceColor(java.awt.Color c)
Deprecated. replaced by setStrokeColor() |
void |
setLineWidth(int width)
Deprecated. replaced by setStrokeWidth(int) |
void |
setLocation(int x,
int y)
Set the location of the ROI in image coordinates. |
void |
setNonScalable(boolean nonScalable)
Set 'nonScalable' true to have TextRois in a display list drawn at a fixed location and size. |
static void |
setPasteMode(int transferMode)
Sets the Paste transfer mode. |
void |
setPrototypeOverlay(Overlay overlay)
|
void |
setRoundRectArcSize(int cornerDiameter)
Obsolete; replaced by setCornerDiameter(). |
void |
startPaste(ImagePlus clipboard)
|
boolean |
subPixelResolution()
Returns true if this is a PolygonRoi that supports sub-pixel resolution. |
void |
temporarilyHide()
Deprecated. |
static float[] |
toFloat(int[] arr)
Converts an int array to a float array. |
static int[] |
toInt(float[] arr)
Converts a float array to an int array using truncation. |
static int[] |
toInt(float[] arr,
int[] arr2,
int size)
|
static int[] |
toIntR(float[] arr)
Converts a float array to an int array using rounding. |
java.lang.String |
toString()
|
void |
undoRoiHandle(java.awt.Graphics g,
double x,
double y)
|
void |
update(boolean add,
boolean subtract)
If 'add' is true, adds this selection to the previous one. |
void |
updateWideLine(float width)
|
Methods inherited from class ij.gui.AttributeRoi |
---|
copyAttributes, getAngle, getColor, getConvexHull, getCPosition, getDefaultFillColor, getFeretsDiameter, getFeretValues, getFillColor, getImage, getImageID, getName, getPosition, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getZPosition, setColor, setDefaultFillColor, setFillColor, setName, setPosition, setPosition, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.awt.Shape roundRect
public static Roi previousRoi
public static final java.awt.BasicStroke onePixelWide
Constructor Detail |
---|
public Roi(int x, int y, int width, int height)
public Roi(int x, int y, int width, int height, int cornerDiameter)
public Roi(double x, double y, double width, double height, double cornerDiameter)
public Roi(double x, double y, double width, double height)
public Roi(java.awt.Rectangle r)
public Roi(java.awt.geom.Rectangle2D.Double r)
public Roi(int sx, int sy, ImagePlus imp)
public Roi(int sx, int sy, ImagePlus imp, int cornerDiameter)
public Roi(int x, int y, int width, int height, ImagePlus imp)
Method Detail |
---|
public void setLocation(int x, int y)
setLocation
in interface RoiBeans
public void setImage(ImagePlus imp)
setImage
in interface RoiBeans
public int getState()
getState
in interface RoiBeans
public double getLength()
getLength
in interface RoiBeans
public java.awt.Rectangle getBounds()
getBounds
in interface RoiBeans
public java.awt.geom.Rectangle2D.Double getFloatBounds()
getFloatBounds
in interface RoiBeans
public java.awt.Rectangle getBoundingRect()
getBoundingRect
in interface RoiBeans
public java.awt.Polygon getPolygon()
getPolygon
in interface RoiBeans
ImageProcessor.setRoi(java.awt.Rectangle)
,
ImageProcessor.drawPolygon(java.awt.Polygon)
,
ImageProcessor.fillPolygon(java.awt.Polygon)
public FloatPolygon getFloatPolygon()
getFloatPolygon
in interface RoiBeans
public void nudge(int key)
nudge
in interface RoiBeans
public void nudgeCorner(int key)
nudgeCorner
in interface RoiBeans
public int getHandleSize()
getHandleSize
in interface RoiBeans
public void draw(java.awt.Graphics g)
draw
in interface RoiBeans
public void drawOverlay(java.awt.Graphics g)
drawOverlay
in interface RoiBeans
public void drawfillOverlay(java.awt.Graphics g, boolean fillcolor)
public void drawRoiHandle(java.awt.Graphics g, double x, double y)
public void appRoiHandle(java.awt.Graphics g, double x, double y, java.awt.Color color)
public void fillRoiHandle(java.awt.Graphics g, double x, double y)
public void magRoiHandle(java.awt.Graphics g, double x, double y)
public void undoRoiHandle(java.awt.Graphics g, double x, double y)
public void drawHandle(java.awt.Graphics g, int x, int y)
drawHandle
in interface RoiBeans
public void drawPixels()
drawPixels
in interface RoiBeans
public void drawPixels(ImageProcessor ip)
drawPixels
in interface RoiBeans
ImageProcessor.setColor(java.awt.Color)
,
ImageProcessor.setLineWidth(int)
public void drawPixels(ImageProcessor ip, java.awt.geom.GeneralPath path)
ImageProcessor.setColor(java.awt.Color)
,
ImageProcessor.setLineWidth(int)
public void drawStroke(java.awt.Graphics2D g)
public boolean contains(int x, int y)
contains
in interface RoiBeans
public int isHandle(int sx, int sy)
isHandle
in interface RoiBeans
public void update(boolean add, boolean subtract)
update
in interface RoiBeans
public ImageProcessor getMask()
getMask
in interface RoiBeans
public void setInstanceColor(java.awt.Color c)
setInstanceColor
in interface RoiBeans
public void setLineWidth(int width)
setLineWidth
in interface RoiBeans
public void updateWideLine(float width)
updateWideLine
in interface RoiBeans
public void setNonScalable(boolean nonScalable)
setNonScalable
in interface RoiBeans
public void setCornerDiameter(int cornerDiameter)
setCornerDiameter
in interface RoiBeans
setCornerDiameter
in class AttributeRoi
public int getCornerDiameter()
getCornerDiameter
in interface RoiBeans
getCornerDiameter
in class AttributeRoi
public void setRoundRectArcSize(int cornerDiameter)
setRoundRectArcSize
in interface RoiBeans
setRoundRectArcSize
in class AttributeRoi
public int getRoundRectArcSize()
getRoundRectArcSize
in interface RoiBeans
getRoundRectArcSize
in class AttributeRoi
public void setPrototypeOverlay(Overlay overlay)
setPrototypeOverlay
in interface RoiBeans
public Overlay getPrototypeOverlay()
getPrototypeOverlay
in interface RoiBeans
public void startPaste(ImagePlus clipboard)
startPaste
in interface RoiBeans
public void endPaste()
endPaste
in interface RoiBeans
public void abortPaste()
abortPaste
in interface RoiBeans
public static void setPasteMode(int transferMode)
Blitter
public int getPasteMode()
getPasteMode
in interface RoiBeans
Blitter
public static int getCurrentPasteMode()
public boolean isArea()
isArea
in interface RoiBeans
public boolean isLine()
isLine
in interface RoiBeans
public boolean isDrawingTool()
isDrawingTool
in interface RoiBeans
public java.lang.String getTypeAsString()
getTypeAsString
in interface RoiBeans
public boolean isVisible()
isVisible
in interface RoiBeans
public boolean subPixelResolution()
subPixelResolution
in interface RoiBeans
public boolean getDrawOffset()
getDrawOffset
in interface RoiBeans
public void setDrawOffset(boolean drawOffset)
setDrawOffset
in interface RoiBeans
public java.lang.Object clone()
clone
in class AbstractRoi
public boolean equals(java.lang.Object obj)
equals
in interface RoiBeans
equals
in class java.lang.Object
public java.lang.String toString()
toString
in interface RoiBeans
toString
in class java.lang.Object
public static int[] toInt(float[] arr)
public static int[] toInt(float[] arr, int[] arr2, int size)
public static int[] toIntR(float[] arr)
public static float[] toFloat(int[] arr)
public void temporarilyHide()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |