Class: Roi

Roi

new Roi(r)

Creates a new rectangular Roi.

Parameters:
Name Type Description
r java.awt.Rectangle

-

Author:
  • Created by ijdoc2js

Members

(static, constant) ANGLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COMPOSITE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) CONSTRUCTING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) FREELINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) FREEROI :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) HANDLE_SIZE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) LINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) MOVING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) MOVING_HANDLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) NORMAL :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) NOT_PASTING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) onePixelWide :java.awt.BasicStroke

Type:
  • java.awt.BasicStroke
Author:
  • Created by ijdoc2js

(static, constant) OVAL :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POINT :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POLYGON :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POLYLINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) previousRoi :Roi

Type:
Author:
  • Created by ijdoc2js

(static, constant) RECTANGLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) RESIZING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) TRACED_ROI :int

Type:
  • int
Author:
  • Created by ijdoc2js

Methods

abortPaste()

Author:
  • Created by ijdoc2js

addRoiListener(listener)

Parameters:
Name Type Description
listener RoiListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a copy of this roi. See Thinking is Java by Bruce Eckel (www.eckelobjects.com) for a good description of object cloning.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

contains(x, y)

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

copyAttributes(roi2)

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

Parameters:
Name Type Description
roi2 Roi

-

Author:
  • Created by ijdoc2js

draw(g)

Parameters:
Name Type Description
g java.awt.Graphics

-

Author:
  • Created by ijdoc2js

drawOverlay(g)

Parameters:
Name Type Description
g java.awt.Graphics

-

Author:
  • Created by ijdoc2js

drawPixels(ip)

Draws the selection outline on the specified ImageProcessor.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

drawPixels()

Deprecated. replaced by drawPixels(ImageProcessor)

Deprecated:
  • replaced by drawPixels(ImageProcessor)
Author:
  • Created by ijdoc2js

enableSubPixelResolution()

Author:
  • Created by ijdoc2js

endPaste()

Author:
  • Created by ijdoc2js

equals(obj)

Checks whether two rectangles are equal.

Parameters:
Name Type Description
obj java.lang.Object

-

Author:
  • Created by ijdoc2js
Returns:

boolean

getAngle(x1, y1, x2, y2)

Returns the angle in degrees between the specified line and a horizontal line.

Parameters:
Name Type Description
x1 int

-

y1 int

-

x2 int

-

y2 int

-

Author:
  • Created by ijdoc2js
Returns:

double

getAngle()

Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).

Author:
  • Created by ijdoc2js
Returns:

double

getBoundingRect()

Deprecated. replaced by getBounds()

Deprecated:
  • replaced by getBounds()
Author:
  • Created by ijdoc2js
Returns:

java.awt.Rectangle

getBounds()

Return this selection's bounding rectangle.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Rectangle

getColor()

Returns the default (global) color used for drawing ROI outlines.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getContainedFloatPoints()

Returns the coordinates of the pixels inside this ROI as a FloatPolygon.

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getContainedPoints()

Returns the coordinates of the pixels inside this ROI as an array of Points.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Point[]

getContourCentroid()

Author:
  • Created by ijdoc2js
Returns:

double[]

getConvexHull()

Author:
  • Created by ijdoc2js
Returns:

java.awt.Polygon

getCornerDiameter()

Returns the rounded rectangle corner diameter (pixels).

Author:
  • Created by ijdoc2js
Returns:

int

getCPosition()

Returns the channel position of this ROI, or zero if this ROI is not associated with a particular channel.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentPasteMode()

Returns the current paste transfer mode.

Author:
  • Created by ijdoc2js
Returns:

int

getDebugInfo()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getDefaultFillColor()

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

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

Author:
  • Created by ijdoc2js
Returns:

boolean

getFeretsDiameter()

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

Author:
  • Created by ijdoc2js
Returns:

double

getFeretValues()

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

Author:
  • Created by ijdoc2js
Returns:

double[]

getFillColor()

Returns the fill color used to display this ROI, or null if it is displayed transparently.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getFloatAngle(x1, y1, x2, y2)

Returns the angle in degrees between the specified line and a horizontal line.

Parameters:
Name Type Description
x1 double

-

y1 double

-

x2 double

-

y2 double

-

Author:
  • Created by ijdoc2js
Returns:

double

getFloatBounds()

Return this selection's bounding rectangle.

Author:
  • Created by ijdoc2js
Returns:

java.awt.geom.Rectangle2D.Double

getFloatHeight()

Author:
  • Created by ijdoc2js
Returns:

double

getFloatPolygon()

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getFloatWidth()

Author:
  • Created by ijdoc2js
Returns:

double

getHashCode()

Returns a hashcode for this Roi that typically changes if it is moved, even though it is still the same object.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns the ImagePlus associated with this ROI, or null.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getImageID()

Returns the ID of the image associated with this ROI.

Author:
  • Created by ijdoc2js
Returns:

int

getInterpolatedPolygon()

Returns, as a FloatPolygon, an interpolated version of this selection that has points spaced 1.0 pixel apart.

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getInterpolatedPolygon(interval, smooth)

Returns, as a FloatPolygon, an interpolated version of this selection with points spaced 'interval' pixels apart. If 'smooth' is true, traced and freehand selections are first smoothed using a 3 point running average.

Parameters:
Name Type Description
interval double

-

smooth boolean

-

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getLength()

Returns the perimeter length.

Author:
  • Created by ijdoc2js
Returns:

double

getMask()

Always returns null for rectangular Roi's

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getName()

