public abstract class ROI3D extends ROI
Modifier and Type | Class and Description |
---|---|
class |
ROI3D.ROI3DPainter |
ROI.ROIGroupId, ROI.ROIIdComparator, ROI.ROINameComparator, ROI.ROIPainter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID_C |
static java.lang.String |
ID_T |
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 |
---|
ROI3D() |
Modifier and Type | Method and Description |
---|---|
boolean |
canSetBounds()
Returns
true if this ROI accepts bounds change through the ROI.setBounds5D(Rectangle5D) method. |
boolean |
canSetPosition()
Returns
true if this ROI accepts position change through the ROI.setPosition5D(Point5D) method. |
boolean |
canTranslate()
Returns
true if the ROI support translate operation. |
abstract Rectangle3D |
computeBounds3D()
Calculate and returns the 3D bounding box of the
ROI . |
Rectangle5D |
computeBounds5D()
Calculate and returns the bounding box of the
ROI . |
double |
computeNumberOfContourPoints()
Compute and returns the number of point (pixel) composing the ROI contour.
|
double |
computeNumberOfPoints()
Compute and returns the number of point (pixel) contained in the ROI.
|
double |
computeSurfaceArea(Sequence sequence)
Compute the surface area in um2 given the pixel size informations from the specified Sequence.
|
abstract boolean |
contains(double x,
double y,
double z)
Tests if the specified coordinates are inside the
ROI . |
boolean |
contains(double x,
double y,
double z,
double t,
double c)
Tests if a specified 5D point is inside the ROI.
|
abstract boolean |
contains(double x,
double y,
double z,
double sizeX,
double sizeY,
double sizeZ)
Tests if the
ROI entirely contains the specified 3D rectangular area. |
boolean |
contains(double x,
double y,
double z,
double t,
double c,
double sizeX,
double sizeY,
double sizeZ,
double sizeT,
double sizeC)
Tests if the
ROI entirely contains the specified 5D rectangular area. |
boolean |
contains(Point3D p)
Tests if a specified
Point3D is inside the ROI. |
boolean |
contains(Rectangle3D r)
Tests if the interior of the
ROI entirely contains the specified Rectangle3D . |
boolean |
contains(ROI roi)
Tests if the
ROI entirely contains the specified ROI . |
BooleanMask3D |
getBooleanMask(boolean inclusive)
Get the
BooleanMask3D object representing the roi. |
BooleanMask2D |
getBooleanMask2D(int z,
boolean inclusive)
Get the
BooleanMask2D object representing the roi for the specified Z position. |
BooleanMask2D |
getBooleanMask2D(int z,
int t,
int c,
boolean inclusive)
Returns the
BooleanMask2D object representing the XY plan content at specified Z, T,
C position. |
boolean[] |
getBooleanMask2D(int x,
int y,
int width,
int height,
int z,
boolean inclusive)
Get the boolean bitmap mask for the specified rectangular area of the roi and for the
specified Z position.
|
boolean[] |
getBooleanMask2D(int x,
int y,
int width,
int height,
int z,
int t,
int c,
boolean inclusive)
Returns the boolean array mask for the specified rectangular region at specified C, Z, T
position.
|
boolean[] |
getBooleanMask2D(java.awt.Rectangle rect,
int z,
boolean inclusive)
Get the boolean bitmap mask for the specified rectangular area of the roi and for the
specified Z position.
|
BooleanMask3D |
getBooleanMask3D(int z,
int t,
int c,
boolean inclusive)
Returns the
BooleanMask3D object representing the XYZ volume content at specified Z,
T, C position. |
Rectangle3D.Integer |
getBounds()
Returns an integer
Rectangle3D that completely encloses the ROI . |
Rectangle3D |
getBounds3D()
Returns the bounding box of the
ROI . |
int |
getC()
Returns the C position.
|
java.lang.String |
getDefaultName() |
int |
getDimension()
Returns the number of dimension of the ROI:
2 for ROI2D 3 for ROI3D 4 for ROI4D 5 for ROI5D |
double |
getLength(Sequence sequence)
Computes and returns the length/perimeter of the ROI in um given the pixel size informations from the specified
Sequence.
|
Point3D.Integer |
getPosition()
Returns the integer ROI position which normally correspond to the minimum point of the
ROI bounds.
|
Point3D |
getPosition3D()
Returns the high precision ROI position which normally correspond to the minimum point
of the ROI bounds.
|
static java.util.ArrayList<ROI3D> |
getROI3DList(java.util.ArrayList<ROI> rois)
Deprecated.
Use
getROI3DList(List) instead. |
static java.util.List<ROI3D> |
getROI3DList(java.util.List<ROI> rois)
Return all 3D ROI from the ROI list
|
double |
getSurfaceArea()
Deprecated.
Use
ROI.getNumberOfContourPoints() instead. |
double |
getSurfaceArea(Sequence sequence)
Returns surface area of the 3D ROI in um2 given the pixel size informations from the specified Sequence.
|
int |
getT()
Returns the T position.
|
double |
getVolume()
Deprecated.
Use
ROI.getNumberOfPoints() instead. |
abstract boolean |
intersects(double x,
double y,
double z,
double sizeX,
double sizeY,
double sizeZ)
Tests if the interior of the
ROI intersects the interior of a specified
3D rectangular area. |
boolean |
intersects(double x,
double y,
double z,
double t,
double c,
double sizeX,
double sizeY,
double sizeZ,
double sizeT,
double sizeC)
Tests if the interior of the
ROI intersects the interior of a specified
rectangular area. |
boolean |
intersects(Rectangle3D r)
Tests if the interior of the
ROI intersects the interior of a specified Rectangle3D . |
boolean |
intersects(ROI roi)
Tests if the current
ROI intersects the specified ROI . |
boolean |
isActiveFor(IcyCanvas canvas)
Return true if the ROI is active for the specified canvas.
|
boolean |
isActiveFor(int t,
int c)
Return true if the ROI is active for the specified T, C coordinates
|
boolean |
isOverEdge(IcyCanvas canvas,
double x,
double y,
double z)
Returns true if specified point coordinates overlap the ROI edge.
|
boolean |
isOverEdge(IcyCanvas canvas,
double x,
double y,
double z,
double t,
double c)
Returns true if specified point coordinates overlap the ROI edge.
|
boolean |
isOverEdge(IcyCanvas canvas,
Point3D p)
Returns true if specified point coordinates overlap the ROI edge.
|
boolean |
isOverEdge(IcyCanvas canvas,
Point5D p)
Returns true if specified point coordinates overlap the ROI edge.
|
boolean |
loadFromXML(org.w3c.dom.Node node)
LOAD
|
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
void |
setBounds3D(Rectangle3D bounds)
Set the
ROI 3D bounds. |
void |
setBounds5D(Rectangle5D bounds)
Set the
ROI bounds. |
void |
setC(int value)
Sets C position of this 3D ROI.
|
void |
setPosition3D(Point3D position)
Set the
ROI 3D position. |
void |
setPosition5D(Point5D position)
Set the
ROI position. |
void |
setT(int value)
Sets T position of this 3D ROI.
|
void |
translate(double dx,
double dy,
double dz)
Translate the ROI position by the specified delta X/Y/Z.
|
add, 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, exclusiveAdd, focusChanged, getAdjustedStroke, getAdjustedStroke, getBooleanMask2D, getBounds5D, getClassName, getColor, getCopy, getDefaultColor, getDefaultOpacity, getDefaultShowName, getDefaultStroke, getDisplayColor, getExclusiveUnion, getFirstSequence, getFocusedColor, getGroupId, getIcon, getId, getIntersection, getName, getNameSuffix, getNumberOfContourPoints, getNumberOfPoints, getOpacity, getOverlay, getPainter, getPerimeter, getPosition5D, getProperties, getProperty, getPropertyValue, getROICount, getROIList, getROIList, getROIList, getROIsFromXML, getSelectedColor, getSequences, getShowName, getSimpleClassName, getStroke, getSubROI, getSubtraction, getUnion, hasSelectedPoint, internalFocus, internalSelect, internalUnfocus, internalUnselect, intersect, intersects, isAttached, isCreating, isDefaultName, isEditable, isEmpty, isFocused, isReadOnly, isSelected, isUpdating, loadFromXML, loadROIsFromXML, merge, mergeWith, nameChanged, onChanged, 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, subtract, unselectAllPoints
public static final java.lang.String ID_T
public static final java.lang.String ID_C
public ROI3D()
@Deprecated public static java.util.ArrayList<ROI3D> getROI3DList(java.util.ArrayList<ROI> rois)
getROI3DList(List)
instead.public static java.util.List<ROI3D> getROI3DList(java.util.List<ROI> rois)
public java.lang.String getDefaultName()
getDefaultName
in class ROI
public final int getDimension()
ROI
getDimension
in class ROI
public boolean contains(Point3D p)
Point3D
is inside the ROI.p
- the specified Point3D
to be testedtrue
if the specified Point3D
is inside the boundary of the ROI
;
false
otherwise.public boolean contains(Rectangle3D r)
ROI
entirely contains the specified Rectangle3D
. The
ROI.contains()
method allows a implementation to
conservatively return false
when:
intersect
method returns true
and
ROI
entirely contains the
Rectangle3D
are prohibitively expensive.
false
even though the ROI
contains the
Rectangle3D
.r
- The specified Rectangle3D
true
if the interior of the ROI
entirely contains the Rectangle3D
;
false
otherwise or, if the ROI
contains the Rectangle3D
and the
intersects
method returns true
and the containment calculations would be too
expensive to perform.contains(double, double, double, double, double, double)
public abstract boolean contains(double x, double y, double z)
ROI
.x
- the specified X coordinate to be testedy
- the specified Y coordinate to be testedz
- the specified Z coordinate to be testedtrue
if the specified 3D coordinates are inside the ROI
boundary;
false
otherwise.public abstract boolean contains(double x, double y, double z, double sizeX, double sizeY, double sizeZ)
ROI
entirely contains the specified 3D 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.x
- the X coordinate of the minimum corner position of the specified rectangular areay
- the Y coordinate of the minimum corner position of the specified rectangular areaz
- the Z coordinate of the minimum corner position of the specified rectangular areasizeX
- size for X dimension of the specified rectangular areasizeY
- size for Y dimension of the specified rectangular areasizeZ
- size for Z dimension of the specified rectangular areatrue
if the interior of the ROI
entirely contains the
specified 3D rectangular area; false
otherwise or, if the ROI
contains the 3D
rectangular area and the intersects
method returns true
and the containment
calculations would be too
expensive to perform.public boolean contains(double x, double y, double z, double t, double c)
ROI
public boolean contains(double x, double y, double z, double t, double c, double sizeX, double sizeY, double sizeZ, double sizeT, double sizeC)
ROI
ROI
entirely contains the specified 5D 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 class ROI
x
- the X coordinate of the start corner of the specified rectangular areay
- the Y coordinate of the start corner of the specified rectangular areaz
- the Z coordinate of the start corner of the specified rectangular areat
- the T coordinate of the start corner of the specified rectangular areac
- the C coordinate of the start corner of the specified rectangular areasizeX
- the X size of the specified rectangular areasizeY
- the Y size of the specified rectangular areasizeZ
- the Z size of the specified rectangular areasizeT
- the T size of the specified rectangular areasizeC
- the C size 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(ROI roi)
ROI
ROI
entirely contains the specified ROI
.
WARNING: this method may be "pixel accurate" only depending the internal implementation.public boolean intersects(Rectangle3D r)
ROI
intersects the interior of a specified Rectangle3D
.
The ROI.intersects()
method allows a ROI
implementation to conservatively return true
when:
Rectangle3D
and the ROI
intersect, but
ROIs
this method might return true
even though the Rectangle3D
does not intersect the ROI
.r
- the specified Rectangle3D
true
if the interior of the ROI
and the interior of the
specified Rectangle3D
intersect, or are both highly likely to intersect
and intersection calculations would be too expensive to perform; false
otherwise.intersects(double, double, double,double, double, double)
public abstract boolean intersects(double x, double y, double z, double sizeX, double sizeY, double sizeZ)
ROI
intersects the interior of a specified
3D rectangular area. The 3D rectangular area is considered to intersect the ROI
if any point is
contained in both the interior of the ROI
and the specified
rectangular area.
The ROI.intersects()
method allows a ROI
implementation to conservatively return true
when:
ROI
intersect, but
ROIs
this method might return true
even though the 3D rectangular area
does not intersect the ROI
.x
- the X coordinate of the minimum corner position of the specified rectangular areay
- the Y coordinate of the minimum corner position of the specified rectangular areaz
- the Z coordinate of the minimum corner position of the specified rectangular areasizeX
- size for X dimension of the specified rectangular areasizeY
- size for Y dimension of the specified rectangular areasizeZ
- size for Z dimension of the specified rectangular areatrue
if the interior of the ROI
and the interior of the
rectangular area intersect, or are both highly likely to intersect and intersection
calculations would be too expensive to perform; false
otherwise.public boolean intersects(double x, double y, double z, double t, double c, double sizeX, double sizeY, double sizeZ, double sizeT, double sizeC)
ROI
ROI
intersects the interior of a specified
rectangular area. The rectangular area is considered to intersect the ROI
if any
point is contained in both the interior of the ROI
and the specified rectangular
area.
The ROI.intersects()
method allows a ROI
implementation to conservatively return true
when:
ROI
intersect, but
ROIs
this method might return true
even though the rectangular area does
not intersect the ROI
.intersects
in class ROI
true
if the interior of the ROI
and the interior of the
rectangular area intersect, or are both highly likely to intersect and intersection
calculations would be too expensive to perform; false
otherwise.public boolean intersects(ROI roi)
ROI
ROI
intersects the specified ROI
.intersects
in class ROI
true
if ROI
intersect, false
otherwise.public abstract Rectangle3D computeBounds3D()
ROI
.getBounds3D()
which should try to cache the result as the
bounding box calculation can take some computation time for complex ROI.public Rectangle5D computeBounds5D()
ROI
ROI
.ROI.getBounds5D()
which should try to cache the result as the
bounding box calculation can take some computation time for complex ROI.computeBounds5D
in class ROI
public Rectangle3D.Integer getBounds()
Rectangle3D
that completely encloses the ROI
. Note
that there is no guarantee that the returned Rectangle3D
is the smallest
bounding box that encloses the ROI
, only that the ROI
lies entirely
within the indicated Rectangle3D
. The returned Rectangle3D
might
also fail to completely enclose the ROI
if the ROI
overflows the
limited range of the integer data type. The getBounds3D
method generally returns
a tighter bounding box due to its greater flexibility in representation.Rectangle3D
that completely encloses the ROI
.public Rectangle3D getBounds3D()
ROI
. Note that there is no guarantee that the
returned Rectangle3D
is the smallest bounding box that encloses the ROI
,
only that the ROI
lies entirely within the indicated Rectangle3D
.Rectangle3D
that is a bounding box of the ROI
.public Point3D.Integer getPosition()
getBounds()
public Point3D getPosition3D()
getBounds3D()
public boolean canSetBounds()
ROI
true
if this ROI accepts bounds change through the ROI.setBounds5D(Rectangle5D)
method.canSetBounds
in class ROI
public void setBounds3D(Rectangle3D bounds)
ROI
3D bounds.canSetBounds()
first to test if
the operation is supported.bounds
- new ROI 3D boundspublic void setBounds5D(Rectangle5D bounds)
ROI
ROI
bounds.ROI.canSetBounds()
first to test if
the operation is supported.setBounds5D
in class ROI
bounds
- new ROI boundspublic boolean canSetPosition()
ROI
true
if this ROI accepts position change through the ROI.setPosition5D(Point5D)
method.canSetPosition
in class ROI
public void setPosition3D(Point3D position)
ROI
3D position.canSetPosition()
first to test
if the operation is supported.position
- new ROI 3D positionpublic void setPosition5D(Point5D position)
ROI
ROI
position.ROI.canSetPosition()
first to test
if the operation is supported.setPosition5D
in class ROI
position
- new ROI positionpublic boolean canTranslate()
true
if the ROI support translate operation.translate(double, double, double)
public void translate(double dx, double dy, double dz)
canTranslate()
first.dx
- translation value to apply on X dimensiondy
- translation value to apply on Y dimensiondz
- translation value to apply on Z dimensioncanTranslate()
,
setPosition3D(Point3D)
public boolean[] getBooleanMask2D(int x, int y, int width, int height, int z, int t, int c, boolean inclusive)
ROI
  result[((y1 - y) * width) + (x1 - x)] = true
  result[((y1 - y) * width) + (x1 - x)] = false
