plugins.big.bigsnakeutils.icy.snake3D
Interface Snake3D


public interface Snake3D

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.
 icy.sequence.Sequence getBinaryMask()
          Returns a binary image representing the interior of the snake.
 javax.vecmath.Point3d getCentroid()
          Returns a point with the position of the center of gravity of the scales.
 javax.vecmath.Point3d[] getEnergyGradient()
          The purpose of this method is to compute the gradient of the snake energy with respect to the snake-defining nodes.
 Snake3DNode[] 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 getNumScales()
          Returns the number of scales in the array returned by the method getScales().
 Snake3DScale getScale(int i)
          Returns the i-th scale of the method getScales().
 Snake3DScale[] getScales()
          The purpose of this method is to determine what to draw on screen, given the current configuration of nodes.
 void initialize()
          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.
 void reviveSnake()
          Sets to true the status of the snake.
 void setNodes(Snake3DNode[] 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

javax.vecmath.Point3d[] 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 Snake3DKeeper will attempt to estimate the gradient by a finite-difference approach.


getNodes

Snake3DNode[] 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

Snake3DScale[] 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 Snake3DScale 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.


getScale

Snake3DScale getScale(int i)
Returns the i-th scale of the method getScales().


getNumScales

int getNumScales()
Returns the number of scales in the array returned by the method getScales().


getCentroid

javax.vecmath.Point3d getCentroid()
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.


reviveSnake

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


setNodes

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


initialize

void initialize()
Initializes the snake.


isInitialized

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


getBinaryMask

icy.sequence.Sequence getBinaryMask()
Returns a binary image representing the interior of the snake.