Class AlgorithmBSmooth

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmBSmooth
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class AlgorithmBSmooth extends AlgorithmBase
Smoothing of VOI using 1 iteration of bSplines. All selected curves in all slices of the voi will be smoothed. The number of interpolated points is user selectable. The user chooses whether or not to trim out nearly collinear points. The user chooses whether or not to remove the original selected curve. If the original curve is not removed, the new curve will have a different color. If the original curve is removed, the new curve will have the same color.
See Also:
  • Field Details

    • activeVOI

      private VOI activeVOI
      The voi selected by the user.
    • nPts

      private int nPts
      Number of interpolation points.
    • resultVOI

      private VOI resultVOI
      The resultant polygon and the evolution has completed.
    • srcImage

      private ModelImage srcImage
      Source image.
    • trim

      private boolean trim
      Trim out nearly collinear points.
    • bSpline

      private AlgorithmBSpline bSpline
  • Constructor Details

    • AlgorithmBSmooth

      public AlgorithmBSmooth()
    • AlgorithmBSmooth

      public AlgorithmBSmooth(ModelImage srcImg, VOI activeVOI, int nPts, boolean trim)
      Creates a new AlgorithmBSmooth object.
      Parameters:
      srcImg - 2D or 3D source image
      activeVOI - the selected voi
      nPts - number of interpolation points
      trim - trim out nearly collinear points
  • Method Details

    • finalize

      public void finalize()
      Prepares this class for destruction.
      Overrides:
      finalize in class AlgorithmBase
    • getResultVOI

      public VOI getResultVOI()
      Accessor that returns a voi that is a smoothed version of the original.
      Returns:
      resultVOI
    • setNPts

      public void setNPts(int nPts)
    • runAlgorithm

      public void runAlgorithm()
      Starts the smooth algorithm.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • calc2D

      private void calc2D()
      Prepares the data and runs the algorithm for a 2D image.
    • calc3D

      private void calc3D()
      Prepares the data and runs the algorithm for a 3D image.
    • runSmooth2

      private void runSmooth2(float[] xPoints, float[] yPoints, float[] zPoints)
      Actual function that smooths the voi with bsplines.
      Parameters:
      xPoints - x coordinates that describe the contour
      yPoints - y coordinates that describe the contour
      resultGon - resultant polygon
    • runSmooth

      public void runSmooth(float[] xPoints, float[] yPoints, float[] zPoints, VOIBase resultContour)
      Actual function that smooths the voi with bsplines.
      Parameters:
      xPoints - x coordinates that describe the contour
      yPoints - y coordinates that describe the contour
      resultGon - resultant polygon
    • setPoints

      public void setPoints(float[] xPoints, float[] yPoints, float[] zPoints, VOIBase contour)
      Takes the polygon and forms two special arrays for use in the Bspline.
      Parameters:
      xPoints - storage location of array of x coord. points
      yPoints - storage location array of y coord. points
      gon - initial polygon
    • setPoints2

      private void setPoints2(float[] xPoints, float[] yPoints, float[] zPoints)
      Takes the polygon and forms two special arrays for use in the Bspline.
      Parameters:
      xPoints - storage location of array of x coord. points
      yPoints - storage location array of y coord. points
      gon - initial polygon
    • getbSplineAlgo

      public AlgorithmBSpline getbSplineAlgo()