R
- the type of 4D ROI for each slice of this 5D ROIpublic class ROI5DStack<R extends ROI4D> extends ROI5D implements ROIListener, OverlayListener, java.lang.Iterable<R>
Modifier and Type | Class and Description |
---|---|
class |
ROI5DStack.ROI5DStackPainter |
ROI.ROIGroupId, ROI.ROIIdComparator, ROI.ROINameComparator, ROI.ROIPainter
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_USECHILDCOLOR |
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 |
---|
ROI5DStack(java.lang.Class<R> roiClass)
Creates a new 5D ROI based on the given 4D ROI type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canTranslate()
Returns
true if the ROI support translate operation. |
void |
clear()
Removes all slices.
|
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.
|
boolean |
contains(double x,
double y,
double z,
double t,
double c)
Tests if a specified 5D point is inside the ROI.
|
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. |
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,
int t,
int c,
boolean inclusive)
Returns the boolean array mask for the specified rectangular region at specified C, Z, T
position.
|
java.lang.String |
getDefaultName() |
int |
getSizeC() |
R |
getSlice(int c)
Returns the ROI slice at given C position.
|
R |
getSlice(int c,
boolean createIfNull)
Returns the ROI slice at given C position.
|
boolean |
getUseChildColor()
Returns
true if the ROI directly uses the 4D slice color draw property and false if it
uses the global 5D ROI color draw property. |
boolean |
hasSelectedPoint()
Returns true if the ROI has a (control) point which is currently focused/selected
|
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 |
isEmpty()
Returns
true if the ROI stack is empty. |
java.util.Iterator<R> |
iterator() |
boolean |
loadFromXML(org.w3c.dom.Node node)
LOAD
|
void |
overlayChanged(OverlayEvent event) |
R |
removeSlice(int c)
Removes slice at the given C position and returns it.
|
void |
roiChanged(ROIEvent event) |
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
void |
setColor(java.awt.Color value)
Set the ROI painter base color.
|
void |
setColor(int c,
java.awt.Color value)
Set the painter color for the specified ROI slice.
|
void |
setCreating(boolean value)
Set the internal creation mode state.
|
void |
setFocused(boolean value) |
void |
setOpacity(float value)
Sets the ROI painter content opacity factor (0 = transparent while 1 means opaque).
|
void |
setReadOnly(boolean value)
Set the read only state of ROI.
|
void |
setSelected(boolean value)
Set the selected state of this ROI.
|
void |
setSlice(int c,
R roi4d)
Sets the slice for the given C position.
|
void |
setStroke(double value)
Set ROI painter stroke.
|
void |
setUseChildColor(boolean value)
Set to
true if you want to directly use the 4D slice color draw property and false to
keep the global 5D ROI color draw property. |
void |
translate(double dx,
double dy,
double dz,
double dt,
double dc)
Translate the ROI position by the specified delta X/Y/Z/T.
|
void |
translate(int c)
Translate the stack of specified C position.
|
void |
unselectAllPoints()
Remove focus/selected state on all (control) points.
|
canSetBounds, canSetPosition, contains, getBooleanMask, getBooleanMask3D, getBooleanMask3D, getBooleanMask4D, getBooleanMask4D, getBooleanMask5D, getBounds, getDimension, getPosition, getROI5DList, getROI5DList, intersects, isActiveFor, setBounds5D, setPosition5D
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, getLength, 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, getVolume, internalFocus, internalSelect, internalUnfocus, internalUnselect, intersect, intersects, isAttached, isCreating, isDefaultName, isEditable, isFocused, isReadOnly, isSelected, isUpdating, loadFromXML, loadROIsFromXML, merge, mergeWith, nameChanged, onChanged, painterChanged, propertyChanged, remove, remove, removeListener, roiChanged, roiChanged, roiChanged, saveROIsToXML, selectionChanged, setDefaultColor, setDefaultOpacity, setDefaultShowName, setDefaultStroke, setEditable, setGroupId, setIcon, setMousePos, setName, setProperty, setPropertyValue, setROIsFromXML, setSelected, setSelectedColor, setShowName, subtract
public static final java.lang.String PROPERTY_USECHILDCOLOR
public ROI5DStack(java.lang.Class<R> roiClass)
public java.lang.String getDefaultName()
getDefaultName
in class ROI5D
public boolean getUseChildColor()
true
if the ROI directly uses the 4D slice color draw property and false
if it
uses the global 5D ROI color draw property.public void setUseChildColor(boolean value)
true
if you want to directly use the 4D slice color draw property and false
to
keep the global 5D ROI color draw property.setColor(int, Color)
public void setColor(int c, java.awt.Color value)
setUseChildColor(boolean)
public void setColor(java.awt.Color value)
ROI
public void setOpacity(float value)
ROI
setOpacity
in class ROI
public void setStroke(double value)
ROI
public void setCreating(boolean value)
ROI
setCreating
in class ROI
public void setReadOnly(boolean value)
ROI
setReadOnly
in class ROI
public void setFocused(boolean value)
setFocused
in class ROI
value
- the focused to setpublic void setSelected(boolean value)
ROI
Sequence.setSelectedROI(ROI)
for exclusive ROI selection.setSelected
in class ROI
value
- the selected to setpublic boolean isEmpty()
true
if the ROI stack is empty.public int getSizeC()
getSlice(int)
may still
return null
.public R removeSlice(int c)
public void clear()
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 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 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 hasSelectedPoint()
ROI
hasSelectedPoint
in class ROI
public void unselectAllPoints()
ROI
unselectAllPoints
in class ROI
public double computeNumberOfContourPoints()
ROI
computeNumberOfContourPoints
in class ROI5D
public double computeNumberOfPoints()
ROI
computeNumberOfPoints
in class ROI5D
public boolean canTranslate()
ROI5D
true
if the ROI support translate operation.canTranslate
in class ROI5D
ROI5D.translate(double, double, double, double, double)
public void translate(int c)
public void translate(double dx, double dy, double dz, double dt, double dc)
ROI5D
ROI5D.canTranslate()
first.translate
in class ROI5D
dx
- translation value to apply on X dimensiondy
- translation value to apply on Y dimensiondz
- translation value to apply on Z dimensiondt
- translation value to apply on T dimensiondc
- translation value to apply on C dimensionROI5D.canTranslate()
,
ROI5D.setPosition5D(Point5D)
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 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 ROI5D
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 void roiChanged(ROIEvent event)
roiChanged
in interface ROIListener
public void overlayChanged(OverlayEvent event)
overlayChanged
in interface OverlayListener
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