plugins.big.bigsnake.snake
Class ESnake

java.lang.Object
  extended by plugins.big.bigsnake.snake.ESnake
All Implemented Interfaces:
plugins.big.bigsnakeutils.icy.snake2D.Snake2D

public class ESnake
extends java.lang.Object
implements plugins.big.bigsnakeutils.icy.snake2D.Snake2D

Exponential spline snake (E-Snake).

Version:
November 15, 2014
Author:
Ricard Delgado-Gonzalo (ricard.delgado@gmail.com), Ramtin Madani (ramtin_madani@yahoo.com), Masih Nilchian (masih_n85@yahoo.com), Daniel Schmitter (daniel.schmitter@epfl.ch)

Field Summary
static java.lang.String ID_CONTROL_POINT
          Label of the XML tag containing the a single snake-defining control point.
static java.lang.String ID_CONTROL_POINTS
          Label of the XML tag containing the list of snake-defining control points.
 
Constructor Summary
ESnake(ImageLUTContainer imageLUTs, ESnakeParameters parameters, java.lang.Object initialContour, plugins.big.bigsnakeutils.shape.priorshapes.shapes.Custom customPriorShape)
          Constructor.
 
Method Summary
 void dilateX(double a)
          Modifies the control points of a snake in order to scale the snake horizontally by a given factor.
 void dilateY(double b)
          Modifies the control points of a snake in order to scale the snake vertically by a given factor.
 double energy()
          The purpose of this method is to compute the energy of the snake.
 double getArea()
          Retrieves the area under the curve determined by the snake.
 java.awt.Rectangle getBounds()
          Returns the bounding box of the snake curve.
 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()
           
 plugins.big.bigsnakeutils.shape.priorshapes.shapes.Custom getCustomPriorShape()
          Returns the custom shape prior (if any).
 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()
           
 plugins.big.bigsnakeutils.icy.snake2D.Snake2DNode[] getNodes()
          This method provides an accessor to the snake-defining nodes.
 int getNumNodes()
          This method returns the quantity of snake-defining nodes.
 int getNumScales()
          Returns the number of scales provided by the method getScales().
 ESnakeOrientation getOrientation()
          Retrieves the orientation of the curve determined by the snake.
 int getRefinementFactor()
           
 plugins.big.bigsnakeutils.icy.snake2D.Snake2DScale[] getScales()
          The purpose of this method is to determine what to draw on screen, given the current configuration of nodes.
 int getSizeRefinementCoef()
           
 ESnakeParameters getSnakeParameters()
          Returns a new container with the information of the execution parameters of the snake.
 plugins.big.bigsnakeutils.icy.snake2D.Snake2DNode[] getSubdivisionPoints()
           
 void initialize(boolean initShape)
           
 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()
           
 boolean isValid()
          Returns false if the snake reaches an invalid configuration.
 void localRefinementCoef(int index)
           
 void reviveSnake()
          Sets the status of the snake to alive, and restores the maximum number iterations to the original one.
 void saveToXML(org.w3c.dom.Element node)
          Saves the snake-defining parameters in an XML file.
 void setCustomPriorShape(plugins.big.bigsnakeutils.shape.priorshapes.shapes.Custom customPriorShape)
          Sets a custom prior-shape to the snake.
 void setIndexRefinement(int index)
           
 void setNodes(plugins.big.bigsnakeutils.icy.snake2D.Snake2DNode[] node)
          This method provides a mutator to the snake-defining nodes.
 void setSnakeParameters(ESnakeParameters parameters)
          Sets the E-Snake execution parameters.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_CONTROL_POINTS

public static final java.lang.String ID_CONTROL_POINTS
Label of the XML tag containing the list of snake-defining control points.

See Also:
Constant Field Values

ID_CONTROL_POINT

public static final java.lang.String ID_CONTROL_POINT
Label of the XML tag containing the a single snake-defining control point.

See Also:
Constant Field Values
Constructor Detail

ESnake

public ESnake(ImageLUTContainer imageLUTs,
              ESnakeParameters parameters,
              java.lang.Object initialContour,
              plugins.big.bigsnakeutils.shape.priorshapes.shapes.Custom customPriorShape)
