edu.jhu.cs.cisst.algorithms.segmentation.gac
Class VectorFieldDiffusion2D

java.lang.Object
  extended by edu.jhu.cs.cisst.algorithms.optimize.fmg.pde.CachingPDE
      extended by edu.jhu.cs.cisst.algorithms.segmentation.gac.VectorFieldDiffusion2D
All Implemented Interfaces:
PDE

public class VectorFieldDiffusion2D
extends CachingPDE

The Class VectorFieldDiffusion2D describes the vector field diffusion PDE for use by the multi-grid solver.


Nested Class Summary
static class VectorFieldDiffusion2D.Dimension
          The Enum Dimension.
 
Field Summary
protected  double diffusionWeight
          The diffusion weight.
protected  VectorFieldDiffusion2D.Dimension dim
          The dimension.
protected  float[][][][] gradientPyramid
          The gradient pyramid.
protected  SolverResolutionLevels levels
          The resolution levels.
protected  int maxIterations
          The maximum iterations.
 
Constructor Summary
VectorFieldDiffusion2D(double diffusionWeight, VectorFieldDiffusion2D.Dimension dim, float[][][][] gradientPyramid, SolverResolutionLevels levels, int maxIterations)
          Instantiates a new PDE for vector field diffusion.
 
Method Summary
protected  java.lang.Object actuallySampleMatrix(int sx, int sy, int sz, int level)
          implements method from CachingPDE.
protected  NoBoundaryGrid actuallySampleRHS(int sx, int sy, int sz, int level)
          implements method from CachingPDE.
 double evaluate(ConstBoundaryGrid u, ConstNoBoundaryGrid f, int x, int y, int z)
          implements method from PDE.
 double evaluateLHS(ConstBoundaryGrid u, ConstNoBoundaryGrid f, int x, int y, int z)
          implements method from PDE.
 double getGridSpacing(int level)
          implements method from PDE.
protected static int getIndex(int i, int j, int cols)
          Gets the index.
 void monitor(double error, int iter)
           
 void monitor(double error, Vector res, int iter)
           
 BoundaryGrid solve(ConstBoundaryGrid u, ConstNoBoundaryGrid f)
          Solve PDE directly at coarsest grid level.
 
Methods inherited from class edu.jhu.cs.cisst.algorithms.optimize.fmg.pde.CachingPDE
sampleMatrix, sampleRHS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gradientPyramid

protected float[][][][] gradientPyramid
The gradient pyramid.


dim

protected VectorFieldDiffusion2D.Dimension dim
The dimension.


levels

protected SolverResolutionLevels levels
The resolution levels.


diffusionWeight

protected double diffusionWeight
The diffusion weight.


maxIterations

protected int maxIterations
The maximum iterations.

Constructor Detail

VectorFieldDiffusion2D

public VectorFieldDiffusion2D(double diffusionWeight,
                              VectorFieldDiffusion2D.Dimension dim,
                              float[][][][] gradientPyramid,
                              SolverResolutionLevels levels,
                              int maxIterations)
Instantiates a new PDE for vector field diffusion.

Parameters:
diffusionWeight - the diffusion weight
dim - the dimension
gradientPyramid - the gradient pyramid
levels - the resolution levels
maxIterations - the max iterations
Method Detail

getGridSpacing

public double getGridSpacing(int level)
implements method from PDE.

Parameters:
level - the level
Returns:
the grid spacing
See Also:
PDE.getGridSpacing(int)

evaluateLHS

public double evaluateLHS(ConstBoundaryGrid u,
                          ConstNoBoundaryGrid f,
                          int x,
                          int y,
                          int z)
implements method from PDE.

Parameters:
u - the u
f - the f
x - the x
y - the y
z - the z
Returns:
the double
See Also:
PDE.evaluateLHS(edu.jhu.cs.cisst.algorithms.optimize.fmg.grid.ConstBoundaryGrid, edu.jhu.cs.cisst.algorithms.optimize.fmg.grid.ConstNoBoundaryGrid, int, int, int)

getIndex

protected static final int getIndex(int i,
                                    int j,
                                    int cols)
Gets the index.

Parameters:
i - the i
j - the j
cols - the cols
Returns:
the index

solve

public BoundaryGrid solve(ConstBoundaryGrid u,
                          ConstNoBoundaryGrid f)
Description copied from interface: PDE
Solve PDE directly at coarsest grid level.

Parameters:
u - the u
f - the f
Returns:
the boundary grid
See Also:
edu.jhu.cs.cisst.algorithms.optimize.fmg.pde.PDE#solve(edu.jhu.cs.cisst .algorithms.optimize.fmg.grid.ConstBoundaryGrid, edu.jhu.cs.cisst.algorithms.optimize.fmg.grid.ConstNoBoundaryGrid)

evaluate

public double evaluate(ConstBoundaryGrid u,
                       ConstNoBoundaryGrid f,
                       int x,
                       int y,
                       int z)
implements method from PDE.

Parameters:
u - the u
f - the f
x - the x
y - the y
z - the z
Returns:
the double
See Also:
PDE.evaluate(edu.jhu.cs.cisst.algorithms.optimize.fmg.grid.ConstBoundaryGrid, edu.jhu.cs.cisst.algorithms.optimize.fmg.grid.ConstNoBoundaryGrid, int, int, int)

actuallySampleRHS

protected NoBoundaryGrid actuallySampleRHS(int sx,
                                           int sy,
                                           int sz,
                                           int level)
implements method from CachingPDE.

Specified by:
actuallySampleRHS in class CachingPDE
Parameters:
sx - the sx
sy - the sy
sz - the sz
level - the level
Returns:
the no boundary grid
See Also:
CachingPDE.actuallySampleRHS(int, int, int, int)

actuallySampleMatrix

protected java.lang.Object actuallySampleMatrix(int sx,
                                                int sy,
                                                int sz,
                                                int level)
implements method from CachingPDE.

Specified by:
actuallySampleMatrix in class CachingPDE
Parameters:
sx - the sx
sy - the sy
sz - the sz
level - the level
Returns:
the object
See Also:
CachingPDE.sampleMatrix(int, int, int, int)

monitor

public void monitor(double error,
                    int iter)
See Also:
no.uib.cipr.matrix.sparse.IterationReporter#monitor(double, int)

monitor

public void monitor(double error,
                    Vector res,
                    int iter)
See Also:
no.uib.cipr.matrix.sparse.IterationReporter#monitor(double, no.uib.cipr.matrix.Vector, int)