snakeprogram
Class TwoDDeformation

java.lang.Object
  extended by snakeprogram.TwoDDeformation
Direct Known Subclasses:
TwoDContourDeformation, TwoDCurveDeformation

public abstract class TwoDDeformation
extends java.lang.Object

This class deforms snakes. You create an instance of this class either a TwoDContourDeformation or a TwoDCurveDevormation and set the relevant parameter, then you can deform the snake. This modifies the X-Y data inplace.


Method Summary
abstract  void addSnakePoints(double MAX_SEGMENT_LENGTH)
          Modifies the current dataset to interpolate points.
 void deformSnake()
           
abstract  void energyWithGradient(double[] Vx, double[] Vy)
          Modifies Vx,Vy in place to find the forces it uses the image term and the 'stretching' term.
abstract  void initializeMatrix()
          Initializes the double[][] array according to curve type
static double[] interpolate(double[] p1, double[] p2, double t)
          Interpolates arrays of values using the above interpolation function
static double interpolate(double x1, double x2, double t)
           
static double pointDistance(double[] x1, double[] x2)
           
 void setAlpha(double alpha)
          Set this before using
 void setBackInt(double backInt)
          This needs to be set
 void setBeta(double beta)
          Needs to be set
 void setForInt(double forInt)
          This needs to be set
 void setGamma(double gamma)
          Needs to be set
 void setStretch(double stretch)
          No default value needs to be set for TwoDCurveDeformations
 void setWeight(double weight)
          This needs to be set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setAlpha

public void setAlpha(double alpha)
Set this before using


setBeta

public void setBeta(double beta)
Needs to be set


setGamma

public void setGamma(double gamma)
Needs to be set


setWeight

public void setWeight(double weight)
This needs to be set


setForInt

public void setForInt(double forInt)
This needs to be set


setBackInt

public void setBackInt(double backInt)
This needs to be set


setStretch

public void setStretch(double stretch)
No default value needs to be set for TwoDCurveDeformations


deformSnake

public void deformSnake()

pointDistance

public static double pointDistance(double[] x1,
                                   double[] x2)

interpolate

public static double interpolate(double x1,
                                 double x2,
                                 double t)

interpolate

public static double[] interpolate(double[] p1,
                                   double[] p2,
                                   double t)
Interpolates arrays of values using the above interpolation function


addSnakePoints

public abstract void addSnakePoints(double MAX_SEGMENT_LENGTH)
                             throws java.lang.IllegalAccessException
Modifies the current dataset to interpolate points. The different deformations have a different way to modify the points

Throws:
java.lang.IllegalAccessException

energyWithGradient

public abstract void energyWithGradient(double[] Vx,
                                        double[] Vy)
Modifies Vx,Vy in place to find the forces it uses the image term and the 'stretching' term.


initializeMatrix

public abstract void initializeMatrix()
Initializes the double[][] array according to curve type