public class SegmentedShapeRoi extends ShapeRoi
Shapes among one chain have the same id. Chain id is set when following shape overlap current one
TrackOutline
,
BinarySegmentation
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected int |
frame
Frame number where this outline was found.
|
protected int |
id
The id of the shape.
|
static int |
NOT_COUNTED
The Constant NOT_COUNTED.
|
protected boolean |
runningAverageSmooth
true for using running average for smoothing.
|
protected boolean |
splineSmooth
true for using spline smoothing during interpolation.
|
protected double |
step
Step during conversion outline to points.
|
ANGLE, asp_bk, aspect, cachedMask, center, clipboard, clipHeight, clipWidth, clipX, clipY, COMPOSITE, constrain, CONSTRUCTING, defaultFillColor, FERET_ARRAY_POINTOFFSET, FERET_ARRAYSIZE, fillColor, flattenScale, FREELINE, FREEROI, HANDLE_SIZE, handleColor, ic, ignoreClipRect, imp, instanceColor, LINE, lineWidth, mag, MOVING, MOVING_HANDLE, nonScalable, NORMAL, NOT_PASTING, oldHeight, oldWidth, oldX, oldY, onePixelWide, OVAL, overlay, pasteMode, POINT, POLYGON, POLYLINE, previousRoi, RECTANGLE, RESIZING, ROIColor, stroke, strokeColor, TRACED_ROI, type, updateFullWindow, wideLine, xMax, yMax
Constructor and Description |
---|
SegmentedShapeRoi(float[] shapeArray)
Construct object from array.
|
SegmentedShapeRoi(int x,
int y,
Shape s)
Constructs a ShapeRoi from a Shape.
|
SegmentedShapeRoi(Roi r)
Construct object from ij.gui.Roi.
|
SegmentedShapeRoi(Shape s)
Construct object from java.awt.Shape.
|
Modifier and Type | Method and Description |
---|---|
int |
getFrame()
Get Roi frame.
|
int |
getId()
Get id.
|
List<Point2d> |
getOutlineasPoints()
Convert this ROI to list of points using smoothing and step.
|
List<Point2d> |
getOutlineasRawPoints()
Convert this ROI to list of points without any interpolation.
|
void |
setFrame(int frame)
Set Roi frame.
|
void |
setId(int id)
Set Roi id.
|
void |
setInterpolationParameters(double step,
boolean splineSmooth)
Allow to set non-standard parameters used during conversion from outline (ROI) to list of
points.
|
void |
setInterpolationParameters(double step,
boolean splineSmooth,
boolean runningAverageSmooth)
Allow to set non-standard parameters used during conversion from outline (ROI) to list of
points.
|
and, clone, contains, containsPoint, draw, drawPixels, drawRoiBrush, getFloatConvexHull, getFloatPolygon, getFloatPolygon, getFloatPolygon, getFloatPolygon, getLength, getMask, getPolygon, getRois, getSelectionCoordinates, getShape, getShapeAsArray, isHandle, not, or, shapeToRoi, size, trySimplify, xor
abortModification, abortPaste, addRoiListener, clipRectMargin, copyAttributes, drawOverlay, drawPixels, enableSubPixelResolution, endPaste, equals, getAngle, getAngle, getBoundingRect, getBounds, getColor, getContainedFloatPoints, getContainedPoints, getContourCentroid, getConvexHull, getCornerDiameter, getCPosition, getCurrentPasteMode, getDebugInfo, getDefaultFillColor, getDrawOffset, getFeretsDiameter, getFeretValues, getFillColor, getFloatAngle, getFloatBounds, getFloatHeight, getFloatWidth, getHashCode, getImage, getImageID, getInterpolatedPolygon, getInterpolatedPolygon, getInterpolatedPolygon, getInverse, getMagnification, getName, getPasteMode, getPosition, getProperties, getProperty, getPropertyCount, getPrototypeOverlay, getRotationCenter, getRoundRectArcSize, getScaledStroke, getState, getStatistics, getStroke, getStrokeColor, getStrokeWidth, getTPosition, getType, getTypeAsString, getXBase, getYBase, getZPosition, grow, handleMouseDown, handleMouseDrag, handleMouseUp, hasHyperStackPosition, isActiveOverlayRoi, isArea, isCursor, isDrawingTool, isInteger, isLine, isVisible, iterator, lineCircleIntersection, mouseDownInHandle, mouseDragged, mouseMoved, mouseReleased, moveHandle, notifyListeners, nudge, nudgeCorner, removeRoiListener, screenX, screenXD, screenY, screenYD, setColor, setCornerDiameter, setDefaultFillColor, setDrawOffset, setFillColor, setFlattenScale, setIgnoreClipRect, setImage, setInstanceColor, setIsCursor, setLineWidth, setLocation, setLocation, setName, setNonScalable, setPasteMode, setPosition, setPosition, setPosition, setProperties, setProperty, setPrototypeOverlay, setRotationCenter, setRoundRectArcSize, setStroke, setStrokeColor, setStrokeWidth, setStrokeWidth, showStatus, startPaste, subPixelResolution, temporarilyHide, toFloat, toInt, toInt, toIntR, toString, update, updateClipRect, updateWideLine
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final int NOT_COUNTED
Code for not counted yet shape.
protected int id
positive if has any id assigned (thus it has been counted already)
protected int frame
protected double step
protected boolean splineSmooth
protected boolean runningAverageSmooth
splineSmooth
public SegmentedShapeRoi(Roi r)
r
- Roipublic SegmentedShapeRoi(Shape s)
s
- Shapepublic SegmentedShapeRoi(float[] shapeArray)
shapeArray
- shapeArrayShapeRoi.ShapeRoi(float[])
public SegmentedShapeRoi(int x, int y, Shape s)
x
- xy
- ys
- sShapeRoi.ShapeRoi(int x, int y, Shape s)
public int getId()
public void setId(int id)
id
- the id to setpublic int getFrame()
public void setFrame(int frame)
frame
- the frame to setpublic List<Point2d> getOutlineasPoints()
First this method converts shape to PolygonRoi
using step and running average
smoothing set up by
setInterpolationParameters(double, boolean, boolean)
. Then if
splineSmooth
was set, spline is fitted to ROI and result is converted to list. By
default step is set to 1 and without smoothing.
Step of 1 does not mean one point resolution. Still interpolation can apply. Use
getOutlineasRawPoints()
for obtaining pure coordinates without smoothing nor
interpolation. Depending on interpolation step, last point in list can overlap with first.
getOutlineasRawPoints()
,
setInterpolationParameters(double, boolean, boolean)
public List<Point2d> getOutlineasRawPoints()
getOutlineasPoints()
public void setInterpolationParameters(double step, boolean splineSmooth)
for (ArrayList<SegmentedShapeRoi> asS : ret) {
for (SegmentedShapeRoi ss : asS) {
ss.setInterpolationParameters(1, false);
}
}
step
- interpolation step. Step = 1 does not stand for no interpolation. Use
getOutlineasRawPoints()
instead.splineSmooth
- true to use Spline smoothinggetOutlineasPoints()
,
getOutlineasRawPoints()
public void setInterpolationParameters(double step, boolean splineSmooth, boolean runningAverageSmooth)
for (ArrayList<SegmentedShapeRoi> asS : ret) {
for (SegmentedShapeRoi ss : asS) {
ss.setInterpolationParameters(1, false,true);
}
}
step
- interpolation step. Step = 1 does not stand for no interpolation. Use
getOutlineasRawPoints()
instead.splineSmooth
- true to use Spline smoothingrunningAverageSmooth
- true for using 3 point running average smoothing. This will apply
before spline smoothing.getOutlineasPoints()
,
getOutlineasRawPoints()
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.