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

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.pipeline.AbstractCalculation
      extended by edu.jhu.cs.cisst.algorithms.segmentation.gac.GradientVectorFlow2D

public class GradientVectorFlow2D
extends AbstractCalculation

The Class GradientVectorFlowField2D extends a gradient field using vector field diffusion.


Nested Class Summary
static class GradientVectorFlow2D.Method
          The Enum Method.
 
Field Summary
protected  double coarsestLevelResolution
          The coarsest level resolution.
protected  int cols
          The cols.
protected  double diffusionWeight
          The diffusion weight.
protected  int maxIterations
          The max iterations.
protected  int multiGridCycles
          The multi-grid cycles.
protected  int multiGridIterations
          The multi-grid iterations.
protected  int multiGridResolutions
          The multi-grid resolutions.
protected  int multiGridThreads
          The multigrid threads.
protected  boolean normalize
          The normalize.
protected  int rows
          The rows.
protected  int smoothIterations
          The smooth iterations.
protected  double stdDeviation
          The std.
 
Fields inherited from class edu.jhu.ece.iacl.jist.pipeline.AbstractCalculation
monitor
 
Constructor Summary
GradientVectorFlow2D()
          Instantiates a new gradient vector flow field2 d.
GradientVectorFlow2D(double stdDeviation, double diffusionWeight, boolean normalize)
          Instantiates a new gradient vector flow field2 d.
 
Method Summary
 double getDiffusionWeight()
          Gets the diffusion weight.
protected  int getIndex(int i, int j)
          Gets the index.
protected  int getIndex(int i, int j, int k, int rows, int cols, int slices)
          Gets the index.
 int getMaxIterations()
          Gets the max iterations.
 double getStandardDeviation()
          Gets the standard deviation.
static java.lang.String getVersion()
          Gets the version.
 void monitor(double err, int iter)
           
 void monitor(double err, Vector res, int iter)
           
 void setCoarsestLevelResolution(double coarsestLevelResolution)
          Sets the coarsest level resolution.
 void setDiffusionWeight(double diffusionWeight)
          Sets the diffusion weight.
 void setMaxIterations(int maxIterations)
          Sets the max iterations.
 void setMultiGridCycles(int numMultigridCycles)
          Sets the multigrid cycles.
 void setMultiGridIterations(int numMultiGridIterations)
          Sets the multi grid iterations.
 void setMultiGridResolutions(int numMultiGridLevels)
          Sets the multi grid resolutions.
 void setMultiGridSmoothIterations(int numMultiGridSmoothIterations)
          Sets the multi grid smooth iterations.
 void setMultiGridThreads(int numMultiGridThreads)
          Sets the multi grid threads.
 void setNormalize(boolean normalize)
          Sets the normalize.
 void setStandardDeviation(double stdDeviation)
          Sets the standard deviation.
 ImageDataFloat solve(ImageDataFloat image, GradientVectorFlow2D.Method method)
          Solve using either multigrid or a sparse matrix method.
protected  ImageDataFloat solveLinear(ImageDataFloat image, GradientVectorFlow2D.Method method)
          Solve using a sparse matrix method.
protected  ImageDataFloat solveMultiGrid(ImageDataFloat image)
          Solve using multi-grid.
 
Methods inherited from class edu.jhu.ece.iacl.jist.pipeline.AbstractCalculation
add, addTotalUnits, decrementCompletedUnits, decrementCompletedUnits, getCompletedUnits, getCurrentLabel, getCurrentProgress, getLabel, getPerformance, getProgress, getTotalUnits, incrementCompletedUnits, incrementCompletedUnits, isCompleted, markCompleted, reset, setCompletedUnits, setCompletedUnits, setLabel, setMonitor, setTotalUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diffusionWeight

protected double diffusionWeight
The diffusion weight.


rows

protected int rows
The rows.


cols

protected int cols
The cols.


stdDeviation

protected double stdDeviation
The std. deviation.


multiGridThreads

protected int multiGridThreads
The multigrid threads.


smoothIterations

