plugins.big.bigsnake.roi
Class ROI2DSnake

java.lang.Object
  extended by icy.roi.ROI
      extended by icy.roi.ROI2D
          extended by plugins.kernel.roi.roi2d.ROI2DShape
              extended by plugins.kernel.roi.roi2d.ROI2DPath
                  extended by plugins.big.bigsnake.roi.ROI2DSnake
All Implemented Interfaces:
icy.common.listener.ChangeListener, icy.file.xml.XMLPersistent, java.awt.Shape

public class ROI2DSnake
extends plugins.kernel.roi.roi2d.ROI2DPath

Class that handles the interaction and the display of the snake.

Version:
May 24, 2015
Author:
Nicolas Chenouard (nicolas.chenouard@gmail.com), Ricard Delgado-Gonzalo (ricard.delgado@gmail.com), Ulugbek S. Kamilov (kamilov@gmail.com)

Nested Class Summary
 
Nested classes/interfaces inherited from class plugins.kernel.roi.roi2d.ROI2DShape
plugins.kernel.roi.roi2d.ROI2DShape.ROI2DShapePainter
 
Nested classes/interfaces inherited from class icy.roi.ROI2D
icy.roi.ROI2D.ROI2DPainter
 
Nested classes/interfaces inherited from class icy.roi.ROI
icy.roi.ROI.ROIIdComparator, icy.roi.ROI.ROINameComparator, icy.roi.ROI.ROIPainter
 
Field Summary
static java.lang.String ID_SNAKE_PARAMETERS
          XML tag for the snake parameters.
 
Fields inherited from class plugins.kernel.roi.roi2d.ROI2DPath
ID_POINT, ID_POINTS, ID_WINDING
 
Fields inherited from class icy.roi.ROI2D
ID_C, ID_T, ID_Z
 
Fields inherited from class icy.roi.ROI
DEFAULT_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 Summary
ROI2DSnake()
          Default constructor.
ROI2DSnake(ESnake snake, SnakeKeeper keeper)
          Constructor.
 
Method Summary
 void changePosition(double[] xPosition, double[] yPosition, plugins.big.bigsnakeutils.icy.snake2D.Snake2DScale[] scales)
           
 java.awt.Rectangle computeBounds2D()
          Gets the bounding rectangle of the first polyline of the snake skin.
 boolean[] getAsBooleanMask(int x, int y, int w, int h, boolean inclusive)
          Get the ROI as a boolean bitmap mask for the specified rectangular area.
 java.awt.Color getColor()
          Gets the color of the first polyline forming the skin of the snake.
 java.awt.geom.Point2D getControlPoint(int i)
           
 plugins.kernel.roi.roi2d.ROI2DPath getCopy()
          Method that creates a copy of the contour of the snake as an ROI2DPath.
 void refreshROI()
           
 void refreshScales()
           
 boolean saveToXML(org.w3c.dom.Node node)
          Saves a snake from an XML node.
 void setEditable(boolean isEditable)
          Sets the edit status of the ROI.
 void setEditMode(SnakeEditMode editMode)
           
 
Methods inherited from class plugins.kernel.roi.roi2d.ROI2DPath
canAddPoint, getPathAnchors, loadFromXML
 
Methods inherited from class plugins.kernel.roi.roi2d.ROI2DShape
addNewPoint, addPoint, addPoint, addPointAt, canRemovePoint, canTranslate, contains, contains, contains, contains, contains, controlPointOverlayChanged, controlPointPositionChanged, getControlPoints, getPathIterator, getPathIterator, getPoints, getShape, hasSelectedPoint, intersects, intersects, intersects, isOverEdge, onChanged, painterChanged, removePoint, removePointAt, removeSelectedPoint, setSelected, translate
 
Methods inherited from class icy.roi.ROI2D
canSetBounds, canSetPosition, computeBounds5D, computeNumberOfContourPoints, computeNumberOfPoints, contains, contains, getArea, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getAsBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask, getBooleanMask2D, getBooleanMask2D, getBounds, getBounds2D, getC, getDimension, getPerimeter, getPosition, getPosition2D, getROI2DList, getROI2DList, getROI2DList, getT, getZ, intersects, isActiveFor, isActiveFor, isOver, isOver, isOverEdge, isOverEdge, isOverEdge, merge, setBounds2D, setBounds5D, setC, setPosition, setPosition2D, setPosition5D, setT, setZ, substract, subtract
 
Methods inherited from class icy.roi.ROI
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, getDisplayColor, getExclusiveUnion, getFirstSequence, getFocusedColor, getIcon, getId, getIntersection, getName, getNumberOfContourPoints, getNumberOfPoints, getOpacity, getOverlay, getPainter, getPosition5D, getPropertyValue, getROICount, getROIList, getROIList, getROIList, getROIsFromXML, getSelectedColor, getSequences, getShowName, getSimpleClassName, getStroke, getSubtraction, getUnion, getVolume, internalFocus, internalSelect, internalUnfocus, internalUnselect, intersects, isAttached, isCreating, isEditable, isFocused, isReadOnly, isSelected, isUpdating, loadFromXML, loadROIsFromXML, merge, nameChanged, painterChanged, propertyChanged, remove, remove, removeListener, roiChanged, roiChanged, saveROIsToXML, selectionChanged, setColor, setCreating, setFocused, setIcon, setMousePos, setName, setOpacity, setPropertyValue, setReadOnly, setROIsFromXML, setSelected, setSelectedColor, setShowName, setStroke
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
getBounds, getBounds2D
 

Field Detail

ID_SNAKE_PARAMETERS

public static final java.lang.String ID_SNAKE_PARAMETERS
XML tag for the snake parameters.

See Also:
Constant Field Values
Constructor Detail

ROI2DSnake

public ROI2DSnake()
Default constructor.


ROI2DSnake

public ROI2DSnake(ESnake snake,
                  SnakeKeeper keeper)
Constructor.

Method Detail

changePosition

public void changePosition(double[] xPosition,
                           double[] yPosition,
                           plugins.big.bigsnakeutils.icy.snake2D.Snake2DScale[] scales)

getControlPoint

public java.awt.geom.Point2D getControlPoint(int i)

refreshROI

public void refreshROI()

refreshScales

public void refreshScales()

setEditMode

public void setEditMode(SnakeEditMode editMode)

getCopy

public plugins.kernel.roi.roi2d.ROI2DPath getCopy()
Method that creates a copy of the contour of the snake as an ROI2DPath.

Overrides:
getCopy in class icy.roi.ROI

computeBounds2D

public java.awt.Rectangle computeBounds2D()
Gets the bounding rectangle of the first polyline of the snake skin.

Overrides:
computeBounds2D in class plugins.kernel.roi.roi2d.ROI2DShape

getAsBooleanMask

public boolean[] getAsBooleanMask(int x,
                                  int y,
                                  int w,
                                  int h,
                                  boolean inclusive)
Get the ROI as a boolean bitmap mask for the specified rectangular area.

Overrides:
getAsBooleanMask in class icy.roi.ROI2D

getColor

public java.awt.Color getColor()
Gets the color of the first polyline forming the skin of the snake.

Overrides:
getColor in class icy.roi.ROI

saveToXML

public boolean saveToXML(org.w3c.dom.Node node)
Saves a snake from an XML node.

Specified by:
saveToXML in interface icy.file.xml.XMLPersistent
Overrides:
saveToXML in class plugins.kernel.roi.roi2d.ROI2DPath

setEditable

public void setEditable(boolean isEditable)
Sets the edit status of the ROI.

Overrides:
setEditable in class icy.roi.ROI