com.xinapse.multisliceimage.roi
Interface EditableOutlineROI

All Known Implementing Classes:
ContourROI, CurvedLineROI, IrregularROI

public interface EditableOutlineROI

An interface that ROIs implement if they have an editable outline with handles at each vertex.


Method Summary
 boolean deleteVertex(Handle handle)
          Delete a point on the outline of this CurvedLineROI that is under a handle.
 java.util.List<ROI> erasePoints(java.util.List<java.awt.geom.Point2D> erasePoints, float size, int nCols, int nRows, float pixelXSize, float pixelYSize)
          Erase points from this ROI.
 Handle getFollowingHandle(Handle handle)
          Returns the Handle that is immediately after the specified handle, in the order in which they were placed around the ROI.
 Handle getPrecedingHandle(Handle handle)
          Returns the Handle that is immediately before the specified handle, in the order in which they were placed around the ROI.
 Handle[] getVertexHandles()
          Returns an array of VertexHandles.
 boolean insertTwoVertices(Handle handle)
          Insert two points into the outline of this CurvedLineROI: one just before the one that is under a handle, and one just after.
 void makeConvex(CanAddROIToFrame canAddROIToFrame, float pixelXSize, float pixelYSize, float minConcaveRadius)
          Make this Irregular ROI convex, or at least less concave.
 void moveVertex(java.awt.geom.Point2D newPos, Handle handle, int nCols, int nRows, float pixelXSize, float pixelYSize, boolean pixelSnap)
          Move a point on the outline of this CurvedLineROI to a new position.
 

Method Detail

getVertexHandles

Handle[] getVertexHandles()
Returns an array of VertexHandles.

Returns:
an array of VertexHandles, or null if this ROI is not having its ouline edited.

getFollowingHandle

Handle getFollowingHandle(Handle handle)
Returns the Handle that is immediately after the specified handle, in the order in which they were placed around the ROI.

Parameters:
handle - the handle for which to get the following handle.
Returns:
the following Handle, or null if there is no following handle.

getPrecedingHandle

Handle getPrecedingHandle(Handle handle)
Returns the Handle that is immediately before the specified handle, in the order in which they were placed around the ROI.

Parameters:
handle - the handle for which to get the preceding handle.
Returns:
the preceding Handle, or null if there is no preceding handle.

moveVertex

void moveVertex(java.awt.geom.Point2D newPos,
                Handle handle,
                int nCols,
                int nRows,
                float pixelXSize,
                float pixelYSize,
                boolean pixelSnap)
Move a point on the outline of this CurvedLineROI to a new position.

Parameters:
newPos - the new location of the vertex in pixel coordinates.
handle - the Handle that the user has grabbed, used to identify the vertex to be moved.
nCols - the number of image columns.
nRows - the number of image rows.
pixelXSize - the pixel width in mm.
pixelYSize - the pixel height in mm.
pixelSnap - whether pixel snap is turned on.

insertTwoVertices

boolean insertTwoVertices(Handle handle)
Insert two points into the outline of this CurvedLineROI: one just before the one that is under a handle, and one just after.

Parameters:
handle - the Handle that the user has grabbed, used to identify the vertex around which the new vertices are to be placed.
Returns:
true if a point is successfully inserted.

deleteVertex

boolean deleteVertex(Handle handle)
Delete a point on the outline of this CurvedLineROI that is under a handle.

Parameters:
handle - the Handle that the user has grabbed, used to identify the vertex to be deleted.
Returns:
true if a point is successfully deleted.

erasePoints

java.util.List<ROI> erasePoints(java.util.List<java.awt.geom.Point2D> erasePoints,
                                float size,
                                int nCols,
                                int nRows,
                                float pixelXSize,
                                float pixelYSize)
Erase points from this ROI. erasePoints may edit this ROI by deleting points, or it may split this ROI into two or more new ROIs. If more than one ROI is returned, then the (edited) original ROI will be in the list of returned ROIs, and will be the remaining ROI which is biggest (has the most points).

Parameters:
erasePoints - a List of points through which the erasing pen has passed.
size - the size of the erasing pen in mm.
nCols - the number of image columns.
nRows - the number of image rows.
pixelXSize - the pixel width in mm.
pixelYSize - the pixel height in mm.
Returns:
a List of ROIs resulting from the points erasure.

makeConvex

void makeConvex(CanAddROIToFrame canAddROIToFrame,
                float pixelXSize,
                float pixelYSize,
                float minConcaveRadius)
Make this Irregular ROI convex, or at least less concave. The supplied pixel sizes are used to decide on the separation between data points around the ROI. A minimum radius of curvature for concave radii of curvature is given. The action of making the ROI convex will be executed asynchronously using a javax.swing.SwingWorker that will update the ImageDisplayer when finished.

Parameters:
canAddROIToFrame - the CanAddROIToFrame to be updated when the operation is complete.
pixelXSize - the width of an image pixel in mm.
pixelYSize - the height of an image pixel in mm.
minConcaveRadius - the minimum radius of curvature for concave parts of this ROI.


Copyright 2006-2008 Xinapse Systems Limited. All Rights Reserved.