ij.gui
Interface RoiBeans

All Superinterfaces:
RoiConstance
All Known Implementing Classes:
AbstractRoi, Arrow, AttributeRoi, EllipseRoi, FreehandRoi, ImageRoi, Line, OvalRoi, PointRoi, PolygonRoi, RectangleRoi, Roi, RoundRectangleRoi, ShapeRoi, TextRoi

public interface RoiBeans
extends RoiConstance

Title:

Description:

Copyright: Copyright (c) 2011

Company:

Version:
1.0
Author:
not attributable

Field Summary
 
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
 
Method Summary
 void abortPaste()
           
 boolean contains(int x, int y)
           
 void copyAttributes(Roi roi2)
          Copy the attributes (outline color, fill color, outline width) of 'roi2' to the this selection.
 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)
           
 void endPaste()
           
 boolean equals(java.lang.Object obj)
          Checks whether two rectangles are equal.
 double getAngle(int x1, int y1, int x2, int y2)
          Returns the angle in degrees between the specified line and a horizontal line.
 java.awt.Rectangle getBoundingRect()
          Deprecated. replaced by getBounds()
 java.awt.Rectangle getBounds()
          Return this selection's bounding rectangle.
 java.awt.Polygon getConvexHull()
           
 int getCornerDiameter()
          Returns the rounded rectangle corner diameter (pixels).
 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..
 double getFeretsDiameter()
          Returns Feret's diameter, the greatest distance between any two points along the ROI boundary.
 double[] getFeretValues()
          Caculates "Feret" (maximum caliper width), "FeretAngle" and "MinFeret" (minimum caliper width), "FeretX" and "FeretY".
 java.awt.Color getFillColor()
          Returns the color used to fill this ROI, or null if it is not filled.
 java.awt.geom.Rectangle2D.Double getFloatBounds()
          Return this selection's bounding rectangle.
 FloatPolygon getFloatPolygon()
           
 int getHandleSize()
           
 ImagePlus getImage()
          Returns the ImagePlus associated with this ROI, or null.
 int getImageID()
          Returns the ID of the image associated with this ROI.
 double getLength()
          Returns the perimeter length.
 ImageProcessor getMask()
          Always returns null for rectangular Roi's
 java.lang.String getName()
          Returns the name of this ROI, or null.
 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.
 int getPosition()
          Returns the stack position (image number) of this ROI, or zero if the ROI is not associated with a particular stack image.
 Overlay getPrototypeOverlay()
           
 int getRoundRectArcSize()
          Obsolete; replaced by getCornerDiameter().
 int getState()
           
 java.awt.BasicStroke getStroke()
          Returns the Stroke used to draw this ROI, or null if no Stroke is used.
 java.awt.Color getStrokeColor()
          Returns the the color used to draw the ROI outline or null if the default color is being used.
 float getStrokeWidth()
          Returns the lineWidth.
 int getType()
           
 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 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 setFillColor(java.awt.Color color)
          Sets the color used to fill ROIs when they are in an overlay.
 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 setName(java.lang.String name)
          Sets the name of this ROI.
 void setNonScalable(boolean nonScalable)
          Set 'nonScalable' true to have TextRois in a display list drawn at a fixed location and size.
 void setPosition(int n)
          Sets the stack position (image number) of this ROI.
 void setPosition(int channel, int slice, int frame)
          Sets the hyperstack position of this ROI.
 void setPrototypeOverlay(Overlay overlay)
           
 void setRoundRectArcSize(int cornerDiameter)
          Obsolete; replaced by setCornerDiameter().
 void setStroke(java.awt.BasicStroke stroke)
          Sets the Stroke used to draw this ROI.
 void setStrokeColor(java.awt.Color c)
          Sets the color used by this ROI to draw its outline.
 void setStrokeWidth(double width)
          This is a version of setStrokeWidth() that accepts a double argument.
 void setStrokeWidth(float width)
          Sets the width of the line used to draw this ROI.
 void startPaste(ImagePlus clipboard)
           
 boolean subPixelResolution()
          Returns true if this is a PolygonRoi that supports sub-pixel resolution.
 java.lang.String toString()
           
 void update(boolean add, boolean subtract)
          If 'add' is true, adds this selection to the previous one.
 void updateWideLine(float width)
           
 

Method Detail

setLocation

void setLocation(int x,
                 int y)
Set the location of the ROI in image coordinates.


setImage

void setImage(ImagePlus imp)

getImage

ImagePlus getImage()
Returns the ImagePlus associated with this ROI, or null.


getImageID

int getImageID()
Returns the ID of the image associated with this ROI.


getType

int getType()

getState

int getState()

getLength

double getLength()
Returns the perimeter length.


getFeretsDiameter

double getFeretsDiameter()
Returns Feret's diameter, the greatest distance between any two points along the ROI boundary.


getFeretValues

double[] getFeretValues()
Caculates "Feret" (maximum caliper width), "FeretAngle" and "MinFeret" (minimum caliper width), "FeretX" and "FeretY".


getConvexHull

java.awt.Polygon getConvexHull()

getBounds

java.awt.Rectangle getBounds()
Return this selection's bounding rectangle.


getFloatBounds

java.awt.geom.Rectangle2D.Double getFloatBounds()
Return this selection's bounding rectangle.


getBoundingRect

java.awt.Rectangle getBoundingRect()
Deprecated. replaced by getBounds()


getPolygon

java.awt.Polygon getPolygon()
Returns the outline of this selection as a Polygon, or null if this is a straight line selection.

See Also:
ImageProcessor.setRoi(java.awt.Rectangle), ImageProcessor.drawPolygon(java.awt.Polygon), ImageProcessor.fillPolygon(java.awt.Polygon)

getFloatPolygon