Returns the name of this ROI, or null.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getPasteMode()

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

Author:
  • Created by ijdoc2js
Returns:

int

getPolygon()

Returns the outline of this selection as a Polygon, or null if this is a straight line selection.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Polygon

getPosition()

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

Author:
  • Created by ijdoc2js
Returns:

int

getProperties()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperty(property)

Parameters:
Name Type Description
property java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getPropertyCount()

Author:
  • Created by ijdoc2js
Returns:

int

getPrototypeOverlay()

Author:
  • Created by ijdoc2js
Returns:

Overlay

getRotationCenter()

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getRoundRectArcSize()

Obsolete; replaced by getCornerDiameter().

Author:
  • Created by ijdoc2js
Returns:

int

getState()

Author:
  • Created by ijdoc2js
Returns:

int

getStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStroke()

Returns the Stroke used to draw this ROI, or null if no Stroke is used.

Author:
  • Created by ijdoc2js
Returns:

java.awt.BasicStroke

getStrokeColor()

Returns the the color used to draw the ROI outline or null if the default color is being used.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getStrokeWidth()

Returns the lineWidth.

Author:
  • Created by ijdoc2js
Returns:

float

getTPosition()

Returns the frame position of this ROI, or zero if this ROI is not associated with a particular frame.

Author:
  • Created by ijdoc2js
Returns:

int

getType()

Author:
  • Created by ijdoc2js
Returns:

int

getTypeAsString()

Convenience method that converts Roi type to a human-readable form.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getXBase()

Author:
  • Created by ijdoc2js
Returns:

double

getYBase()

Author:
  • Created by ijdoc2js
Returns:

double

getZPosition()

Returns the slice position of this ROI, or zero if this ROI is not associated with a particular slice.

Author:
  • Created by ijdoc2js
Returns:

int

isActiveOverlayRoi()

Returns 'true' if this ROI is displayed and is also in an overlay.

Author:
  • Created by ijdoc2js
Returns:

boolean

isArea()

Returns 'true' if this is an area selection.

Author:
  • Created by ijdoc2js
Returns:

boolean

isCursor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isDrawingTool()

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

Author:
  • Created by ijdoc2js
Returns:

boolean

isHandle(sx, sy)

Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js
Returns:

int

isLine()

Returns 'true' if this is a line selection.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this ROI is currently displayed on an image.

Author:
  • Created by ijdoc2js
Returns:

boolean

iterator()

Required by the Interable interface. Use to iterate over the contained coordinates. Usage example:

 for (Point p : roi) {
// process p
}
Author:
  • Created by ijdoc2js
Returns:

java.util.Iterator<java.awt.Point>

lineCircleIntersection(ax, ay, bx, by, cx, cy, rad, ignoreOutside)

 Calculates intersections of a line segment with a circle
Author N.Vischer
ax, ay, bx, by: points A and B of line segment
cx, cy, rad: Circle center and radius.
ignoreOutside: if true, ignores intersections outside the line segment A-B
Parameters:
Name Type Description
ax double

-

ay double

-

bx double

-

by double

-

cx double

-

cy double

-

rad double

-

ignoreOutside boolean

-

Author:
  • Created by ijdoc2js
Returns:

double[]