getBooleanMask2D
in class ROI
x
- the X coordinate of the upper-left corner of the specified rectangular regiony
- the Y coordinate of the upper-left corner of the specified rectangular regionwidth
- the width of the specified rectangular regionheight
- the height of the specified rectangular regionz
- Z position we want to retrieve the boolean maskt
- T position we want to retrieve the boolean maskc
- C position we want to retrieve the boolean maskinclusive
- If true then all partially contained (intersected) pixels are included in the mask.public boolean[] getBooleanMask2D(int x, int y, int width, int height, int z, boolean inclusive)
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 areawidth
- the width of the specified rectangular areaheight
- the height of the specified rectangular areaz
- Z position we want to retrieve the boolean maskinclusive
- If true then all partially contained (intersected) pixels are included in the mask.public boolean[] getBooleanMask2D(java.awt.Rectangle rect, int z, boolean inclusive)
rect
- 2D rectangular area we want to retrieve the boolean maskz
- Z position we want to retrieve the boolean maskinclusive
- If true then all partially contained (intersected) pixels are included in the mask.public BooleanMask2D getBooleanMask2D(int z, int t, int c, boolean inclusive)
ROI
BooleanMask2D
object representing the XY plan content at specified Z, T,
C position.  mask[(y - bounds.y) * bounds.width) + (x - bounds.x)] = true
  mask[(y - bounds.y) * bounds.width) + (x - bounds.x)] = false
