public class ROI2DPath extends ROI2DShape
ROI2DShape.ROI2DShapePainter
ROI2D.ROI2DPainter
ROI.ROIGroupId, ROI.ROIIdComparator, ROI.ROINameComparator, ROI.ROIPainter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID_POINT |
static java.lang.String |
ID_POINTS |
static java.lang.String |
ID_WINDING |
DEFAULT_COLOR, DEFAULT_NORMAL_COLOR, DEFAULT_OPACITY, DEFAULT_STROKE, defaultColor, defaultOpacity, defaultShowName, defaultStroke, ID_CLASSNAME, ID_COLOR, ID_GROUPID, ID_ID, ID_NAME, ID_OPACITY, ID_PROPERTIES, ID_READONLY, ID_ROI, ID_SELECTED, ID_SHOWNAME, ID_STROKE, idComparator, nameComparator, PROPERTY_COLOR, PROPERTY_CREATING, PROPERTY_GROUPID, PROPERTY_ICON, PROPERTY_NAME, PROPERTY_OPACITY, PROPERTY_READONLY, PROPERTY_SHOWNAME, PROPERTY_STROKE, ROI_CHANGED_ALL, ROI_CHANGED_POSITION
Constructor and Description |
---|
ROI2DPath() |
ROI2DPath(java.awt.geom.Path2D path)
Build a new ROI2DPath from the specified path.
|
ROI2DPath(java.awt.geom.Path2D path,
java.awt.geom.Area closedArea,
java.awt.geom.Path2D openPath)
Build a new ROI2DPath from the specified path.
|
ROI2DPath(java.awt.geom.Point2D position) |
ROI2DPath(java.awt.geom.Point2D pt,
boolean cm)
Deprecated.
|
ROI2DPath(Point5D pt)
Generic constructor for interactive mode
|
ROI2DPath(java.awt.Shape shape)
Build a new ROI2DPath from the specified path.
|
Modifier and Type | Method and Description |
---|---|
ROI |
add(ROI roi,
boolean allowCreate)
Adds content of specified
ROI into this ROI . |
boolean |
canAddPoint()
Return true if this ROI support adding new point
|
boolean |
contains(double x,
double y)
Tests if the specified coordinates are inside the
ROI . |
boolean |
contains(double x,
double y,
double w,
double h)
Tests if the
ROI entirely contains the specified rectangular area. |
boolean |
contains(java.awt.geom.Point2D p)
Tests if a specified
Point2D is inside the ROI. |
boolean |
contains(java.awt.geom.Rectangle2D r)
Tests if the interior of the
ROI entirely contains the specified Rectangle2D . |
boolean |
contains(ROI roi)
Tests if the
ROI entirely contains the specified ROI . |
ROI |
exclusiveAdd(ROI roi,
boolean allowCreate)
Sets the content of this
ROI to be the union of its current content and the
content of the specified ROI , minus their intersection. |
java.awt.geom.Area |
getClosedArea()
Returns the closed area part of the ROI2DPath in
Area shape format |
java.lang.String |
getDefaultName() |
java.awt.geom.Path2D |
getOpenPath()
Returns the open path part of the ROI2DPath in
Path2D shape format |
java.util.List<PathAnchor2D> |
getPathAnchors()
Return the list of control points for this ROI.
|
ROI |
intersect(ROI roi,
boolean allowCreate)
Sets the content of this
ROI to the intersection of
its current content and the content of the specified ROI . |
boolean |
loadFromXML(org.w3c.dom.Node node)
LOAD
|
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
ROI |
subtract(ROI roi,
boolean allowCreate)
Subtract the specified
ROI content from current ROI . |
addNewPoint, addNewPoint, addPoint, addPoint, addPointAt, canRemovePoint, canTranslate, computeBounds2D, computeNumberOfContourPoints, controlPointOverlayChanged, controlPointPositionChanged, getBooleanMask, getControlPoints, getExclusiveUnion, getIntersection, getLength, getPathIterator, getPathIterator, getPoints, getShape, getSubtraction, getUnion, hasSelectedPoint, intersects, intersects, isOverEdge, onChanged, painterChanged, removePoint, removePointAt, removeSelectedPoint, translate, unselectAllPoints
canSetBounds, canSetPosition, computeBounds5D, computeNumberOfPoints, computePerimeter, contains, contains, getArea, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask2D, getBooleanMask2D, getBounds, getBounds2D, getC, getDimension, getPerimeter, getPerimeter, getPosition, getPosition2D, getROI2DList, getROI2DList, getROI2DList, getSubROI, getT, getZ, intersects, intersects, isActiveFor, isActiveFor, isOver, isOver, isOverEdge, isOverEdge, isOverEdge, merge, setBounds2D, setBounds5D, setC, setPosition, setPosition2D, setPosition5D, setT, setZ, substract, subtract
addListener, attachTo, beginUpdate, canvasToImageDeltaX, canvasToImageDeltaY, canvasToImageLogDeltaX, canvasToImageLogDeltaX, canvasToImageLogDeltaX, canvasToImageLogDeltaX, canvasToImageLogDeltaY, canvasToImageLogDeltaY, canvasToImageLogDeltaY, canvasToImageLogDeltaY, contains, contains, copyFrom, create, create, create, create, createFromXML, delete, delete, detachFrom, detachFromAll, detachFromAll, endUpdate, focusChanged, getAdjustedStroke, getAdjustedStroke, getBooleanMask2D, getBounds5D, getClassName, getColor, getCopy, getDefaultColor, getDefaultOpacity, getDefaultShowName, getDefaultStroke, getDisplayColor, getFirstSequence, getFocusedColor, getGroupId, getIcon, getId, getName, getNameSuffix, getNumberOfContourPoints, getNumberOfPoints, getOpacity, getOverlay, getPainter, getPosition5D, getProperties, getProperty, getPropertyValue, getROICount, getROIList, getROIList, getROIList, getROIsFromXML, getSelectedColor, getSequences, getShowName, getSimpleClassName, getStroke, getVolume, internalFocus, internalSelect, internalUnfocus, internalUnselect, intersects, isAttached, isCreating, isDefaultName, isEditable, isEmpty, isFocused, isReadOnly, isSelected, isUpdating, loadFromXML, loadROIsFromXML, merge, mergeWith, nameChanged, painterChanged, propertyChanged, remove, remove, removeListener, roiChanged, roiChanged, roiChanged, saveROIsToXML, selectionChanged, setColor, setCreating, setDefaultColor, setDefaultOpacity, setDefaultShowName, setDefaultStroke, setEditable, setFocused, setGroupId, setIcon, setMousePos, setName, setOpacity, setProperty, setPropertyValue, setReadOnly, setROIsFromXML, setSelected, setSelected, setSelectedColor, setShowName, setStroke
public static final java.lang.String ID_POINTS
public static final java.lang.String ID_POINT
public static final java.lang.String ID_WINDING
public ROI2DPath(java.awt.geom.Path2D path, java.awt.geom.Area closedArea, java.awt.geom.Path2D openPath)
public ROI2DPath(java.awt.geom.Path2D path)
public ROI2DPath(java.awt.Shape shape)
@Deprecated public ROI2DPath(java.awt.geom.Point2D pt, boolean cm)
public ROI2DPath(java.awt.geom.Point2D position)
public ROI2DPath()
public java.lang.String getDefaultName()
getDefaultName
in class ROI2DShape
public java.awt.geom.Area getClosedArea()
Area
shape formatpublic java.awt.geom.Path2D getOpenPath()
Path2D
shape formatpublic boolean canAddPoint()
ROI2DShape
canAddPoint
in class ROI2DShape
public boolean contains(double x, double y)
ROI2D
ROI
.contains
in interface java.awt.Shape
contains
in class ROI2DShape
x
- the specified X coordinate to be testedy
- the specified Y coordinate to be testedtrue
if the specified coordinates are inside the ROI
boundary;
false
otherwise.public boolean contains(java.awt.geom.Point2D p)
ROI2D
Point2D
is inside the ROI.contains
in interface java.awt.Shape
contains
in class ROI2DShape
p
- the specified Point2D
to be testedtrue
if the specified Point2D
is inside the boundary of the ROI
;
false
otherwise.public boolean contains(double x, double y, double w, double h)
ROI2D
ROI
entirely contains the specified rectangular area. All
coordinates that lie inside the rectangular area must lie within the ROI
for the
entire rectangular area to be considered contained within the ROI
.
The ROI.contains()
method allows a ROI
implementation to conservatively return false
when:
intersect
method returns true
and
ROI
entirely contains the rectangular area are
prohibitively expensive.
ROIs
this method might return false
even though the ROI
contains
the rectangular area.contains
in interface java.awt.Shape
contains
in class ROI2DShape
x
- the X coordinate of the upper-left corner of the specified rectangular areay
- the Y coordinate of the upper-left corner of the specified rectangular areaw
- the width of the specified rectangular areah
- the height of the specified rectangular areatrue
if the interior of the ROI
entirely contains the
specified rectangular area; false
otherwise or, if the ROI
contains the
rectangular area and the intersects
method returns true
and the containment
calculations would be too expensive to perform.public boolean contains(java.awt.geom.Rectangle2D r)
ROI2D
ROI
entirely contains the specified Rectangle2D
. The
ROI.contains()
method allows a implementation to
conservatively return false
when:
intersect
method returns true
and
ROI
entirely contains the
Rectangle2D
are prohibitively expensive.
false
even though the ROI
contains the
Rectangle2D
.contains
in interface java.awt.Shape
contains
in class ROI2DShape
r
- The specified Rectangle2D
true
if the interior of the ROI
entirely contains the Rectangle2D
;
false
otherwise or, if the ROI
contains the Rectangle2D
and the
intersects
method returns true
and the containment calculations would be too
expensive to perform.ROI2D.contains(double, double, double, double)
public boolean contains(ROI roi)
ROI
ROI
entirely contains the specified ROI
.
WARNING: this method may be "pixel accurate" only depending the internal implementation.public ROI add(ROI roi, boolean allowCreate) throws java.lang.UnsupportedOperationException
ROI
ROI
into this ROI
.
The resulting content of this ROI
will include
the union of both ROI's contents.UnsupportedOperationException
is thrown if allowCreate
parameter
is set to false
, if the parameter is set to true
the result may be returned in a new
created ROI.
// Example: roi1 (before) + roi2 = roi1 (after) ################ ################ ################ ############## ############## ################ ############ ############ ################ ########## ########## ################ ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
add
in class ROI
roi
- the ROI
to be added to the current ROI
allowCreate
- if set to true
the method will create a new ROI to return the result of
the operation if it
cannot be directly processed on the current ROI
allowCreate
parameter was set to true
java.lang.UnsupportedOperationException
- if the two ROI cannot be added together.ROI.getUnion(ROI)
public ROI intersect(ROI roi, boolean allowCreate) throws java.lang.UnsupportedOperationException
ROI
ROI
to the intersection of
its current content and the content of the specified ROI
.
The resulting ROI will include only contents that were contained in both ROI.UnsupportedOperationException
is thrown if allowCreate
parameter
is set to false
, if the parameter is set to true
the result may be returned in a new
created ROI.
// Example: roi1 (before) intersect roi2 = roi1 (after) ################ ################ ################ ############## ############## ############ ############ ############ ######## ########## ########## #### ######## ######## ###### ###### #### #### ## ##
intersect
in class ROI
roi
- the ROI
to be intersected to the current ROI
allowCreate
- if set to true
the method will create a new ROI to return the result of
the operation if it
cannot be directly processed on the current ROI
allowCreate
parameter was set to true
java.lang.UnsupportedOperationException
- if the two ROI cannot be intersected together.ROI.getIntersection(ROI)
public ROI exclusiveAdd(ROI roi, boolean allowCreate) throws java.lang.UnsupportedOperationException
ROI
ROI
to be the union of its current content and the
content of the specified ROI
, minus their intersection.
The resulting ROI
will include only content that were contained in either this ROI
or
in the specified ROI
, but not in both.UnsupportedOperationException
is thrown if allowCreate
parameter is set to
false
, if the parameter is set to true
the result may be returned
in a new created ROI.
// Example: roi1 (before) xor roi2 = roi1 (after) ################ ################ ############## ############## ## ## ############ ############ #### #### ########## ########## ###### ###### ######## ######## ################ ###### ###### ###### ###### #### #### #### #### ## ## ## ##
exclusiveAdd
in class ROI
roi
- the ROI
to be exclusively added to the current ROI
allowCreate
- if set to true
the method will create a new ROI to return the result of
the operation if it
cannot be directly processed on the current ROI
allowCreate
parameter was set to true
java.lang.UnsupportedOperationException
- if the two ROI cannot be exclusively added together.ROI.getExclusiveUnion(ROI)
public ROI subtract(ROI roi, boolean allowCreate) throws java.lang.UnsupportedOperationException
ROI
ROI
content from current ROI
.UnsupportedOperationException
is thrown if allowCreate
parameter
is set to false
, if the parameter is set to true
the result may be returned in a new
created ROI.subtract
in class ROI
roi
- the ROI
to subtract from the current ROI
allowCreate
- if set to true
the method will create a new ROI to return the result of
the operation if it
cannot be directly processed on the current ROI
allowCreate
parameter was set to true
java.lang.UnsupportedOperationException
- if we can't subtract the specified ROI
from this ROI
ROI.getSubtraction(ROI)
public java.util.List<PathAnchor2D> getPathAnchors()
public boolean loadFromXML(org.w3c.dom.Node node)
XMLPersistent
loadFromXML
in interface XMLPersistent
loadFromXML
in class ROI2DShape
public boolean saveToXML(org.w3c.dom.Node node)
XMLPersistent
saveToXML
in interface XMLPersistent
saveToXML
in class ROI2D