mouseDragged(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

mouseMoved(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

mouseReleased(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

notifyListeners(id)

Parameters:
Name Type Description
id int

-

Author:
  • Created by ijdoc2js

nudge(key)

Nudge ROI one pixel on arrow key press.

Parameters:
Name Type Description
key int

-

Author:
  • Created by ijdoc2js

nudgeCorner(key)

Nudge lower right corner of rectangular and oval ROIs by one pixel based on arrow key press.

Parameters:
Name Type Description
key int

-

Author:
  • Created by ijdoc2js

removeRoiListener(listener)

Parameters:
Name Type Description
listener RoiListener

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets the default (global) color used for ROI outlines.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setCornerDiameter(cornerDiameter)

Sets the rounded rectangle corner diameter (pixels).

Parameters:
Name Type Description
cornerDiameter int

-

Author:
  • Created by ijdoc2js

setDefaultFillColor(color)

Parameters:
Name Type Description
color java.awt.Color

-

Author:
  • Created by ijdoc2js

setDrawOffset(drawOffset)

Parameters:
Name Type Description
drawOffset boolean

-

Author:
  • Created by ijdoc2js

setFillColor(color)

Sets the fill color used to display this ROI, or set to null to display it transparently.

Parameters:
Name Type Description
color java.awt.Color

-

Author:
  • Created by ijdoc2js

setIgnoreClipRect(ignoreClipRect)

Parameters:
Name Type Description
ignoreClipRect boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setInstanceColor(c)

Parameters:
Name Type Description
c java.awt.Color

-

Deprecated:
  • replaced by setStrokeColor()
Author:
  • Created by ijdoc2js

setIsCursor(isCursor)

Parameters:
Name Type Description
isCursor boolean

-

Author:
  • Created by ijdoc2js

setLineWidth(width)

Deprecated. replaced by setStrokeWidth(int)

Parameters:
Name Type Description
width int

-

Deprecated:
  • replaced by setStrokeWidth(int)
Author:
  • Created by ijdoc2js

setLocation(x, y)

Set the location of the ROI in image coordinates.

Parameters:
Name Type Description
x double

-

y double

-

Author:
  • Created by ijdoc2js

setLocation(x, y)

Set the location of the ROI in image coordinates.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

setName(name)

Sets the name of this ROI.

Parameters:
Name Type Description
name java.lang.String

-

Author:
  • Created by ijdoc2js

setNonScalable(nonScalable)

Set 'nonScalable' true to have TextRois in a display list drawn at a fixed location and size.

Parameters:
Name Type Description
nonScalable boolean

-

Author:
  • Created by ijdoc2js

setPasteMode(transferMode)

Sets the Paste transfer mode.

Parameters:
Name Type Description
transferMode int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the hyperstack position of this ROI. In an overlay, this ROI is only displayed when the hyperstack is at the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

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

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setProperties(properties)

Parameters:
Name Type Description
properties java.lang.String

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.String

-

Author:
  • Created by ijdoc2js

setPrototypeOverlay(overlay)

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setRotationCenter(x, y)

Parameters:
Name Type Description
x double

-

y double

-

Author:
  • Created by ijdoc2js

setRoundRectArcSize(cornerDiameter)

Obsolete; replaced by setCornerDiameter().

Parameters:
Name Type Description
cornerDiameter int

-

Author:
  • Created by ijdoc2js

setStroke(stroke)

Sets the Stroke used to draw this ROI.

Parameters:
Name Type Description
stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

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

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setStrokeWidth(width)

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

Parameters:
Name Type Description
width double

-

Author:
  • Created by ijdoc2js

setStrokeWidth(width)

Sets the width of the line used to draw this ROI. Set the width to 0.0 and the ROI will be drawn using a a 1 pixel stroke width regardless of the magnification.

Parameters:
Name Type Description
width float

-

Author:
  • Created by ijdoc2js

startPaste(clipboard)

Parameters:
Name Type Description
clipboard ImagePlus

-

Author:
  • Created by ijdoc2js

subPixelResolution()

Returns true if this is a slection that supports sub-pixel resolution.

Author:
  • Created by ijdoc2js
Returns:

boolean

temporarilyHide()

Deprecated

Deprecated:
  • d
Author:
  • Created by ijdoc2js

toFloat(arr)

Converts an int array to a float array.

Parameters:
Name Type Description
arr Array.<int>

-

Author:
  • Created by ijdoc2js
Returns:

float[]

toInt(arr, arr2, size)

Parameters:
Name Type Description
arr Array.<float>

-

arr2 Array.<int>

-

size int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toInt(arr)

Converts a float array to an int array using truncation.

Parameters:
Name Type Description
arr Array.<float>

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toIntR(arr)

Converts a float array to an int array using rounding.

Parameters:
Name Type Description
arr Array.<float>

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

update(add, 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.

Parameters:
Name Type Description
add boolean

-

subtract boolean

-

Author:
  • Created by ijdoc2js

updateWideLine(width)

Parameters:
Name Type Description
width float

-

Author:
  • Created by ijdoc2js

Roi

new Roi(sx, sy, imp, cornerDiameter)

Starts the process of creating a user-defined rectangular Roi, where sx and sy are the starting screen coordinates.

Parameters:
Name Type Description
sx int

-

sy int

-

imp ImagePlus

-

cornerDiameter int

-

Author:
  • Created by ijdoc2js

Members

(static, constant) ANGLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COMPOSITE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) CONSTRUCTING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) FREELINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) FREEROI :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) HANDLE_SIZE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) LINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) MOVING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) MOVING_HANDLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) NORMAL :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) NOT_PASTING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) onePixelWide :java.awt.BasicStroke

Type:
  • java.awt.BasicStroke
Author:
  • Created by ijdoc2js

(static, constant) OVAL :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POINT :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POLYGON :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POLYLINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) previousRoi :Roi

Type:
Author:
  • Created by ijdoc2js

(static, constant) RECTANGLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) RESIZING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) TRACED_ROI :int

Type:
  • int
Author:
  • Created by ijdoc2js

Methods

abortPaste()

Author:
  • Created by ijdoc2js

addRoiListener(listener)

Parameters:
Name Type Description
listener RoiListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a copy of this roi. See Thinking is Java by Bruce Eckel (www.eckelobjects.com) for a good description of object cloning.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

contains(x, y)

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

copyAttributes(roi2)

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

Parameters:
Name Type Description
roi2 Roi

-

Author:
  • Created by ijdoc2js

draw(g)

Parameters:
Name Type Description
g java.awt.Graphics

-

Author:
  • Created by ijdoc2js

drawOverlay(g)

Parameters:
Name Type Description
g java.awt.Graphics

-

Author:
  • Created by ijdoc2js

drawPixels(ip)

Draws the selection outline on the specified ImageProcessor.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

drawPixels()

Deprecated. replaced by drawPixels(ImageProcessor)

Deprecated:
  • replaced by drawPixels(ImageProcessor)
Author:
  • Created by ijdoc2js

enableSubPixelResolution()

Author:
  • Created by ijdoc2js

endPaste()

Author:
  • Created by ijdoc2js

equals(obj)

Checks whether two rectangles are equal.

Parameters:
Name Type Description
obj java.lang.Object

-

Author:
  • Created by ijdoc2js
Returns:

boolean

getAngle(x1, y1, x2, y2)

Returns the angle in degrees between the specified line and a horizontal line.

Parameters:
Name Type Description
x1 int

-

y1 int

-

x2 int

-

y2 int

-

Author:
  • Created by ijdoc2js
Returns:

double

getAngle()

Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).

Author:
  • Created by ijdoc2js
Returns:

double

getBoundingRect()

Deprecated. replaced by getBounds()

Deprecated:
  • replaced by getBounds()
Author:
  • Created by ijdoc2js
