plugins.big.bigsnakeutils.icy.snake2D
Interface Snake2D


public interface Snake2D

This abstract class encapsulates the number-crunching aspect of snakes.

Version:
May 3, 2014
Author:
Ricard Delgado-Gonzalo (ricard.delgado@gmail.com), Nicolas Chenouard (nicolas.chenouard@gmail.com), Philippe Thévenaz (philippe.thevenaz@epfl.ch)

Method Summary
 double energy()
          The purpose of this method is to compute the energy of the snake.
 java.awt.geom.Point2D.Double getCentroid()
          Returns a point with the position of the center of gravity of the scales.
 java.awt.geom.Point2D.Double getCentroidRefinement()
          Returns a point with the position of the center of gravity of the scales.
 java.awt.geom.Point2D.Double[] getEnergyGradient()
          The purpose of this method is to compute the gradient of the snake energy with respect to the snake-defining nodes.
 int getFilterSize()
           
 int getIndexRefinement()
           
 Snake2DNode[] getNodes()
          This method provides an accessor to the snake-defining nodes.
 int getNumNodes()
          This method returns the quantity of snake-defining nodes given by the method getNodes.
 int getRefinementFactor()
           
 Snake2DScale[] getScales()
          The purpose of this method is to determine what to draw on screen, given the current configuration of nodes.
 int getSizeRefinementCoef()
           
 Snake2DNode[] getSubdivisionPoints()
          This method provides an accessor to the snake subdivision points.
 void initialize(boolean initShape)
          Initializes the snake.
 boolean isAlive()
          The purpose of this method is to monitor the status of the snake.
 boolean isInitialized()
          Returns true if the snake has been initialized.
 boolean isLocalRefinement()
           
 boolean isLocalRefinementAction()
           
 void localRefinementCoef(int index)
          This method compute the new coef of the local refinement
 void reviveSnake()
          Sets to true the status of the snake.
 void saveToXML(org.w3c.dom.Element node)
          Saves the execution parameters of the snake to an XML node.
 void setIndexRefinement(int index)
           
 void setNodes(Snake2DNode[] node)
          This method provides a mutator to the snake-defining nodes.
 

Method Detail

energy

double energy()
The purpose of this method is to compute the energy of the snake. This energy is usually made of three additive terms: 1) the image energy, which gives the driving force associated to the data; 2) the internal energy, which favors smoothness of the snake; and 3) the constraint energy, which incorporates a priori knowledge. This method is called repeatedly during the optimization of the snake, but only as long as the method isAlive() returns true. It is imperative that this function be everywhere differentiable with respect to the snake-defining nodes.


getEnergyGradient

java.awt.geom.Point2D.Double[] getEnergyGradient()
The purpose of this method is to compute the gradient of the snake energy with respect to the snake-defining nodes. This method is called repeatedly during the optimization of the snake, but only as long as the method isAlive() returns true. Returns an array that contains the gradient values associated to each node. They predict the variation of the energy for a horizontal or vertical displacement of one pixel. The ordering of the nodes must follow that of getNodes(). If null is returned, the optimizer within the class Snake2DKeeper will attempt to estimate the gradient by a finite-difference approach.


getNodes

Snake2DNode[] getNodes()
This method provides an accessor to the snake-defining nodes. It may be called unconditionally, whether the method isAlive() returns true or false.


getNumNodes

int getNumNodes()
This method returns the quantity of snake-defining nodes given by the method getNodes.


getScales

Snake2DScale[] getScales()
The purpose of this method is to determine what to draw on screen, given the current configuration of nodes. This method is called repeatedly during the user interaction. Collectively, the array of scales forms the skin of the snake. Returns an array of Snake2DScale objects. Straight lines will be drawn between the apices of each polygon, in the specified color. It is not necessary to maintain a constant number of polygons in the array, or a constant number of apices in a given polygon.


getCentroid

java.awt.geom.Point2D.Double getCentroid()
Returns a point with the position of the center of gravity of the scales.


getCentroidRefinement

java.awt.geom.Point2D.Double getCentroidRefinement()
Returns a point with the position of the center of gravity of the scales.


isAlive

boolean isAlive()
The purpose of this method is to monitor the status of the snake. One of its uses is to unconditionally abort the evolution of the snake by returning false, which provides an easy way to limit the number of optimization steps by counting the number of calls to the method energy(). Returns true if the snake could be properly initialized, if the skin contain valid data, and if the energy and its gradient can be computed; else, return false.


isLocalRefinement

boolean isLocalRefinement()

isLocalRefinementAction

boolean isLocalRefinementAction()

getRefinementFactor

int getRefinementFactor()

getIndexRefinement

int getIndexRefinement()

getFilterSize

int getFilterSize()

setIndexRefinement

void setIndexRefinement(int index)

localRefinementCoef

void localRefinementCoef(int index)
This method compute the new coef of the local refinement


reviveSnake

void reviveSnake()
Sets to true the status of the snake.


setNodes

void setNodes(Snake2DNode[] node)
This method provides a mutator to the snake-defining nodes.


isInitialized

boolean isInitialized()
Returns true if the snake has been initialized.


saveToXML

void saveToXML(org.w3c.dom.Element node)
Saves the execution parameters of the snake to an XML node.


initialize

void initialize(boolean initShape)
Initializes the snake.


getSubdivisionPoints

Snake2DNode[] getSubdivisionPoints()
This method provides an accessor to the snake subdivision points.


getSizeRefinementCoef

int getSizeRefinementCoef()