protected int smoothIterations
The smooth iterations.


multiGridCycles

protected int multiGridCycles
The multi-grid cycles.


multiGridIterations

protected int multiGridIterations
The multi-grid iterations.


multiGridResolutions

protected int multiGridResolutions
The multi-grid resolutions.


coarsestLevelResolution

protected double coarsestLevelResolution
The coarsest level resolution.


normalize

protected boolean normalize
The normalize.


maxIterations

protected int maxIterations
The max iterations.

Constructor Detail

GradientVectorFlow2D

public GradientVectorFlow2D()
Instantiates a new gradient vector flow field2 d.


GradientVectorFlow2D

public GradientVectorFlow2D(double stdDeviation,
                            double diffusionWeight,
                            boolean normalize)
Instantiates a new gradient vector flow field2 d.

Parameters:
stdDeviation - the std deviation
diffusionWeight - the diffusion weight
normalize - the normalize
Method Detail

getVersion

public static java.lang.String getVersion()
Gets the version.

Returns:
the version

getDiffusionWeight

public double getDiffusionWeight()
Gets the diffusion weight.

Returns:
the diffusion weight

getIndex

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

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

getIndex

protected int getIndex(int i,
                       int j,
                       int k,
                       int rows,
                       int cols,
                       int slices)
Gets the index.

Parameters:
i - the i
j - the j
k - the k
rows - the rows
cols - the cols
slices - the slices
Returns:
the index

getMaxIterations

public int getMaxIterations()
Gets the max iterations.

Returns:
the max iterations

getStandardDeviation

public double getStandardDeviation()
Gets the standard deviation.

Returns:
the standard deviation

monitor

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

monitor

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

setCoarsestLevelResolution

public void setCoarsestLevelResolution(double coarsestLevelResolution)
Sets the coarsest level resolution.

Parameters:
coarsestLevelResolution - the new coarsest level resolution

setDiffusionWeight

public void setDiffusionWeight(double diffusionWeight)
Sets the diffusion weight.

Parameters:
diffusionWeight - the new diffusion weight

setMaxIterations

public void setMaxIterations(int maxIterations)
Sets the max iterations.

Parameters:
maxIterations - the new max iterations

setNormalize

public void setNormalize(boolean normalize)
Sets the normalize.

Parameters:
normalize - the new normalize

setMultiGridCycles

public void setMultiGridCycles(int numMultigridCycles)
Sets the multigrid cycles.

Parameters:
numMultigridCycles - the new multigrid cycles

setMultiGridIterations

public void setMultiGridIterations(int numMultiGridIterations)
Sets the multi grid iterations.

Parameters:
numMultiGridIterations - the new multi grid iterations

setMultiGridResolutions

public void setMultiGridResolutions(int numMultiGridLevels)
Sets the multi grid resolutions.

Parameters:
numMultiGridLevels - the new multi grid resolutions

setMultiGridSmoothIterations

public void setMultiGridSmoothIterations(int numMultiGridSmoothIterations)
Sets the multi grid smooth iterations.

Parameters:
numMultiGridSmoothIterations - the new multi grid smooth iterations

setMultiGridThreads

public void setMultiGridThreads(int numMultiGridThreads)
Sets the multi grid threads.

Parameters:
numMultiGridThreads - the new multi grid threads

setStandardDeviation

public void setStandardDeviation(double stdDeviation)
Sets the standard deviation.

Parameters:
stdDeviation - the new standard deviation

solve

public ImageDataFloat solve(ImageDataFloat image,
                            GradientVectorFlow2D.Method method)
Solve using either multigrid or a sparse matrix method.

Parameters:
image - the image
Returns:
the image data float

solveLinear

protected ImageDataFloat solveLinear(ImageDataFloat image,
                                     GradientVectorFlow2D.Method method)
Solve using a sparse matrix method.

Parameters:
image - the image
Returns:
the image data float

solveMultiGrid

protected ImageDataFloat solveMultiGrid(ImageDataFloat image)
Solve using multi-grid.

Parameters:
image - the image
Returns:
the image data float