Returns:

java.awt.Rectangle

getBounds()

Return this selection's bounding rectangle.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Rectangle

getColor()

Returns the default (global) color used for drawing ROI outlines.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getContainedFloatPoints()

Returns the coordinates of the pixels inside this ROI as a FloatPolygon.

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getContainedPoints()

Returns the coordinates of the pixels inside this ROI as an array of Points.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Point[]

getContourCentroid()

Author:
  • Created by ijdoc2js
Returns:

double[]

getConvexHull()

Author:
  • Created by ijdoc2js
Returns:

java.awt.Polygon

getCornerDiameter()

Returns the rounded rectangle corner diameter (pixels).

Author:
  • Created by ijdoc2js
Returns:

int

getCPosition()

Returns the channel position of this ROI, or zero if this ROI is not associated with a particular channel.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentPasteMode()

Returns the current paste transfer mode.

Author:
  • Created by ijdoc2js
Returns:

int

getDebugInfo()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getDefaultFillColor()

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

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

Author:
  • Created by ijdoc2js
Returns:

boolean

getFeretsDiameter()

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

Author:
  • Created by ijdoc2js
Returns:

double

getFeretValues()

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

Author:
  • Created by ijdoc2js
Returns:

double[]

getFillColor()

Returns the fill color used to display this ROI, or null if it is displayed transparently.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getFloatAngle(x1, y1, x2, y2)

Returns the angle in degrees between the specified line and a horizontal line.

Parameters:
Name Type Description
x1 double

-

y1 double

-

x2 double

-

y2 double

-

Author:
  • Created by ijdoc2js
Returns:

double

getFloatBounds()

Return this selection's bounding rectangle.

Author:
  • Created by ijdoc2js
Returns:

java.awt.geom.Rectangle2D.Double

getFloatHeight()

Author:
  • Created by ijdoc2js
Returns:

double

getFloatPolygon()

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getFloatWidth()

Author:
  • Created by ijdoc2js
Returns:

double

getHashCode()

Returns a hashcode for this Roi that typically changes if it is moved, even though it is still the same object.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns the ImagePlus associated with this ROI, or null.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getImageID()

Returns the ID of the image associated with this ROI.

Author:
  • Created by ijdoc2js
Returns:

int

getInterpolatedPolygon()

Returns, as a FloatPolygon, an interpolated version of this selection that has points spaced 1.0 pixel apart.

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getInterpolatedPolygon(interval, smooth)

Returns, as a FloatPolygon, an interpolated version of this selection with points spaced 'interval' pixels apart. If 'smooth' is true, traced and freehand selections are first smoothed using a 3 point running average.

Parameters:
Name Type Description
interval double

-

smooth boolean

-

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getLength()

Returns the perimeter length.

Author:
  • Created by ijdoc2js
Returns:

double

getMask()

Always returns null for rectangular Roi's

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getName()

Returns the name of this ROI, or null.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getPasteMode()

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

Author:
  • Created by ijdoc2js
Returns:

int

getPolygon()

Returns the outline of this selection as a Polygon, or null if this is a straight line selection.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Polygon

getPosition()

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

Author:
  • Created by ijdoc2js
Returns:

int

getProperties()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperty(property)

Parameters:
Name Type Description
property java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getPropertyCount()

Author:
  • Created by ijdoc2js
Returns:

int

getPrototypeOverlay()

Author:
  • Created by ijdoc2js
Returns:

Overlay

getRotationCenter()

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getRoundRectArcSize()

Obsolete; replaced by getCornerDiameter().

Author:
  • Created by ijdoc2js
Returns:

int

getState()

Author:
  • Created by ijdoc2js
Returns:

int

getStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStroke()

Returns the Stroke used to draw this ROI, or null if no Stroke is used.

Author:
  • Created by ijdoc2js
Returns:

java.awt.BasicStroke

getStrokeColor()

Returns the the color used to draw the ROI outline or null if the default color is being used.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getStrokeWidth()

Returns the lineWidth.

Author:
  • Created by ijdoc2js
Returns:

float

getTPosition()

Returns the frame position of this ROI, or zero if this ROI is not associated with a particular frame.

Author:
  • Created by ijdoc2js
Returns:

int

getType()

Author:
  • Created by ijdoc2js
Returns:

int

getTypeAsString()

Convenience method that converts Roi type to a human-readable form.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getXBase()

Author:
  • Created by ijdoc2js
Returns:

double

getYBase()

Author:
  • Created by ijdoc2js
Returns:

double

getZPosition()

Returns the slice position of this ROI, or zero if this ROI is not associated with a particular slice.

Author:
  • Created by ijdoc2js
Returns:

int

isActiveOverlayRoi()

Returns 'true' if this ROI is displayed and is also in an overlay.

Author:
  • Created by ijdoc2js
Returns:

boolean

isArea()

Returns 'true' if this is an area selection.

Author:
  • Created by ijdoc2js
Returns:

boolean

isCursor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isDrawingTool()

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

Author:
  • Created by ijdoc2js
Returns:

boolean

isHandle(sx, sy)

Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js
Returns:

int

isLine()

Returns 'true' if this is a line selection.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this ROI is currently displayed on an image.

Author:
  • Created by ijdoc2js
Returns:

boolean

iterator()

Required by the Interable interface. Use to iterate over the contained coordinates. Usage example:

 for (Point p : roi) {
// process p
}
Author:
  • Created by ijdoc2js
Returns:

java.util.Iterator<java.awt.Point>

