Package com.xinapse.multisliceimage.roi
Class IrregularROIInProgress
java.lang.Object
com.xinapse.multisliceimage.roi.ROI
com.xinapse.multisliceimage.roi.IrregularROI
com.xinapse.multisliceimage.roi.IrregularROIInProgress
- All Implemented Interfaces:
EditableOutlineROI
,RotatableROI
,StretchableROI
,Cloneable
A Class representing an IrregularROI being drawn on an image. When being drawn, an IrregularROI
looks like a CurvedLineROI.
-
Field Summary
Fields inherited from class com.xinapse.multisliceimage.roi.IrregularROI
nPoints, POINTSTOKEN, xpts, ypts
Fields inherited from class com.xinapse.multisliceimage.roi.ROI
BUTTON_ICON_SIZE, handles, PREFERENCES_NODE_NAME, XTOKEN, YTOKEN
-
Constructor Summary
ConstructorDescriptionIrregularROIInProgress
(double[] x, double[] y, byte userColour) Creates a newIrregularROIInProgress
with the specified shape in mm coordinates. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendVertex
(double x, double y) Appends a vertex to the end of this IrregularROIInProgress.void
appendVertex
(Point2D pt) Appends a vertex to the end of this IrregularROIInProgress.clone()
Returns a clone of thisROI
.boolean
draw
(Graphics g, Rectangle visibleRectangle, int imageDrawCols, int imageDrawRows, int xOffset, int yOffset, int nCols, int nRows, float pixelXSize, float pixelYSize, boolean drawAnnotation) Draws thisROI
if it needs to be be drawn on screen.void
insertVertex
(double x, double y) Inserts a vertex at the beginning of this IrregularROIInProgress.void
insertVertex
(Point2D pt) Inserts a vertex at the beginning of this IrregularROIInProgress.void
Removes the first vertex from this IrregularROIInProgress.void
Removes the last vertex from this IrregularROIInProgress.Methods inherited from class com.xinapse.multisliceimage.roi.IrregularROI
closestPoints, contains, containsVertex, deleteVertex, drawInOrthoView, equals, erasePoints, flipHorizontal, flipVertical, getButtonIcon, getCentre, getCentroid, getCopy, getCreateInteractionType, getDescription, getFeret, getFollowingVisibleHandle, getName, getNormal, getNPoints, getPerimeter, getPrecedingVisibleHandle, getPrincipalAxisAngle, getTheta, getVertex, getVertexHandles, getVertices, hashCode, insertTwoVertices, intersect, join, main, makeConvex, makeConvex, move, move, moveVertex, orderPoints, removeSelfIntersections, selfIntersects, set, setTheta, setVertex, setVertices, setVertices, setVertices, setVertices, simplify, toSpline, toSpline, toString
Methods inherited from class com.xinapse.multisliceimage.roi.ROI
andNot, andNot, andNot, clearDeletionHistory, dilate, exclusiveOr, exclusiveOr, getAnnotation, getBoundingRectangle, getBoundingRectangle, getCentroid, getClasses, getColor, getDesignTextFontSize, getDisplayedBounds2D, getDisplayedBounds2D, getDisplayedRoiArea, getFeret, getGroupUid, getGroupUid, getHandles, getHandleUnderPoint, getImageSource, getPixelValue, getROIs, getROIs, getROIs, getROIs, getROIs, getSlice, getState, getStats, getStats, getStats, getTextColor, getUserColour, group, intersect, intersect, intersects, isDeleted, isEditable, isGroup, isReloaded, isSameAnnotation, isSameColour, isSelected, join, logicalUnion, markDeleted, mmPosToPix, moveROIs, pixPosToMm, printStats, selectDeselect, setAnnotation, setCreationHistory, setGroupUid, setSlice, setState, setTextColor, setTextSize, setUserColour, ungroup, ungroup, union, union, write, write
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.xinapse.multisliceimage.roi.StretchableROI
getDisplayedBounds2D
-
Constructor Details
-
IrregularROIInProgress
Creates a newIrregularROIInProgress
with the specified shape in mm coordinates.- Parameters:
x
- an array of x-coordinates for the points forming the outline.y
- an array of y-coordinates for the points forming the outline.userColour
- the colour of this ROI. A value of 0 indicates that the ROI will be drawn with the default colour for normal ROIs.- Throws:
ROIException
- if theROI
cannot be created as specified.
-
-
Method Details
-
appendVertex
Appends a vertex to the end of this IrregularROIInProgress.- Parameters:
pt
- the location of the vertex to append.
-
appendVertex
public void appendVertex(double x, double y) Appends a vertex to the end of this IrregularROIInProgress.- Parameters:
x
- the x-location of the vertex to append.y
- the y-location of the vertex to append.
-
insertVertex
Inserts a vertex at the beginning of this IrregularROIInProgress.- Parameters:
pt
- the location of the vertex to append.
-
insertVertex
public void insertVertex(double x, double y) Inserts a vertex at the beginning of this IrregularROIInProgress.- Parameters:
x
- the x-location of the vertex to insert.y
- the y-location of the vertex to insert.
-
removeLastVertex
public void removeLastVertex()Removes the last vertex from this IrregularROIInProgress. -
removeFirstVertex
public void removeFirstVertex()Removes the first vertex from this IrregularROIInProgress. -
draw
public boolean draw(Graphics g, Rectangle visibleRectangle, int imageDrawCols, int imageDrawRows, int xOffset, int yOffset, int nCols, int nRows, float pixelXSize, float pixelYSize, boolean drawAnnotation) Description copied from class:ROI
Draws thisROI
if it needs to be be drawn on screen.- Overrides:
draw
in classIrregularROI
- Parameters:
g
- the graphics context for the drawing operation.visibleRectangle
- the part of the image that can be seen on-screen.imageDrawCols
- width of the area in which this portion of the image is to be drawn.imageDrawRows
- height of the area in which this portion of the image is to be drawn.xOffset
- a horizontal offset for drawing operations.yOffset
- a vertical offset for drawing operations.nCols
- the number of columns in the image on which thisROI
is defined.nRows
- the number of rows in the image on which thisROI
is defined.pixelXSize
- pixel width for the image on which thisROI
is defined.pixelYSize
- pixel height for the image on which thisROI
is defined.drawAnnotation
- a flag to indicate whether annotation should be drawn.- Returns:
true
if theROI
is visible and been drawn on screen;false
otherwise.
-
clone
Description copied from class:ROI
Returns a clone of thisROI
. The copy will be identical in shape and annotation as the original ROI, and with a history identical to the clonedROI
.- Overrides:
clone
in classIrregularROI
- Returns:
- a clone of this
ROI
, cast to anObject
.
-