edu.jhu.cs.cisst.algorithms.geometry.surface
Class IsoContourGenerator

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.pipeline.AbstractCalculation
      extended by edu.jhu.cs.cisst.algorithms.geometry.surface.IsoContourGenerator

public class IsoContourGenerator
extends AbstractCalculation

The Iso-Contour generator generates 2D curves representing closed contours. The algorithm has been modified from it's original implementation so that contours are connected and do not self-intersect.

Author:
Blake Lucas

Nested Class Summary
protected  class IsoContourGenerator.Edge
          The Class Edge stores vertex ids.
protected  class IsoContourGenerator.EdgeSplit
          The Class EdgeSplit is a container to describe a level set crossing point.
static class IsoContourGenerator.Winding
          The winding order for triangle vertices.
 
Field Summary
protected  int cols
          The cols.
protected  int component
          The component.
protected  float[][][][] fieldMat
          The field mat.
protected  float[][] imgMat
          The img mat.
protected  float isoLevel
          The iso level.
protected  float resX
          The res y.
protected  float resY
          The res y.
protected  int rows
          The cols.
protected  int slice
          The slice.
protected  boolean useResolutions
          The use resolutions.
protected  int vertCount
          The vert count.
protected  float[][][] volMat
          The vol mat.
protected  IsoContourGenerator.Winding winding
          The winding order.
 
Fields inherited from class edu.jhu.ece.iacl.jist.pipeline.AbstractCalculation
monitor
 
Constructor Summary
IsoContourGenerator()
          Instantiates a new iso contour generator.
IsoContourGenerator(AbstractCalculation parent)
          Instantiates a new iso contour generator.
 
Method Summary
protected  void addEdge(java.util.Hashtable<java.lang.Long,IsoContourGenerator.EdgeSplit> splits, java.util.LinkedList<IsoContourGenerator.Edge> edges, int p1x, int p1y, int p2x, int p2y, int p3x, int p3y, int p4x, int p4y)
          Adds the edge.
protected  IsoContourGenerator.EdgeSplit createSplit(java.util.Hashtable<java.lang.Long,IsoContourGenerator.EdgeSplit> splits, int p1x, int p1y, int p2x, int p2y)
          Creates the split.
protected  float fGetOffset(Point2i v1, Point2i v2)
          Interpolate position along edge.
protected  float getValue(int i, int j)
          Gets the value.
static java.lang.String getVersion()
          Gets the version.
protected  void processSquare(int i, int j, java.util.Hashtable<java.lang.Long,IsoContourGenerator.EdgeSplit> splits, java.util.LinkedList<IsoContourGenerator.Edge> edges)
          Process square.
 void setUseResolutions(boolean useResolutions)
          Sets the use resolutions.
 void setWinding(IsoContourGenerator.Winding winding)
          Sets the winding.
 CurveCollection solve(ImageDataFloat vol, float isoLevel)
          Solve for iso-contour.
 CurveCollection solve(ImageDataFloat vol, float isoLevel, int slice, int component)
          Solve for iso-contour.
 
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

volMat

protected float[][][] volMat
The vol mat.


fieldMat

protected float[][][][] fieldMat
The field mat.


imgMat

protected float[][] imgMat
The img mat.


rows

protected int rows
The cols.


cols

protected int cols
The cols.


vertCount

protected int vertCount
The vert count.


isoLevel

protected float isoLevel
The iso level.


slice

protected int slice
The slice.


component

protected int component
The component.


resX

protected float resX
The res y.


resY

protected float resY
The res y.


useResolutions

protected boolean useResolutions
The use resolutions.


winding

protected IsoContourGenerator.Winding winding
The winding order.

Constructor Detail

IsoContourGenerator

public IsoContourGenerator()
Instantiates a new iso contour generator.


IsoContourGenerator

public IsoContourGenerator(AbstractCalculation parent)
Instantiates a new iso contour generator.

Parameters:
parent - the parent
Method Detail

getVersion

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

Returns:
the version

addEdge

protected void addEdge(java.util.Hashtable<java.lang.Long,IsoContourGenerator.EdgeSplit> splits,
                       java.util.LinkedList<IsoContourGenerator.Edge> edges,
                       int p1x,
                       int p1y,
                       int p2x,
                       int p2y,
                       int p3x,
                       int p3y,
                       int p4x,
                       int p4y)
Adds the edge.

Parameters:
splits - the splits
edges - the edges
p1x - the p1x
p1y - the p1y
p2x - the p2x
p2y - the p2y
p3x - the p3x
p3y - the p3y
p4x - the p4x
p4y - the p4y

createSplit

protected IsoContourGenerator.EdgeSplit createSplit(java.util.Hashtable<java.lang.Long,IsoContourGenerator.EdgeSplit> splits,
                                                    int p1x,
                                                    int p1y,
                                                    int p2x,
                                                    int p2y)
Creates the split.

Parameters:
splits - the splits
p1x - the p1x
p1y - the p1y
p2x - the p2x
p2y - the p2y
Returns:
the edge split

fGetOffset

protected float fGetOffset(Point2i v1,
                           Point2i v2)
Interpolate position along edge.

Parameters:
v1 - the lower grid point
v2 - the upper grid point
Returns:
the position

getValue

protected float getValue(int i,
                         int j)
Gets the value.

Parameters:
i - the i
j - the j
Returns:
the value

processSquare

protected void processSquare(int i,
                             int j,
                             java.util.Hashtable<java.lang.Long,IsoContourGenerator.EdgeSplit> splits,
                             java.util.LinkedList<IsoContourGenerator.Edge> edges)
Process square.

Parameters:
i - the i
j - the j
splits - the splits
edges - the edges

setUseResolutions

public void setUseResolutions(boolean useResolutions)
Sets the use resolutions.

Parameters:
useResolutions - the new use resolutions

setWinding

public void setWinding(IsoContourGenerator.Winding winding)
Sets the winding.

Parameters:
winding - the new winding

solve

public CurveCollection solve(ImageDataFloat vol,
                             float isoLevel)
Solve for iso-contour.

Parameters:
vol - the level set
isoLevel - the target iso-level
Returns:
the iso-surface

solve

public CurveCollection solve(ImageDataFloat vol,
                             float isoLevel,
                             int slice,
                             int component)
Solve for iso-contour.

Parameters:
vol - the level set
isoLevel - the target iso-level
slice - the slice
Returns:
the iso-surface