lineCircleIntersection(ax, ay, bx, by, cx, cy, rad, ignoreOutside)

 Calculates intersections of a line segment with a circle
Author N.Vischer
ax, ay, bx, by: points A and B of line segment
cx, cy, rad: Circle center and radius.
ignoreOutside: if true, ignores intersections outside the line segment A-B
Parameters:
Name Type Description
ax double

-

ay double

-

bx double

-

by double

-

cx double

-

cy double

-

rad double

-

ignoreOutside boolean

-

Author:
  • Created by ijdoc2js
Returns:

double[]

mouseDragged(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

mouseMoved(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

mouseReleased(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

notifyListeners(id)

Parameters:
Name Type Description
id int

-

Author:
  • Created by ijdoc2js

nudge(key)

Nudge ROI one pixel on arrow key press.

Parameters:
Name Type Description
key int

-

Author:
  • Created by ijdoc2js

nudgeCorner(key)

Nudge lower right corner of rectangular and oval ROIs by one pixel based on arrow key press.

Parameters:
Name Type Description
key int

-

Author:
  • Created by ijdoc2js

removeRoiListener(listener)

Parameters:
Name Type Description
listener RoiListener

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets the default (global) color used for ROI outlines.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setCornerDiameter(cornerDiameter)

Sets the rounded rectangle corner diameter (pixels).

Parameters:
Name Type Description
cornerDiameter int

-

Author:
  • Created by ijdoc2js

setDefaultFillColor(color)

Parameters:
Name Type Description
color java.awt.Color

-

Author:
  • Created by ijdoc2js

setDrawOffset(drawOffset)

Parameters:
Name Type Description
drawOffset boolean

-

Author:
  • Created by ijdoc2js

setFillColor(color)

Sets the fill color used to display this ROI, or set to null to display it transparently.

Parameters:
Name Type Description
color java.awt.Color

-

Author:
  • Created by ijdoc2js

setIgnoreClipRect(ignoreClipRect)

Parameters:
Name Type Description
ignoreClipRect boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setInstanceColor(c)

Parameters:
Name Type Description
c java.awt.Color

-

Deprecated:
  • replaced by setStrokeColor()
Author:
  • Created by ijdoc2js

setIsCursor(isCursor)

Parameters:
Name Type Description
isCursor boolean

-

Author:
  • Created by ijdoc2js

setLineWidth(width)

Deprecated. replaced by setStrokeWidth(int)

Parameters:
Name Type Description
width int

-

Deprecated:
  • replaced by setStrokeWidth(int)
Author:
  • Created by ijdoc2js

setLocation(x, y)

Set the location of the ROI in image coordinates.

Parameters:
Name Type Description
x double

-

y double

-

Author:
  • Created by ijdoc2js

setLocation(x, y)

Set the location of the ROI in image coordinates.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

setName(name)

Sets the name of this ROI.

Parameters:
Name Type Description
name java.lang.String

-

Author:
  • Created by ijdoc2js

setNonScalable(nonScalable)

Set 'nonScalable' true to have TextRois in a display list drawn at a fixed location and size.

Parameters:
Name Type Description
nonScalable boolean

-

Author:
  • Created by ijdoc2js

setPasteMode(transferMode)

Sets the Paste transfer mode.

Parameters:
Name Type Description
transferMode int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the hyperstack position of this ROI. In an overlay, this ROI is only displayed when the hyperstack is at the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

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

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setProperties(properties)

Parameters:
Name Type Description
properties java.lang.String

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.String

-

Author:
  • Created by ijdoc2js

setPrototypeOverlay(overlay)

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setRotationCenter(x, y)

Parameters:
Name Type Description
x double

-

y double

-

Author:
  • Created by ijdoc2js

setRoundRectArcSize(cornerDiameter)

Obsolete; replaced by setCornerDiameter().

Parameters:
Name Type Description
cornerDiameter int

-

Author:
  • Created by ijdoc2js

setStroke(stroke)

Sets the Stroke used to draw this ROI.

Parameters:
Name Type Description
stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

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

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setStrokeWidth(width)

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

Parameters:
Name Type Description
width double

-

Author:
  • Created by ijdoc2js

setStrokeWidth(width)

Sets the width of the line used to draw this ROI. Set the width to 0.0 and the ROI will be drawn using a a 1 pixel stroke width regardless of the magnification.

Parameters:
Name Type Description
width float

-

Author:
  • Created by ijdoc2js

startPaste(clipboard)

Parameters:
Name Type Description
clipboard ImagePlus

-

Author:
  • Created by ijdoc2js

subPixelResolution()

Returns true if this is a slection that supports sub-pixel resolution.

Author:
  • Created by ijdoc2js
Returns:

boolean

temporarilyHide()

Deprecated

Deprecated:
  • d
Author:
  • Created by ijdoc2js

toFloat(arr)

Converts an int array to a float array.

Parameters:
Name Type Description
arr Array.<int>

-

Author:
  • Created by ijdoc2js
Returns:

float[]

toInt(arr, arr2, size)

Parameters:
Name Type Description
arr Array.<float>

-

arr2 Array.<int>

-

size int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toInt(arr)

Converts a float array to an int array using truncation.

Parameters:
Name Type Description
arr Array.<float>

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toIntR(arr)

Converts a float array to an int array using rounding.

Parameters:
Name Type Description
arr Array.<float>

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

update(add, 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.

Parameters:
Name Type Description
add boolean

-

subtract boolean

-

Author:
  • Created by ijdoc2js

updateWideLine(width)

Parameters:
Name Type Description
width float

-

Author:
  • Created by ijdoc2js

Roi

new Roi(x, y, width, height, cornerDiameter)

Creates a new (rounded) rectangular ROI.

Parameters:
Name Type Description
x number

-

y number

-

width number

-

height number

-

cornerDiameter number

-

Author:
  • Created by ijdoc2js

Members

(static, constant) ANGLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) COMPOSITE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) CONSTRUCTING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) FREELINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) FREEROI :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) HANDLE_SIZE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) LINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) MOVING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) MOVING_HANDLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) NORMAL :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) NOT_PASTING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) onePixelWide :java.awt.BasicStroke

