|
||||||||||
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 | |
---|---|
protected double |
asp_bk
|
protected boolean |
aspect
|
protected ImageProcessor |
cachedMask
|
protected boolean |
center
|
protected ImagePlus |
clipboard
|
protected int |
clipHeight
|
protected int |
clipWidth
|
protected int |
clipX
|
protected int |
clipY
|
protected boolean |
constrain
|
protected static java.awt.Color |
defaultFillColor
|
protected java.awt.Color |
handleColor
|
protected ImageCanvas |
ic
|
protected int |
imageID
|
protected java.awt.Color |
instanceColor
|
protected static int |
lineWidth
|
protected double |
mag
|
protected boolean |
nonScalable
|
protected int |
oldHeight
|
protected int |
oldWidth
|
protected int |
oldX
|
protected int |
oldY
|
static java.awt.BasicStroke |
onePixelWide
|
protected boolean |
overlay
|
protected static int |
pasteMode
|
static Roi |
previousRoi
|
protected boolean |
updateFullWindow
|
Fields inherited from class ij.gui.AttributeRoi |
---|
fillColor, imp, ROIColor, stroke, strokeColor, type, wideLine, xMax, yMax |
Fields inherited from interface ij.gui.RoiConstance |
---|
ADD_TO_ROI, ANGLE, COMPOSITE, CONSTRUCTING, FREELINE, FREEROI, HANDLE_SIZE, LINE, MOVING, MOVING_HANDLE, NO_MODS, NORMAL, NOT_PASTING, OVAL, POINT, POLYGON, POLYLINE, RECTANGLE, RESIZING, SUBTRACT_FROM_ROI, TRACED_ROI |
Constructor Summary | |
---|---|
Roi(double x,
double y,
double width,
double height)
Creates a rectangular ROI using double arguments. |
|
Roi(double x,
double y,
double width,
double height,
int cornerDiameter)
Creates a rounded rectangular ROI using double arguments. |
|
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()
|
protected int |
clipRectMargin()
|
java.lang.Object |
clone()
Returns a copy of this roi. |
boolean |
contains(int x,
int y)
|
void |
draw(java.awt.Graphics g)
|
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 |
endPaste()
|
boolean |
equals(java.lang.Object obj)
Checks whether two rectangles are equal. |
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. |
protected double |
getMagnification()
|
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(). |
protected java.awt.BasicStroke |
getScaledStroke()
Returns the Stroke used to draw this ROI, or null if no Stroke is used. |
int |
getState()
Returns the ID of the image associated with this ROI. |
java.lang.String |
getTypeAsString()
Convenience method that converts Roi type to a human-readable form. |
protected void |
grow(int sx,
int sy)
|
protected void |
handleMouseDown(int sx,
int sy)
|
protected void |
handleMouseDrag(int sx,
int sy,
int flags)
|
protected void |
handleMouseUp(int screenX,
int screenY)
|
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. |
protected void |
mouseDownInHandle(int handle,
int sx,
int sy)
|
protected void |
moveHandle(int sx,
int sy)
|
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. |
protected int |
screenX(int ox)
|
protected int |
screenXD(double ox)
|
protected int |
screenY(int oy)
|
protected int |
screenYD(double oy)
|
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)
Returns the frame position of this ROI, or zero if this ROI is not associated with a particular frame. |
void |
setRoundRectArcSize(int cornerDiameter)
Obsolete; replaced by setCornerDiameter(). |
protected void |
showStatus()
|
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 |
update(boolean add,
boolean subtract)
If 'add' is true, adds this selection to the previous one. |
protected void |
updateClipRect()
|
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 |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Roi previousRoi
public static final java.awt.BasicStroke onePixelWide
protected static int pasteMode
protected static int lineWidth
protected static java.awt.Color defaultFillColor
protected int imageID
protected ImageCanvas ic
protected int oldX
protected int oldY
protected int oldWidth
protected int oldHeight
protected int clipX
protected int clipY
protected int clipWidth
protected int clipHeight
protected ImagePlus clipboard
protected boolean constrain
protected boolean center
protected boolean aspect
protected boolean updateFullWindow
protected double mag
protected double asp_bk
protected ImageProcessor cachedMask
protected java.awt.Color handleColor
protected java.awt.Color instanceColor
protected boolean nonScalable
protected boolean overlay
Constructor Detail |
---|
public Roi(int x, int y, int width, int height)
public Roi(double x, double y, double width, double height)
public Roi(int x, int y, int width, int height, int cornerDiameter)
public Roi(double x, double y, double width, double height, int cornerDiameter)
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
protected void grow(int sx, int sy)
grow
in class AbstractRoi
protected void moveHandle(int sx, int sy)
moveHandle
in class AbstractRoi
public void nudge(int key)
nudge
in interface RoiBeans
public void nudgeCorner(int key)
nudgeCorner
in interface RoiBeans
protected void updateClipRect()
updateClipRect
in class AbstractRoi
protected int clipRectMargin()
clipRectMargin
in class AbstractRoi
protected void handleMouseDrag(int sx, int sy, int flags)
handleMouseDrag
in class AbstractRoi
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 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 boolean contains(int x, int y)
contains
in interface RoiBeans
public int isHandle(int sx, int sy)
isHandle
in interface RoiBeans
protected void mouseDownInHandle(int handle, int sx, int sy)
mouseDownInHandle
in class AbstractRoi
protected void handleMouseDown(int sx, int sy)
handleMouseDown
in class AbstractRoi
protected void handleMouseUp(int screenX, int screenY)
handleMouseUp
in class AbstractRoi
public void update(boolean add, boolean subtract)
update
in interface RoiBeans
protected void showStatus()
showStatus
in class AbstractRoi
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
protected java.awt.BasicStroke getScaledStroke()
getScaledStroke
in class AbstractRoi
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
protected double getMagnification()
getMagnification
in class AbstractRoi
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
protected int screenX(int ox)
screenX
in class AbstractRoi
protected int screenY(int oy)
screenY
in class AbstractRoi
protected int screenXD(double ox)
screenXD
in class AbstractRoi
protected int screenYD(double oy)
screenYD
in class AbstractRoi
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 |