R
- the type of 3D ROI for each slice of this 4D ROIpublic class ROI4DStack<R extends ROI3D> extends ROI4D implements ROIListener, OverlayListener, java.lang.Iterable<R>
Modifier and Type | Class and Description |
---|---|
class |
ROI4DStack.ROI4DStackPainter |
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 |
---|
ROI4DStack(java.lang.Class<R> roiClass)
Creates a new 4D ROI based on the given 3D ROI type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canTranslate()
Returns
true if the ROI support translate operation. |
void |
clear()
Removes all slices.
|
Rectangle4D |
computeBounds4D()
Calculate and returns the 4D 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)
Tests if the specified coordinates are inside the
ROI . |
boolean |
contains(double x,
double y,
double z,
double t,
double sizeX,
double sizeY,
double sizeZ,
double sizeT)
Tests if the
ROI entirely contains the specified 4D rectangular area. |
BooleanMask2D |
getBooleanMask2D(int z,
int t,
boolean inclusive)
Get the
BooleanMask2D object representing the roi for the specified Z,T position. |
boolean[] |
getBooleanMask2D(int x,
int y,
int width,
int height,
int z,
int t,
boolean inclusive)
Get the boolean bitmap mask for the specified rectangular area of the roi and for the
specified Z,T position.
|
java.lang.String |
getDefaultName() |
int |
getSizeT() |
R |
getSlice(int t)
Returns the ROI slice at given T position.
|
R |
getSlice(int t,
boolean createIfNull)
Returns the ROI slice at given T position.
|
boolean |
getUseChildColor()
Returns
true if the ROI directly uses the 3D slice color draw property and false if it
uses the global 4D 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 sizeX,
double sizeY,
double sizeZ,
double sizeT)
Tests if the interior of the
ROI intersects the interior of a specified
4D 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 t)
Removes slice at the given T position and returns it.
|
void |
roiChanged(ROIEvent event) |
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
void |
setC(int value)
Sets C position of this 4D ROI.
|
void |
setColor(java.awt.Color value)
Set the ROI painter base color.
|
void |
setColor(int t,
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 t,
R roi3d)
Sets the slice for the given T position.
|
void |
setStroke(double value)
Set ROI painter stroke.
|
void |
setUseChildColor(boolean value)
Set to
true if you want to directly use the 3D slice color draw property and false to
keep the global 4D ROI color draw property. |
void |
translate(double dx,
double dy,
double dz,
double dt)
Translate the ROI position by the specified delta X/Y/Z/T.
|
void |
translate(int t)
Translate the stack of specified T position.
|
void |
unselectAllPoints()
Remove focus/selected state on all (control) points.
|
canSetBounds, canSetPosition, computeBounds5D, contains, contains, contains, contains, contains, getBooleanMask, getBooleanMask2D, getBooleanMask2D, getBooleanMask2D, getBooleanMask3D, getBooleanMask3D, getBooleanMask4D, getBounds, getBounds4D, getC, getDimension, getPosition, getPosition4D, getROI4DList, getROI4DList, intersects, intersects, intersects, isActiveFor, isActiveFor, setBounds4D, setBounds5D, setPosition4D, 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 ROI4DStack(java.lang.Class<R> roiClass)
public java.lang.String getDefaultName()
getDefaultName
in class ROI4D
public boolean getUseChildColor()
true
if the ROI directly uses the 3D slice color draw property and false
if it
uses the global 4D ROI color draw property.public void setUseChildColor(boolean value)
true
if you want to directly use the 3D slice color draw property and false
to
keep the global 4D ROI color draw property.setColor(int, Color)
public void setColor(int t, 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 void setC(int value)
ROI4D
-1
is a special value meaning
the ROI is set on all C channels (infinite C dimension).public boolean isEmpty()
true
if the ROI stack is empty.public int getSizeT()
getSlice(int)
may still
return null
.public R removeSlice(int t)
public void clear()
public Rectangle4D computeBounds4D()
ROI4D
ROI
.ROI4D.getBounds4D()
which should try to cache the result as the
bounding box calculation can take some computation time for complex ROI.computeBounds4D
in class ROI4D
public boolean contains(double x, double y, double z, double t)
ROI4D
ROI
.contains
in class ROI4D
x
- the specified X coordinate to be testedy
- the specified Y coordinate to be testedz
- the specified Z coordinate to be testedt
- the specified T coordinate to be testedtrue
if the specified 4D coordinates are inside the ROI
boundary;
false
otherwise.public boolean contains(double x, double y, double z, double t, double sizeX, double sizeY, double sizeZ, double sizeT)
ROI4D
ROI
entirely contains the specified 4D 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 ROI4D
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 areat
- the T 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 areasizeT
- size for T dimension of the specified rectangular areatrue
if the interior of the ROI
entirely contains the
specified 4D rectangular area; false
otherwise or, if the ROI
contains the 4D
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 sizeX, double sizeY, double sizeZ, double sizeT)
ROI4D
ROI
intersects the interior of a specified
4D rectangular area. The 4D 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 4D rectangular area
does not intersect the ROI
.intersects
in class ROI4D
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 areat
- the T 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 areasizeT
- size for T 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 hasSelectedPoint()
ROI
hasSelectedPoint
in class ROI
public void unselectAllPoints()
ROI
unselectAllPoints
in class ROI
public double computeNumberOfContourPoints()
ROI
computeNumberOfContourPoints
in class ROI4D
public double computeNumberOfPoints()
ROI
computeNumberOfPoints
in class ROI4D
public boolean canTranslate()
ROI4D
true
if the ROI support translate operation.canTranslate
in class ROI4D
ROI4D.translate(double, double, double, double)
public void translate(int t)
public void translate(double dx, double dy, double dz, double dt)
ROI4D
ROI4D.canTranslate()
first.translate
in class ROI4D
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 dimensionROI4D.canTranslate()
,
ROI4D.setPosition4D(Point4D)
public boolean[] getBooleanMask2D(int x, int y, int width, int height, int z, int t, boolean inclusive)
ROI4D
getBooleanMask2D
in class ROI4D
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 maskt
- T 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, boolean inclusive)
ROI4D
BooleanMask2D
object representing the roi for the specified Z,T position.getBooleanMask2D
in class ROI4D
z
- Z position we want to retrieve the boolean maskt
- T position we want to retrieve the boolean maskinclusive
- 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 ROI4D
public boolean saveToXML(org.w3c.dom.Node node)
XMLPersistent
saveToXML
in interface XMLPersistent
saveToXML
in class ROI4D