Type:
  • java.awt.BasicStroke
Author:
  • Created by ijdoc2js

(static, constant) OVAL :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POINT :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POLYGON :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) POLYLINE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) previousRoi :Roi

Type:
Author:
  • Created by ijdoc2js

(static, constant) RECTANGLE :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) RESIZING :int

Type:
  • int
Author:
  • Created by ijdoc2js

(static, constant) TRACED_ROI :int

Type:
  • int
Author:
  • Created by ijdoc2js

Methods

abortPaste()

Author:
  • Created by ijdoc2js

addRoiListener(listener)

Parameters:
Name Type Description
listener RoiListener

-

Author:
  • Created by ijdoc2js

clone()

Returns a copy of this roi. See Thinking is Java by Bruce Eckel (www.eckelobjects.com) for a good description of object cloning.

Author:
  • Created by ijdoc2js
Returns:

java.lang.Object

contains(x, y)

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js
Returns:

boolean

copyAttributes(roi2)

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

Parameters:
Name Type Description
roi2 Roi

-

Author:
  • Created by ijdoc2js

draw(g)

Parameters:
Name Type Description
g java.awt.Graphics

-

Author:
  • Created by ijdoc2js

drawOverlay(g)

Parameters:
Name Type Description
g java.awt.Graphics

-

Author:
  • Created by ijdoc2js

drawPixels(ip)

Draws the selection outline on the specified ImageProcessor.

Parameters:
Name Type Description
ip ImageProcessor

-

Author:
  • Created by ijdoc2js

drawPixels()

Deprecated. replaced by drawPixels(ImageProcessor)

Deprecated:
  • replaced by drawPixels(ImageProcessor)
Author:
  • Created by ijdoc2js

enableSubPixelResolution()

Author:
  • Created by ijdoc2js

endPaste()

Author:
  • Created by ijdoc2js

equals(obj)

Checks whether two rectangles are equal.

Parameters:
Name Type Description
obj java.lang.Object

-

Author:
  • Created by ijdoc2js
Returns:

boolean

getAngle(x1, y1, x2, y2)

Returns the angle in degrees between the specified line and a horizontal line.

Parameters:
Name Type Description
x1 int

-

y1 int

-

x2 int

-

y2 int

-

Author:
  • Created by ijdoc2js
Returns:

double

getAngle()

Overridden by PolygonRoi (angle between first two points), TextRoi (text angle) and Line (line angle).

Author:
  • Created by ijdoc2js
Returns:

double

getBoundingRect()

Deprecated. replaced by getBounds()

Deprecated:
  • replaced by getBounds()
Author:
  • Created by ijdoc2js
Returns:

java.awt.Rectangle

getBounds()

Return this selection's bounding rectangle.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Rectangle

getColor()

Returns the default (global) color used for drawing ROI outlines.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getContainedFloatPoints()

Returns the coordinates of the pixels inside this ROI as a FloatPolygon.

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getContainedPoints()

Returns the coordinates of the pixels inside this ROI as an array of Points.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Point[]

getContourCentroid()

Author:
  • Created by ijdoc2js
Returns:

double[]

getConvexHull()

Author:
  • Created by ijdoc2js
Returns:

java.awt.Polygon

getCornerDiameter()

Returns the rounded rectangle corner diameter (pixels).

Author:
  • Created by ijdoc2js
Returns:

int

getCPosition()

Returns the channel position of this ROI, or zero if this ROI is not associated with a particular channel.

Author:
  • Created by ijdoc2js
Returns:

int

getCurrentPasteMode()

Returns the current paste transfer mode.

Author:
  • Created by ijdoc2js
Returns:

int

getDebugInfo()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getDefaultFillColor()

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

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

Author:
  • Created by ijdoc2js
Returns:

boolean

getFeretsDiameter()

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

Author:
  • Created by ijdoc2js
Returns:

double

getFeretValues()

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

Author:
  • Created by ijdoc2js
Returns:

double[]

getFillColor()

Returns the fill color used to display this ROI, or null if it is displayed transparently.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getFloatAngle(x1, y1, x2, y2)

Returns the angle in degrees between the specified line and a horizontal line.

Parameters:
Name Type Description
x1 double

-

y1 double

-

x2 double

-

y2 double

-

Author:
  • Created by ijdoc2js
Returns:

double

getFloatBounds()

Return this selection's bounding rectangle.

Author:
  • Created by ijdoc2js
Returns:

java.awt.geom.Rectangle2D.Double

getFloatHeight()

Author:
  • Created by ijdoc2js
Returns:

double

getFloatPolygon()

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getFloatWidth()

Author:
  • Created by ijdoc2js
Returns:

double

getHashCode()

Returns a hashcode for this Roi that typically changes if it is moved, even though it is still the same object.

Author:
  • Created by ijdoc2js
Returns:

int

getImage()

Returns the ImagePlus associated with this ROI, or null.

Author:
  • Created by ijdoc2js