Constructor.

Method Detail

energy

public 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.

Specified by:
energy in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getCentroid

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

Specified by:
getCentroid in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getEnergyGradient

public 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.

Specified by:
getEnergyGradient in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getNodes

public plugins.big.bigsnakeutils.icy.snake2D.Snake2DNode[] getNodes()
This method provides an accessor to the snake-defining nodes.

Specified by:
getNodes in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getNumNodes

public int getNumNodes()
This method returns the quantity of snake-defining nodes.

Specified by:
getNumNodes in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getScales

public plugins.big.bigsnakeutils.icy.snake2D.Snake2DScale[] getScales()
The purpose of this method is to determine what to draw on screen, given the current configuration of nodes. Collectively, the array of scales forms the skin of the snake.

Specified by:
getScales in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

initialize

public void initialize(boolean initShape)
Specified by:
initialize in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

isAlive

public boolean isAlive()
The purpose of this method is to monitor the status of the snake.

Specified by:
isAlive in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

isInitialized

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

Specified by:
isInitialized in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

reviveSnake

public void reviveSnake()
Sets the status of the snake to alive, and restores the maximum number iterations to the original one.

Specified by:
reviveSnake in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

saveToXML

public void saveToXML(org.w3c.dom.Element node)
Saves the snake-defining parameters in an XML file.

Specified by:
saveToXML in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

setNodes

public void setNodes(plugins.big.bigsnakeutils.icy.snake2D.Snake2DNode[] node)
This method provides a mutator to the snake-defining nodes.

Specified by:
setNodes in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getArea

public double getArea()
Retrieves the area under the curve determined by the snake.


getBounds

public java.awt.Rectangle getBounds()
Returns the bounding box of the snake curve.


getCustomPriorShape

public plugins.big.bigsnakeutils.shape.priorshapes.shapes.Custom getCustomPriorShape()
Returns the custom shape prior (if any).


getNumScales

public int getNumScales()
Returns the number of scales provided by the method getScales().


getSnakeParameters

public ESnakeParameters getSnakeParameters()
Returns a new container with the information of the execution parameters of the snake.


getOrientation

public ESnakeOrientation getOrientation()
Retrieves the orientation of the curve determined by the snake.


isValid

public boolean isValid()
Returns false if the snake reaches an invalid configuration. It can be related to ill-posed configuration of the points or related to the image boundaries.


setCustomPriorShape

public void setCustomPriorShape(plugins.big.bigsnakeutils.shape.priorshapes.shapes.Custom customPriorShape)
Sets a custom prior-shape to the snake.


setSnakeParameters

public void setSnakeParameters(ESnakeParameters parameters)
Sets the E-Snake execution parameters.


dilateX

public void dilateX(double a)
Modifies the control points of a snake in order to scale the snake horizontally by a given factor.


dilateY

public void dilateY(double b)
Modifies the control points of a snake in order to scale the snake vertically by a given factor.


getSubdivisionPoints

public plugins.big.bigsnakeutils.icy.snake2D.Snake2DNode[] getSubdivisionPoints()
Specified by:
getSubdivisionPoints in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getCentroidRefinement

public java.awt.geom.Point2D.Double getCentroidRefinement()
Specified by:
getCentroidRefinement in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

isLocalRefinement

public boolean isLocalRefinement()
Specified by:
isLocalRefinement in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

isLocalRefinementAction

public boolean isLocalRefinementAction()
Specified by:
isLocalRefinementAction in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getRefinementFactor

public int getRefinementFactor()
Specified by:
getRefinementFactor in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getIndexRefinement

public int getIndexRefinement()
Specified by:
getIndexRefinement in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getFilterSize

public int getFilterSize()
Specified by:
getFilterSize in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

setIndexRefinement

public void setIndexRefinement(int index)
Specified by:
setIndexRefinement in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

localRefinementCoef

public void localRefinementCoef(int index)
Specified by:
localRefinementCoef in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D

getSizeRefinementCoef

public int getSizeRefinementCoef()
Specified by:
getSizeRefinementCoef in interface plugins.big.bigsnakeutils.icy.snake2D.Snake2D