R
- the type of 2D ROI for each slice of this 3D ROIpublic class ROI3DStack<R extends ROI2D> extends ROI3D implements ROIListener, OverlayListener, java.lang.Iterable<R>
Modifier and Type | Class and Description |
---|---|
class |
ROI3DStack.ROI3DStackPainter |
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, ID_CLASSNAME, ID_COLOR, ID_ID, ID_NAME, ID_OPACITY, ID_READONLY, ID_ROI, ID_SELECTED, ID_SHOWNAME, ID_STROKE, idComparator, nameComparator, PROPERTY_COLOR, PROPERTY_CREATING, PROPERTY_ICON, PROPERTY_NAME, PROPERTY_OPACITY, PROPERTY_READONLY, PROPERTY_SHOWNAME, PROPERTY_STROKE
Constructor and Description |
---|
ROI3DStack(java.lang.Class<R> roiClass)
Creates a new 3D ROI based on the given 2D ROI type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canTranslate()
Returns
true if the ROI support translate operation. |
void |
clear()
Removes all slices.
|
Rectangle3D |
computeBounds3D()
Calculate and returns the 3D bounding box of the
ROI . |
double |
computeNumberOfContourPoints()
Generic implementation for ROI2D using the BooleanMask object so the result is just an
approximation.
|
double |
computeNumberOfPoints()
Compute and returns the number of point (pixel) contained in the ROI.
|
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 sizeX,
double sizeY,
double sizeZ)
Tests if the
ROI entirely contains the specified 3D rectangular area. |
BooleanMask2D |
getBooleanMask2D(int z,
boolean inclusive)
Get the
BooleanMask2D object representing the roi for the specified Z 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.
|
int |
getSizeZ() |
R |
getSlice(int z)
Returns the ROI slice at given Z position.
|
R |
getSlice(int z,
boolean createIfNull)
Returns the ROI slice at given Z position.
|
boolean |
getUseChildColor()
Returns
true if the ROI directly uses the 2D slice color draw property and
false if it uses the global 3D 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 sizeX,
double sizeY,
double sizeZ)
Tests if the interior of the
ROI intersects the interior of a specified
3D 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 z)
Removes slice at the given Z 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 3D ROI.
|
void |
setColor(java.awt.Color value)
Set the ROI painter base color.
|
void |
setColor(int z,
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 z,
R roi2d)
Sets the slice for the given Z position.
|
void |
setStroke(double value)
Set ROI painter stroke.
|
void |
setT(int value)
Sets T position of this 3D ROI.
|
void |
setUseChildColor(boolean value)
Set to
true if you want to directly use the 2D slice color draw property and
false to keep the global 3D ROI color draw property. |
void |
translate(double dx,
double dy,
double dz)
Translate the ROI position by the specified delta X/Y/Z.
|
void |
translate(int z)
Translate the stack of specified Z position.
|
canSetBounds, canSetPosition, computeBounds5D, contains, contains, contains, contains, contains, getBooleanMask, getBooleanMask2D, getBooleanMask2D, getBooleanMask2D, getBooleanMask3D, getBounds, getBounds3D, getC, getDimension, getPosition, getPosition3D, getROI3DList, getROI3DList, getSurfaceArea, getT, getVolume, intersects, intersects, intersects, isActiveFor, isActiveFor, setBounds3D, setBounds5D, setPosition3D, setPosition5D
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, getDisplayColor, getExclusiveUnion, getFirstSequence, getFocusedColor, getIcon, getId, getIntersection, getName, getNumberOfContourPoints, getNumberOfPoints, getOpacity, getOverlay, getPainter, getPerimeter, getPosition5D, getPropertyValue, getROICount, getROIList, getROIList, getROIList, getROIsFromXML, getSelectedColor, getSequences, getShowName, getSimpleClassName, getStroke, getSubtraction, getUnion, internalFocus, internalSelect, internalUnfocus, internalUnselect, intersects, isAttached, isCreating, isEditable, isFocused, isReadOnly, isSelected, isUpdating, loadFromXML, loadROIsFromXML, merge, nameChanged, onChanged, painterChanged, propertyChanged, remove, remove, removeListener, roiChanged, roiChanged, saveROIsToXML, selectionChanged, setEditable, setIcon, setMousePos, setName, setPropertyValue, setROIsFromXML, setSelected, setSelectedColor, setShowName
public static final java.lang.String PROPERTY_USECHILDCOLOR
public ROI3DStack(java.lang.Class<R> roiClass)
public boolean getUseChildColor()
true
if the ROI directly uses the 2D slice color draw property and
false
if it uses the global 3D ROI color draw property.public void setUseChildColor(boolean value)
true
if you want to directly use the 2D slice color draw property and
false
to keep the global 3D ROI color draw property.setColor(int, Color)
public void setColor(int z, 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 setT(int value)
ROI3D
-1
is a special value meaning
the ROI is set on all T frames (infinite T dimension).public void setC(int value)
ROI3D
-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 getSizeZ()
getSlice(int)
may still return null
.public R removeSlice(int z)
public void clear()
public Rectangle3D computeBounds3D()
ROI3D
ROI
.ROI3D.getBounds3D()
which should try to cache the result as the
bounding box calculation can take some computation time for complex ROI.computeBounds3D
in class ROI3D
public boolean contains(double x, double y, double z)
ROI3D
ROI
.public boolean contains(double x, double y, double z, double sizeX, double sizeY, double sizeZ)
ROI3D
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.contains
in class ROI3D
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 intersects(double x, double y, double z, double sizeX, double sizeY, double sizeZ)
ROI3D
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
.intersects
in class ROI3D
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 hasSelectedPoint()
ROI
hasSelectedPoint
in class ROI
public double computeNumberOfContourPoints()
ROI3D
computeNumberOfContourPoints
in class ROI3D
public double computeNumberOfPoints()
ROI
computeNumberOfPoints
in class ROI3D
public boolean canTranslate()
ROI3D
true
if the ROI support translate operation.canTranslate
in class ROI3D
ROI3D.translate(double, double, double)
public void translate(int z)
public void translate(double dx, double dy, double dz)
ROI3D
ROI3D.canTranslate()
first.translate
in class ROI3D
dx
- translation value to apply on X dimensiondy
- translation value to apply on Y dimensiondz
- translation value to apply on Z dimensionROI3D.canTranslate()
,
ROI3D.setPosition3D(Point3D)
public boolean[] getBooleanMask2D(int x, int y, int width, int height, int z, boolean inclusive)
ROI3D
getBooleanMask2D
in class ROI3D
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 BooleanMask2D getBooleanMask2D(int z, boolean inclusive)
ROI3D
BooleanMask2D
object representing the roi for the specified Z position.getBooleanMask2D
in class ROI3D
z
- Z 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 ROI3D
public boolean saveToXML(org.w3c.dom.Node node)
XMLPersistent
saveToXML
in interface XMLPersistent
saveToXML
in class ROI3D