getBooleanMask2D
in class ROI
z
- Z position we want to retrieve the boolean mask.t
- T position we want to retrieve the boolean mask.c
- C position we want to retrieve the boolean mask.inclusive
- If true then all partially contained (intersected) pixels are included in the mask.public BooleanMask2D getBooleanMask2D(int z, boolean inclusive)
BooleanMask2D
object representing the roi for the specified Z position.z
- Z position we want to retrieve the boolean maskinclusive
- If true then all partially contained (intersected) pixels are included in the mask.public BooleanMask3D getBooleanMask3D(int z, int t, int c, boolean inclusive)
BooleanMask3D
object representing the XYZ volume content at specified Z,
T, C position.z
- Z position we want to retrieve the boolean mask or -1 to retrieve the whole Z
dimensiont
- T position we want to retrieve the boolean mask.c
- C position we want to retrieve the boolean mask.inclusive
- If true then all partially contained (intersected) pixels are included in the mask.public BooleanMask3D getBooleanMask(boolean inclusive)
BooleanMask3D
object representing the roi.inclusive
- If true then all partially contained (intersected) pixels are included in the mask.public double computeNumberOfContourPoints()
ROI
computeNumberOfContourPoints
in class ROI
public double computeNumberOfPoints()
ROI
computeNumberOfPoints
in class ROI
public double computeSurfaceArea(Sequence sequence)
public double getSurfaceArea(Sequence sequence)
public double getLength(Sequence sequence) throws java.lang.UnsupportedOperationException
ROI
getLength
in class ROI
java.lang.UnsupportedOperationException
ROI.getNumberOfContourPoints()
@Deprecated public double getSurfaceArea()
ROI.getNumberOfContourPoints()
instead.@Deprecated public double getVolume()
ROI.getNumberOfPoints()
instead.getVolume
in class ROI
ROI.getNumberOfPoints()
,
computeNumberOfPoints()
public int getT()
-1
is a special value meaning the ROI is set on all T frames (infinite T
dimension).public void setT(int value)
-1
is a special value meaning
the ROI is set on all T frames (infinite T dimension).public int getC()
-1
is a special value meaning the ROI is set on all C channels (infinite C
dimension).public void setC(int value)
-1
is a special value meaning
the ROI is set on all C channels (infinite C dimension).public boolean isActiveFor(IcyCanvas canvas)
ROI
isActiveFor
in class ROI
public boolean isActiveFor(int t, int c)
public boolean isOverEdge(IcyCanvas canvas, Point3D p)
contains(Point3D)
to test for content overlap instead.public boolean isOverEdge(IcyCanvas canvas, double x, double y, double z)
contains(double, double, double)
to test for content overlap instead.
We provide a default implementation to not break compatibility.public boolean isOverEdge(IcyCanvas canvas, Point5D p)
ROI.contains(Point5D)
to test for content overlap instead.public boolean isOverEdge(IcyCanvas canvas, double x, double y, double z, double t, double c)
contains(double, double, double, double, double)
to test for content overlap
instead.public boolean loadFromXML(org.w3c.dom.Node node)
XMLPersistent
loadFromXML
in interface XMLPersistent
loadFromXML
in class ROI
public boolean saveToXML(org.w3c.dom.Node node)
XMLPersistent
saveToXML
in interface XMLPersistent
saveToXML
in class ROI