Returns:

ImagePlus

getImageID()

Returns the ID of the image associated with this ROI.

Author:
  • Created by ijdoc2js
Returns:

int

getInterpolatedPolygon()

Returns, as a FloatPolygon, an interpolated version of this selection that has points spaced 1.0 pixel apart.

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getInterpolatedPolygon(interval, smooth)

Returns, as a FloatPolygon, an interpolated version of this selection with points spaced 'interval' pixels apart. If 'smooth' is true, traced and freehand selections are first smoothed using a 3 point running average.

Parameters:
Name Type Description
interval double

-

smooth boolean

-

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getLength()

Returns the perimeter length.

Author:
  • Created by ijdoc2js
Returns:

double

getMask()

Always returns null for rectangular Roi's

Author:
  • Created by ijdoc2js
Returns:

ImageProcessor

getName()

Returns the name of this ROI, or null.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getPasteMode()

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

Author:
  • Created by ijdoc2js
Returns:

int

getPolygon()

Returns the outline of this selection as a Polygon, or null if this is a straight line selection.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Polygon

getPosition()

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

Author:
  • Created by ijdoc2js
Returns:

int

getProperties()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getProperty(property)

Parameters:
Name Type Description
property java.lang.String

-

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getPropertyCount()

Author:
  • Created by ijdoc2js
Returns:

int

getPrototypeOverlay()

Author:
  • Created by ijdoc2js
Returns:

Overlay

getRotationCenter()

Author:
  • Created by ijdoc2js
Returns:

FloatPolygon

getRoundRectArcSize()

Obsolete; replaced by getCornerDiameter().

Author:
  • Created by ijdoc2js
Returns:

int

getState()

Author:
  • Created by ijdoc2js
Returns:

int

getStatistics()

Author:
  • Created by ijdoc2js
Returns:

ImageStatistics

getStroke()

Returns the Stroke used to draw this ROI, or null if no Stroke is used.

Author:
  • Created by ijdoc2js
Returns:

java.awt.BasicStroke

getStrokeColor()

Returns the the color used to draw the ROI outline or null if the default color is being used.

Author:
  • Created by ijdoc2js
Returns:

java.awt.Color

getStrokeWidth()

Returns the lineWidth.

Author:
  • Created by ijdoc2js
Returns:

float

getTPosition()

Returns the frame position of this ROI, or zero if this ROI is not associated with a particular frame.

Author:
  • Created by ijdoc2js
Returns:

int

getType()

Author:
  • Created by ijdoc2js
Returns:

int

getTypeAsString()

Convenience method that converts Roi type to a human-readable form.

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

getXBase()

Author:
  • Created by ijdoc2js
Returns:

double

getYBase()

Author:
  • Created by ijdoc2js
Returns:

double

getZPosition()

Returns the slice position of this ROI, or zero if this ROI is not associated with a particular slice.

Author:
  • Created by ijdoc2js
Returns:

int

isActiveOverlayRoi()

Returns 'true' if this ROI is displayed and is also in an overlay.

Author:
  • Created by ijdoc2js
Returns:

boolean

isArea()

Returns 'true' if this is an area selection.

Author:
  • Created by ijdoc2js
Returns:

boolean

isCursor()

Author:
  • Created by ijdoc2js
Returns:

boolean

isDrawingTool()

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

Author:
  • Created by ijdoc2js
Returns:

boolean

isHandle(sx, sy)

Returns a handle number if the specified screen coordinates are inside or near a handle, otherwise returns -1.

Parameters:
Name Type Description
sx int

-

sy int

-

Author:
  • Created by ijdoc2js
Returns:

int

isLine()

Returns 'true' if this is a line selection.

Author:
  • Created by ijdoc2js
Returns:

boolean

isVisible()

Returns true if this ROI is currently displayed on an image.

Author:
  • Created by ijdoc2js
Returns:

boolean

iterator()

Required by the Interable interface. Use to iterate over the contained coordinates. Usage example:

 for (Point p : roi) {
// process p
}
Author:
  • Created by ijdoc2js
Returns:

java.util.Iterator<java.awt.Point>

lineCircleIntersection(ax, ay, bx, by, cx, cy, rad, ignoreOutside)

 Calculates intersections of a line segment with a circle
Author N.Vischer
ax, ay, bx, by: points A and B of line segment
cx, cy, rad: Circle center and radius.
ignoreOutside: if true, ignores intersections outside the line segment A-B
Parameters:
Name Type Description
ax double

-

ay double

-

bx double

-

by double

-

cx double

-

cy double

-

rad double

-

ignoreOutside boolean

-

Author:
  • Created by ijdoc2js
Returns:

double[]