FloatPolygon getFloatPolygon()

nudge

void nudge(int key)
Nudge ROI one pixel on arrow key press.


nudgeCorner

void nudgeCorner(int key)
Nudge lower right corner of rectangular and oval ROIs by one pixel based on arrow key press.


getHandleSize

int getHandleSize()

draw

void draw(java.awt.Graphics g)

drawOverlay

void drawOverlay(java.awt.Graphics g)

drawHandle

void drawHandle(java.awt.Graphics g,
                int x,
                int y)

drawPixels

void drawPixels()
Deprecated. replaced by drawPixels(ImageProcessor)


drawPixels

void drawPixels(ImageProcessor ip)

contains

boolean contains(int x,
                 int y)

isHandle

int isHandle(int sx,
             int sy)
Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.


update

void update(boolean add,
            boolean subtract)
If 'add' is true, adds this selection to the previous one. If 'subtract' is true, subtracts it from the previous selection. Called by the IJ.doWand() method, and the makeRectangle(), makeOval(), makePolygon() and makeSelection() macro functions.


getMask

ImageProcessor getMask()
Always returns null for rectangular Roi's


getAngle

double getAngle(int x1,
                int y1,
                int x2,
                int y2)
Returns the angle in degrees between the specified line and a horizontal line.


setStrokeColor

void setStrokeColor(java.awt.Color c)
Sets the color used by this ROI to draw its outline. This color, if not null, overrides the global color set by the static setColor() method.

See Also:
getStrokeColor(), #setStrokeWidth(int), ImagePlus.setOverlay(ij.gui.Overlay)

getStrokeColor

java.awt.Color getStrokeColor()
Returns the the color used to draw the ROI outline or null if the default color is being used.

See Also:
setStrokeColor(Color)

setFillColor

void setFillColor(java.awt.Color color)
Sets the color used to fill ROIs when they are in an overlay.

See Also:
ImagePlus.setOverlay(ij.gui.Overlay)

getFillColor

java.awt.Color getFillColor()
Returns the color used to fill this ROI, or null if it is not filled.

See Also:
getStrokeColor()

copyAttributes

void copyAttributes(Roi roi2)
Copy the attributes (outline color, fill color, outline width) of 'roi2' to the this selection.


setInstanceColor

void setInstanceColor(java.awt.Color c)
Deprecated. replaced by setStrokeColor()


setLineWidth

void setLineWidth(int width)
Deprecated. replaced by setStrokeWidth(int)


updateWideLine

void updateWideLine(float width)

setNonScalable

void setNonScalable(boolean nonScalable)
Set 'nonScalable' true to have TextRois in a display list drawn at a fixed location and size.


setStrokeWidth

void setStrokeWidth(float width)
Sets the width of the line used to draw this ROI.

See Also:
setStrokeColor(Color), ImagePlus.setOverlay(ij.gui.Overlay)

setStrokeWidth

void setStrokeWidth(double width)
This is a version of setStrokeWidth() that accepts a double argument.


getStrokeWidth

float getStrokeWidth()
Returns the lineWidth.


setStroke

void setStroke(java.awt.BasicStroke stroke)
Sets the Stroke used to draw this ROI.


getStroke

java.awt.BasicStroke getStroke()
Returns the Stroke used to draw this ROI, or null if no Stroke is used.


getName

java.lang.String getName()
Returns the name of this ROI, or null.


setName

void setName(java.lang.String name)
Sets the name of this ROI.


setCornerDiameter

void setCornerDiameter(int cornerDiameter)
Sets the rounded rectangle corner diameter (pixels).


getCornerDiameter

int getCornerDiameter()
Returns the rounded rectangle corner diameter (pixels).


setRoundRectArcSize

void setRoundRectArcSize(int cornerDiameter)
Obsolete; replaced by setCornerDiameter().


getRoundRectArcSize

int getRoundRectArcSize()
Obsolete; replaced by getCornerDiameter().


setPosition

void setPosition(int n)
Sets the stack position (image number) of this ROI. In an overlay, this ROI is only displayed when the stack is at the specified position. Set to zero to have the ROI displayed on all images in the stack.

See Also:
Overlay

getPosition

int getPosition()
Returns the stack position (image number) of this ROI, or zero if the ROI is not associated with a particular stack image.

See Also:
Overlay

setPosition

void setPosition(int channel,
                 int slice,
                 int frame)
Sets the hyperstack position of this ROI. In an overlay, this ROI is only displayed when the hyperstack is at the specified position.

See Also:
Overlay

setPrototypeOverlay

void setPrototypeOverlay(Overlay overlay)

getPrototypeOverlay

Overlay getPrototypeOverlay()

startPaste

void startPaste(ImagePlus clipboard)

endPaste

void endPaste()

abortPaste

void abortPaste()

getPasteMode

int getPasteMode()
Returns the current paste transfer mode, or NOT_PASTING (-1) if no paste operation is in progress.

See Also:
Blitter

isArea

boolean isArea()
Returns 'true' if this is an area selection.


isLine

boolean isLine()
Returns 'true' if this is a line selection.


isDrawingTool

boolean isDrawingTool()
Returns 'true' if this is an ROI primarily used from drawing (e.g., TextRoi or Arrow).


getTypeAsString

java.lang.String getTypeAsString()
Convenience method that converts Roi type to a human-readable form.


isVisible

boolean isVisible()
Returns true if this ROI is currently displayed on an image.


subPixelResolution

boolean subPixelResolution()
Returns true if this is a PolygonRoi that supports sub-pixel resolution.


getDrawOffset

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..


setDrawOffset

void setDrawOffset(boolean drawOffset)

equals

boolean equals(java.lang.Object obj)
Checks whether two rectangles are equal.

Overrides:
equals in class java.lang.Object

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object