mouseDragged(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

mouseMoved(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

mouseReleased(e)

Parameters:
Name Type Description
e java.awt.event.MouseEvent

-

Author:
  • Created by ijdoc2js

notifyListeners(id)

Parameters:
Name Type Description
id int

-

Author:
  • Created by ijdoc2js

nudge(key)

Nudge ROI one pixel on arrow key press.

Parameters:
Name Type Description
key int

-

Author:
  • Created by ijdoc2js

nudgeCorner(key)

Nudge lower right corner of rectangular and oval ROIs by one pixel based on arrow key press.

Parameters:
Name Type Description
key int

-

Author:
  • Created by ijdoc2js

removeRoiListener(listener)

Parameters:
Name Type Description
listener RoiListener

-

Author:
  • Created by ijdoc2js

setColor(c)

Sets the default (global) color used for ROI outlines.

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setCornerDiameter(cornerDiameter)

Sets the rounded rectangle corner diameter (pixels).

Parameters:
Name Type Description
cornerDiameter int

-

Author:
  • Created by ijdoc2js

setDefaultFillColor(color)

Parameters:
Name Type Description
color java.awt.Color

-

Author:
  • Created by ijdoc2js

setDrawOffset(drawOffset)

Parameters:
Name Type Description
drawOffset boolean

-

Author:
  • Created by ijdoc2js

setFillColor(color)

Sets the fill color used to display this ROI, or set to null to display it transparently.

Parameters:
Name Type Description
color java.awt.Color

-

Author:
  • Created by ijdoc2js

setIgnoreClipRect(ignoreClipRect)

Parameters:
Name Type Description
ignoreClipRect boolean

-

Author:
  • Created by ijdoc2js

setImage(imp)

Parameters:
Name Type Description
imp ImagePlus

-

Author:
  • Created by ijdoc2js

setInstanceColor(c)

Parameters:
Name Type Description
c java.awt.Color

-

Deprecated:
  • replaced by setStrokeColor()
Author:
  • Created by ijdoc2js

setIsCursor(isCursor)

Parameters:
Name Type Description
isCursor boolean

-

Author:
  • Created by ijdoc2js

setLineWidth(width)

Deprecated. replaced by setStrokeWidth(int)

Parameters:
Name Type Description
width int

-

Deprecated:
  • replaced by setStrokeWidth(int)
Author:
  • Created by ijdoc2js

setLocation(x, y)

Set the location of the ROI in image coordinates.

Parameters:
Name Type Description
x double

-

y double

-

Author:
  • Created by ijdoc2js

setLocation(x, y)

Set the location of the ROI in image coordinates.

Parameters:
Name Type Description
x int

-

y int

-

Author:
  • Created by ijdoc2js

setName(name)

Sets the name of this ROI.

Parameters:
Name Type Description
name java.lang.String

-

Author:
  • Created by ijdoc2js

setNonScalable(nonScalable)

Set 'nonScalable' true to have TextRois in a display list drawn at a fixed location and size.

Parameters:
Name Type Description
nonScalable boolean

-

Author:
  • Created by ijdoc2js

setPasteMode(transferMode)

Sets the Paste transfer mode.

Parameters:
Name Type Description
transferMode int

-

Author:
  • Created by ijdoc2js

setPosition(channel, slice, frame)

Sets the hyperstack position of this ROI. In an overlay, this ROI is only displayed when the hyperstack is at the specified position.

Parameters:
Name Type Description
channel int

-

slice int

-

frame int

-

Author:
  • Created by ijdoc2js

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

Parameters:
Name Type Description
n int

-

Author:
  • Created by ijdoc2js

setProperties(properties)

Parameters:
Name Type Description
properties java.lang.String

-

Author:
  • Created by ijdoc2js

setProperty(key, value)

Parameters:
Name Type Description
key java.lang.String

-

value java.lang.String

-

Author:
  • Created by ijdoc2js

setPrototypeOverlay(overlay)

Parameters:
Name Type Description
overlay Overlay

-

Author:
  • Created by ijdoc2js

setRotationCenter(x, y)

Parameters:
Name Type Description
x double

-

y double

-

Author:
  • Created by ijdoc2js

setRoundRectArcSize(cornerDiameter)

Obsolete; replaced by setCornerDiameter().

Parameters:
Name Type Description
cornerDiameter int

-

Author:
  • Created by ijdoc2js

setStroke(stroke)

Sets the Stroke used to draw this ROI.

Parameters:
Name Type Description
stroke java.awt.BasicStroke

-

Author:
  • Created by ijdoc2js

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

Parameters:
Name Type Description
c java.awt.Color

-

Author:
  • Created by ijdoc2js

setStrokeWidth(width)

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

Parameters:
Name Type Description
width double

-

Author:
  • Created by ijdoc2js

setStrokeWidth(width)

Sets the width of the line used to draw this ROI. Set the width to 0.0 and the ROI will be drawn using a a 1 pixel stroke width regardless of the magnification.

Parameters:
Name Type Description
width float

-

Author:
  • Created by ijdoc2js

startPaste(clipboard)

Parameters:
Name Type Description
clipboard ImagePlus

-

Author:
  • Created by ijdoc2js

subPixelResolution()

Returns true if this is a slection that supports sub-pixel resolution.

Author:
  • Created by ijdoc2js
Returns:

boolean

temporarilyHide()

Deprecated

Deprecated:
  • d
Author:
  • Created by ijdoc2js

toFloat(arr)

Converts an int array to a float array.

Parameters:
Name Type Description
arr Array.<int>

-

Author:
  • Created by ijdoc2js
Returns:

float[]

toInt(arr, arr2, size)

Parameters:
Name Type Description
arr Array.<float>

-

arr2 Array.<int>

-

size int

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toInt(arr)

Converts a float array to an int array using truncation.

Parameters:
Name Type Description
arr Array.<float>

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toIntR(arr)

Converts a float array to an int array using rounding.

Parameters:
Name Type Description
arr Array.<float>

-

Author:
  • Created by ijdoc2js
Returns:

int[]

toString()

Author:
  • Created by ijdoc2js
Returns:

java.lang.String

update(add, 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.

Parameters:
Name Type Description
add boolean

-

subtract boolean

-

Author:
  • Created by ijdoc2js

updateWideLine(width)

Parameters:
Name Type Description
width float

-

Author:
  • Created by ijdoc2js