Class VOIBase

java.lang.Object
java.util.AbstractCollection<WildMagic.LibFoundation.Mathematics.Vector3f>
java.util.AbstractList<WildMagic.LibFoundation.Mathematics.Vector3f>
java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
gov.nih.mipav.model.structures.VOIBase
All Implemented Interfaces:
Serializable, Cloneable, Iterable<WildMagic.LibFoundation.Mathematics.Vector3f>, Collection<WildMagic.LibFoundation.Mathematics.Vector3f>, List<WildMagic.LibFoundation.Mathematics.Vector3f>, RandomAccess, SequencedCollection<WildMagic.LibFoundation.Mathematics.Vector3f>
Direct Known Subclasses:
VOIContour, VOILine, VOIPoint, VOIPolyLineSlice, VOIProtractor, VOIText

public abstract class VOIBase extends Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
Base which holds the functions common to both Contour, Line and Point type VOI. Abstract class.
Version:
0.1 Jul 22, 1998
Author:
Matthew McAuliffe
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Flag indicating whether or not a VOI is active (selected).
    protected boolean
    Automatically generate the label, unless it is set explicitly:
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    Stores the average of the contour of a VOI.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    Stores the black and white center of mass of the contour of a VOI.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    Stores the blue center of mass of the contour of a VOI.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    Stores the green center of mass of the contour of a VOI.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    Stores the red center of mass of the contour of a VOI.
    static final int
     
    protected boolean
    True when this is a closed contour.
    protected boolean
    displays the voi in the volume renderer:
    private boolean
    If doGeometricCenterLabel = true and if active == false and if closed = true, execute drawGeometricCenterLabel when in drawSelf
    protected static final int
    The down arrow key.
    protected boolean
    Flag that indicates if the VOI is movable.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
    Stores the geometric center of the contour of a VOI.
    protected String
    Label (Name) for this member of the VOI.
    protected int
    Keeps track of the last near point value (for keyboard moving of individual pts.
    protected static final int
    The left arrow key.
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    protected WildMagic.LibFoundation.Mathematics.Vector3f[]
    Current contour bounding-box.
    protected boolean
    True is this is a QuickLUT contour.
    protected boolean
     
    protected boolean
    True is this is a split-line contour.
    protected boolean
    Set to true if the geometric center needs updating.
    protected boolean
    Set to true if the contour bounding-box needs updating.
    protected boolean
    Set to true if the geometric center needs updating.
    protected boolean
    Set to true if the contour changes, so the mask will update when needed.
    protected boolean
    Set to true if the contour plane needs updating.
    protected int
    Anchor point.
    protected int
    Current plane of this contour.
    protected int
    VOI type of this contour.
    protected WildMagic.LibFoundation.Mathematics.ColorRGBA
    Contour color.
    protected WildMagic.LibFoundation.Mathematics.Vector3f
     
    protected VolumeVOI
    Data structure for drawing this contour in the GPU VolumeRenderer
    protected int
    Flag used to indicate if the cursor is near a point on the VOI bounding box.
    protected int
    Flag used to indicate if the cursor is near a point of the VOI member.
    static final int
    If the points on the contour are not on the x,y, or z-plane.
    static final int
    Used in places which usually remember an index into a point vector.
    protected int
    Number of pixels in the array used in graphing intensity along the boundary.
    protected boolean
    If true this flag indicates that the shape should be included (applied) when processing the image.
    protected static final int
    The right arrow key.
    static final int
     
    private static final long
    Use serialVersionUID for interoperability.
    static final int
     
    private int
    initialize subtype to unknown
    static final int
    available subtypes for VOI
    protected static final int
    The up arrow key.
    static final int
     
    static final int
     
    static final int
     
    protected VOI
    Reference to the containing VOI object.
    protected float
    Used to display 3D VOIs in the three orthogonal views of the data in the volume renderer
    static final int
    Used in determining if all points on the contour have the same x-value
    private float[]
     
    static final int
    Used in determining if all points on the contour have the same y-value
    private float[]
     
    static final int
    Used in determining if all points on the contour have the same z-value
    private float[]
     

    Fields inherited from class java.util.Vector

    capacityIncrement, elementCount, elementData

    Fields inherited from class java.util.AbstractList

    modCount
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default Constructor.
    VOIBase(boolean bFixed, boolean bClosed)
    Constructor sets the fixed and closed flags.
    VOIBase(boolean bFixed, boolean bClosed, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kIn)
    Constructor, sets the fixed and closed flags and positions.
    VOIBase(boolean bFixed, boolean bClosed, WildMagic.LibFoundation.Mathematics.Vector3f kIn)
     
    Copies the input VOIBase into a new VOIBase object.
    VOIBase(VOIBase kBase, int iPropDir)
    Copies the input contour and changes it's slice +/-
    VOIBase(VOIBase kBase, TransMatrix tMatrix)
    Copies the input VOIBase, transformed by the input TransMatrix.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addElement(float x, float y, float z)
    Adds a point to the curve.
    void
    addElement(int x, int y, int z)
    Adds a point to the curve.
    double
     
    protected float
    areaTwice(float ptAx, float ptAy, float ptBx, float ptBy, float ptCx, float ptCy)
    Calculates twice the area (cross product of two vectors) of a triangle given three points.
    float
    calcIntensity(ModelImage kImage, int t)
    Calculated the total intensity contained within this contour.
    calcIntensity(ModelImage kImage, WildMagic.LibFoundation.Mathematics.Vector3f kValues, float ignoreMin, float ignoreMax, JPanelPixelExclusionSelector.RangeType rangeFlag)
    Finds values contained within this contour, based on the rangeFlag, ignorMin and ignoreMax.
    float
    calcIntensityThreshold(ModelImage kImage, float threshold, int t)
    Calculates the total intensity contained within this contour, equal to of greater than the threshold.
    float
    calcRGBIntensity(ModelImage kImage, int RGorB)
    Calculates the total intensity contained within this contour for the input color channel.
    Vector<WildMagic.LibFoundation.Mathematics.ColorRGB>
    calcRGBIntensity(ModelImage kImage, WildMagic.LibFoundation.Mathematics.ColorRGB kMin, WildMagic.LibFoundation.Mathematics.ColorRGB kMax, WildMagic.LibFoundation.Mathematics.ColorRGB kSum, float ignoreMinR, float ignoreMaxR, float ignoreMinG, float ignoreMaxG, float ignoreMinB, float ignoreMaxB, JPanelPixelExclusionSelector.RangeType rangeFlag)
    Finds values contained within this contour, based on the rangeFlag, ignoreMinR, ignoreMaxR, ignoreMinG, ignoreMaxG, ignoreMinB, and ignoreMaxB.
    float
    calcRGBIntensityThreshold(ModelImage kImage, int RGorB, float threshold)
    Calculates the total intensity contained within this contour for the input color channel, that is greater than or equal to the input threshold value.
    abstract VOIBase
     
    boolean
    contain(float iX, float iY)
    This is used by SVM boundary training to identify the prostate boundary VOI landmark points.
    boolean
    contains(float iX, float iY)
    Returns true if the input iX, iY is contained within this contour.
    boolean
    contains(float iX, float iY, float iZ)
    Returns true if the input iX,iY,iZ is contained within this contour.
    boolean
    contains(int _x, int _y, boolean forceReload)
     
    private boolean
    containsX(int y, int z)
     
    private boolean
    containsY(int x, int z)
     
    private boolean
    containsZ(int x, int y)
     
    createVolumeVOI(VolumeImage kVolumeImage, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
    Creates the VolumeVOI data structure for rendering this contour in the GPU VolumeRenderer
    void
    cycleActivePt(int keyCode)
    Cycles through the active points on the curve.
    void
    delete(int iPos)
    Deletes the specified position on the curve.
    void
     
    void
    display(boolean show)
    Turns the display setting on/off for the VolumeVOI displayed in the volume renderer.
    void
    Deletes local data members.
    float
    distanceToVOI(int iX, int iY, int iZ)
    Returns the smallest distance from the input point to this contour.
    boolean
     
    void
    exportArrays(float[] x, float[] y, float[] z)
    Exports the float arrays of the points of the curve.
    void
    exportArrays(int[] x, int[] y, int[] z)
    Exports the arrays of the points of the curve in int array format.
    private void
    fill(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax, int iZ, ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
    Helper function for rendering this contour onto the z-plane.
    private void
    fill_X(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iYMin, int iYMax, int iX, ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
    Helper function for rendering this contour onto the x-plane.
    private void
    fill_Y(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax, int iY, ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
    Helper function for rendering this contour onto the y-plane.
    void
    fillVolume(ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
    Renders this contour into the input ModelImage or the input BitSet mask.
    private Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
    fillVolume(BitSet kMask, int xDim, int yDim)
    Renders this contour into the input mask.
    private void
    fillX(int iX, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim)
     
    private void
    fillY(int iY, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim)
     
    private void
    fillZ(int iZ, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim)
     
    int
    findPositionAndCurvature(Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, Vector<Float> curvatures, boolean smoothCurvature, double[] meanCurvature, double[] stdDevCurvature, double[] meanNegativeCurvature, double negativeHysteresisFraction, double positiveHysteresisFraction, int[] numberOfIndentations, int consecutiveNegativeNeeded, double negativeCurvatureNeeded, double[] totalLength)
    Finds the position/curvature along a VOI.
    int
    findPositionAndIntensity(ModelImage kImage, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, Vector<WildMagic.LibFoundation.Mathematics.ColorRGB> colors)
    Finds the position/intensity along a VOI.
    void
    findPositionAndIntensity(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, ModelImage kImage, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, Vector<WildMagic.LibFoundation.Mathematics.ColorRGB> colors)
    Finds the positions and intensities along a line-segment of the VOI.
    int
    findVOIIndentations2D(ModelImage kImage, int sliceNum, Vector<VOIBase> curves, boolean displayIndentations)
     
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets the Vector3f of the active point.
    Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
     
    int
    Returns the anchor point.
    WildMagic.LibFoundation.Mathematics.Vector3f
     
    void
    getBounds(float[] x, float[] y, float[] z)
    Calculates the bounds of the contour.
    void
    getBounds(int[] x, int[] y, int[] z)
    Calculates the bounds of the contour.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets the center of mass of the contour for a given image
    void
    getCenterOfMass(ModelImage kImage, WildMagic.LibFoundation.Mathematics.Vector3f centerPt, int c)
    Gets the center of mass of the contour for the image and color-channel c.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets the blue center of mass of the contour.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets the green center of mass of the contour.
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets the red center of mass of the contour.
    int
    Returns the contour ID: the index of this contour into the VOI.
    boolean
    If doGeometricCenterLabel = true and active == false and closed = true, execute drawGeometricCenterLabel when in drawSelf
    WildMagic.LibFoundation.Mathematics.Vector3f
    Gets the geometric center of the contour.
    WildMagic.LibFoundation.Mathematics.Vector3f
     
    Returns the VOI object that contains this contour.
    WildMagic.LibFoundation.Mathematics.Vector3f[]
    Returns the contour bounding-box.
    Gets the label of the VOI.
    int
    Accessor that returns the number of points used in the most recent intensity calculation of this contour.
    double
    getLengthPtToPt(float[] resolutions)
    Returns the total length of this contour, based on the input resolutions.
    double
    getLengthPtToPt(float[][] resolutions)
    Returns the total length of this contour, based on the input resolutions.
    getLengthString(int iPos0, int iPos1, float[] afResolutions, int[] aiUnits)
    Returns the length of this contour between the two positions along the contour.
    Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
     
    Gets the name of the VOI that contains this contour, null if this contour is not contained in a VOI.
    int
     
    int
    Returns the point on the curve nearest the cursor, calculated by nearLine, etc.
    int
     
    int
    Determines if the points on the contour lie on either the x,y,or z-planes.
    boolean
    Accessor that returns the process.
    int
    Returns the last selected point.
    int
     
    getTotalLengthString(float[] afResolutions, int[] aiUnits)
    Returns the total length of this contour as a string.
    int
    Returns the type of this contour.
    float
     
    Returns the VolumeVOI data member used to draw this contour in the GPU VOlumeRenderer.
    void
    importArrays(float[] x, float[] y, float[] z, int n)
    Imports new position values into this contour.
    void
    importArrays(int[] x, int[] y, int[] z, int n)
    Imports new position values into this contour.
    void
    importPoints(WildMagic.LibFoundation.Mathematics.Vector3f[] pt)
    Imports new position values into this contour.
    boolean
    Accessor to flag that indicates if an VOI is active.
    boolean
    Flag used to indicate type of contour: true = closed contour (i.e.
    boolean
    Accessor to flag that indicates if an VOI is fixed (movable).
    boolean
     
    boolean
     
    boolean
    Returns true if this is a QuickLUT contour.
    boolean
    Returns true if this is a split-line contour.
    boolean
    nearLine(int iX, int iY, int iZ)
    Returns true if the input position is near the outline of this contour.
    boolean
    nearLine(int iX, int iY, int iZ, int tol)
    Returns true if the input position is near the outline of this contour.
    private void
    outlineRegion(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax)
    Helper function computes the set of spans indicated by column crossings for rendering this contour into the z-plane.
    private void
    outlineRegion_X(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iYMin, int iYMax)
    Helper function computes the set of spans indicated by column crossings for rendering this contour into the x-plane.
    private void
    outlineRegion_Y(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax)
    Helper function computes the set of spans indicated by column crossings for rendering this contour into the y-plane.
    WildMagic.LibFoundation.Mathematics.Plane3f
    Fits a plane to the points in this contour and returns the plane.
    void
    Reloads points in this array for speed purposes.
    void
    setActive(boolean active)
    Sets flag to indicate whether or not VOI is active.
    void
    Sets the anchor point.
    void
    setClosed(boolean bClosed)
    Sets this contour as open or closed.
    void
    setDoGeometricCenterLabel(boolean doGeometricCenterLabel)
    If doGeometricCenterLabel = true and active == false and closed = true, execute drawGeometricCenterLabel when in drawSelf
    void
    setFixed(boolean fixed)
    Sets flag to indicate whether or not VOI is fixed.
    void
    setGroup(VOI kGroup)
    Sets the VOI object that contains this contour.
    void
    Sets the label of the VOI.
    void
    setMask(BitSet kMask, int xDim, int yDim, boolean XOR, int polarity)
     
    void
    setMaskSlice(BitSet kMask, int xDim, boolean XOR, int polarity)
     
    void
    Sets the near boundary point.
    void
    setNearPoint(int i)
    Sets the near point.
    void
    setPlane(int iPlane)
     
    void
    setProcess(boolean process)
    Sets whether the shape is included in processing.
    void
    setQuickLUT(boolean bQuickLUT)
    Sets the QuickLUT flag.
    void
    Sets the selected point.
    void
    setSplit(boolean bSplit)
    Sets the split flag.
    void
    setSubtype(int subtype)
     
    void
    setVOIIntensities(ModelImage kImage, double newValue, int t)
     
    void
    setVOIIntensities(ModelImage kImage, Vector<Double> newValue, int t)
     
    void
    setVolumeDisplayRange(float range)
     
    int
    Returns the slice value of the contour on every plane.
    int
    slice(int iPlane)
    Returns the point value the contour has in common if it lies in the given plane.
    private static void
    sortCrossingPoints(float[] aiList, int iNumElements)
    Sorts the edge crossing points in place.
    void
    Copies the input VOIBase, transformed by the input TransMatrix.
    void
    trimPoints(double constraint, boolean tFlag)
    Trims a contour and then removes collinear points in the resulting contour.
    void
    The contour has changed, set the update flags so statistics are recalculated when needed.
    void
    update(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
    Set the color of this contour.
    void
    update(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
    The contour has been translated, this function translates the geometric center and bounding-box so they don't need to be recalculated.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, stream, toArray

    Methods inherited from interface java.util.List

    addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • XPLANE

      public static final int XPLANE
      Used in determining if all points on the contour have the same x-value
      See Also:
    • YPLANE

      public static final int YPLANE
      Used in determining if all points on the contour have the same y-value
      See Also:
    • ZPLANE

      public static final int ZPLANE
      Used in determining if all points on the contour have the same z-value
      See Also:
    • NOT_A_PLANE

      public static final int NOT_A_PLANE
      If the points on the contour are not on the x,y, or z-plane.
      See Also:
    • UPPER_LEFT

      public static final int UPPER_LEFT
      See Also:
    • UPPER_RIGHT

      public static final int UPPER_RIGHT
      See Also:
    • LOWER_LEFT

      public static final int LOWER_LEFT
      See Also:
    • LOWER_RIGHT

      public static final int LOWER_RIGHT
      See Also:
    • UPPER_MIDDLE

      public static final int UPPER_MIDDLE
      See Also:
    • LEFT_MIDDLE

      public static final int LEFT_MIDDLE
      See Also:
    • RIGHT_MIDDLE

      public static final int RIGHT_MIDDLE
      See Also:
    • LOWER_MIDDLE

      public static final int LOWER_MIDDLE
      See Also:
    • NOT_A_POINT

      public static final int NOT_A_POINT
      Used in places which usually remember an index into a point vector. Indicates that the index should not be used.
      See Also:
    • UP

      protected static final int UP
      The up arrow key.
      See Also:
    • LEFT

      protected static final int LEFT
      The left arrow key.
      See Also:
    • DOWN

      protected static final int DOWN
      The down arrow key.
      See Also:
    • active

      protected boolean active
      Flag indicating whether or not a VOI is active (selected). If the VOI is selected then the flag is true else it is false
    • gcPt

      protected WildMagic.LibFoundation.Mathematics.Vector3f gcPt
      Stores the geometric center of the contour of a VOI.
    • averagePt

      protected WildMagic.LibFoundation.Mathematics.Vector3f averagePt
      Stores the average of the contour of a VOI.
    • cenMassPt

      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPt
      Stores the black and white center of mass of the contour of a VOI.
    • cenMassPtR

      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtR
      Stores the red center of mass of the contour of a VOI.
    • cenMassPtG

      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtG
      Stores the green center of mass of the contour of a VOI.
    • cenMassPtB

      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtB
      Stores the blue center of mass of the contour of a VOI.
    • fixed

      protected boolean fixed
      Flag that indicates if the VOI is movable.
    • label

      protected String label
      Label (Name) for this member of the VOI.
    • autoLabel

      protected boolean autoLabel
      Automatically generate the label, unless it is set explicitly:
    • lastPoint

      protected int lastPoint
      Keeps track of the last near point value (for keyboard moving of individual pts.
    • nearPoint

      protected int nearPoint
      Flag used to indicate if the cursor is near a point of the VOI member.
    • nearBoundPoint

      protected int nearBoundPoint
      Flag used to indicate if the cursor is near a point on the VOI bounding box.
    • voiGroup

      protected VOI voiGroup
      Reference to the containing VOI object.
    • process

      protected boolean process
      If true this flag indicates that the shape should be included (applied) when processing the image. It is possible that an individual contour may not be set for processing, while a VOI may be processed.
    • doGeometricCenterLabel

      private boolean doGeometricCenterLabel
      If doGeometricCenterLabel = true and if active == false and if closed = true, execute drawGeometricCenterLabel when in drawSelf
    • m_bUpdateMask

      protected boolean m_bUpdateMask
      Set to true if the contour changes, so the mask will update when needed.
    • m_bUpdateBounds

      protected boolean m_bUpdateBounds
      Set to true if the contour bounding-box needs updating.
    • m_bUpdateGeometricCenter

      protected boolean m_bUpdateGeometricCenter
      Set to true if the geometric center needs updating.
    • m_bUpdateAverage

      protected boolean m_bUpdateAverage
      Set to true if the geometric center needs updating.
    • m_bReloadPoints

      protected boolean m_bReloadPoints
    • m_bUpdatePlane

      protected boolean m_bUpdatePlane
      Set to true if the contour plane needs updating.
    • m_iVOIType

      protected int m_iVOIType
      VOI type of this contour.
    • m_iAnchorIndex

      protected int m_iAnchorIndex
      Anchor point.
    • closed

      protected boolean closed
      True when this is a closed contour.
    • m_bSplit

      protected boolean m_bSplit
      True is this is a split-line contour.
    • m_bQuickLUT

      protected boolean m_bQuickLUT
      True is this is a QuickLUT contour.
    • m_iPlane

      protected int m_iPlane
      Current plane of this contour.
    • m_akImageMinMax

      protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akImageMinMax
      Current contour bounding-box.
    • m_kColor

      protected WildMagic.LibFoundation.Mathematics.ColorRGBA m_kColor
      Contour color.
    • m_kVolumeVOI

      protected transient VolumeVOI m_kVolumeVOI
      Data structure for drawing this contour in the GPU VolumeRenderer
    • volumeDisplayRange

      protected float volumeDisplayRange
      Used to display 3D VOIs in the three orthogonal views of the data in the volume renderer
    • numPixels

      protected int numPixels
      Number of pixels in the array used in graphing intensity along the boundary.
    • m_kPositionSum

      protected WildMagic.LibFoundation.Mathematics.Vector3f m_kPositionSum
    • UNKNOWN_SUBTYPE

      public static final int UNKNOWN_SUBTYPE
      available subtypes for VOI
      See Also:
    • CIRCLE

      public static final int CIRCLE
      See Also:
    • SQUARE

      public static final int SQUARE
      See Also:
    • subtype

      private int subtype
      initialize subtype to unknown
    • display

      protected boolean display
      displays the voi in the volume renderer:
    • xPts

      private float[] xPts
    • yPts

      private float[] yPts
    • zPts

      private float[] zPts
  • Constructor Details

    • VOIBase

      public VOIBase()
      Default Constructor. Initializes the Vectorinvalid input: '<'> : start and the amount to increment the vector by.,
    • VOIBase

      public VOIBase(boolean bFixed, boolean bClosed)
      Constructor sets the fixed and closed flags.
      Parameters:
      bFixed - true if this contour cannot be changed.
      bClosed - true if this contour is closed.
    • VOIBase

      public VOIBase(boolean bFixed, boolean bClosed, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kIn)
      Constructor, sets the fixed and closed flags and positions.
      Parameters:
      bFixed - true if this contour cannot be changed.
      bClosed - true if this contour is closed.
      kIn - positions.
    • VOIBase

      public VOIBase(boolean bFixed, boolean bClosed, WildMagic.LibFoundation.Mathematics.Vector3f kIn)
    • VOIBase

      public VOIBase(VOIBase kBase)
      Copies the input VOIBase into a new VOIBase object.
      Parameters:
      kBase -
    • VOIBase

      public VOIBase(VOIBase kBase, int iPropDir)
      Copies the input contour and changes it's slice +/-
      Parameters:
      kBase -
      iPropDir -
    • VOIBase

      public VOIBase(VOIBase kBase, TransMatrix tMatrix)
      Copies the input VOIBase, transformed by the input TransMatrix.
      Parameters:
      kBase - VOI to copy.
      tMatrix - transformation
  • Method Details

    • sortCrossingPoints

      private static void sortCrossingPoints(float[] aiList, int iNumElements)
      Sorts the edge crossing points in place.
      Parameters:
      aiList - list of positions
      iNumElements - number of positions.
    • addElement

      public void addElement(float x, float y, float z)
      Adds a point to the curve.
      Parameters:
      x - x coordinate of point
      y - y coordinate of point
      z - z coordinate of point
    • addElement

      public void addElement(int x, int y, int z)
      Adds a point to the curve.
      Parameters:
      x - x coordinate of point
      y - y coordinate of point
      z - z coordinate of point
    • area

      public double area()
    • calcIntensity

      public float calcIntensity(ModelImage kImage, int t)
      Calculated the total intensity contained within this contour.
      Parameters:
      kImage -
      Returns:
      total intensity.
    • setVOIIntensities

      public void setVOIIntensities(ModelImage kImage, Vector<Double> newValue, int t)
    • setVOIIntensities

      public void setVOIIntensities(ModelImage kImage, double newValue, int t)
    • calcIntensity

      public Vector<Float> calcIntensity(ModelImage kImage, WildMagic.LibFoundation.Mathematics.Vector3f kValues, float ignoreMin, float ignoreMax, JPanelPixelExclusionSelector.RangeType rangeFlag)
      Finds values contained within this contour, based on the rangeFlag, ignorMin and ignoreMax.
      Parameters:
      kImage - input image.
      ignoreMin - intensity minimum.
      ignoreMax - intensity maximum.
      rangeFlag - flag indicating (between, outside, none).
      Returns:
      list of values inside this contour that fit the parameters.
    • calcIntensityThreshold

      public float calcIntensityThreshold(ModelImage kImage, float threshold, int t)
      Calculates the total intensity contained within this contour, equal to of greater than the threshold.
      Parameters:
      kImage - input image
      threshold -
      Returns:
      total intensity of image contained within this contour, greater than threshold.
    • calcRGBIntensity

      public Vector<WildMagic.LibFoundation.Mathematics.ColorRGB> calcRGBIntensity(ModelImage kImage, WildMagic.LibFoundation.Mathematics.ColorRGB kMin, WildMagic.LibFoundation.Mathematics.ColorRGB kMax, WildMagic.LibFoundation.Mathematics.ColorRGB kSum, float ignoreMinR, float ignoreMaxR, float ignoreMinG, float ignoreMaxG, float ignoreMinB, float ignoreMaxB, JPanelPixelExclusionSelector.RangeType rangeFlag)
      Finds values contained within this contour, based on the rangeFlag, ignoreMinR, ignoreMaxR, ignoreMinG, ignoreMaxG, ignoreMinB, and ignoreMaxB.
      Parameters:
      kImage - input image.
      kMin - .
      kMax - .
      kSum - .
      ignoreMinR - intensity minimum red.
      ignoreMaxR - intensity maximum red.
      ignoreMinG - intensity minimum green.
      ignoreMaxG - intensity maximum green.
      ignoreMinB - intensity minimum blue.
      ignoreMaxB - intensity maximum blue.
      rangeFlag - flag indicating (between, outside, none).
      Returns:
      list of values inside this contour that fit the parameters.
    • calcRGBIntensity

      public float calcRGBIntensity(ModelImage kImage, int RGorB)
      Calculates the total intensity contained within this contour for the input color channel.
      Parameters:
      kImage -
      RGorB - (Red = 0; Green = 1; Blue = 2)
      Returns:
      total intensity contained within this contour, for the input image and color channel.
    • calcRGBIntensityThreshold

      public float calcRGBIntensityThreshold(ModelImage kImage, int RGorB, float threshold)
      Calculates the total intensity contained within this contour for the input color channel, that is greater than or equal to the input threshold value.
      Parameters:
      kImage -
      RGorB - (Red = 0; Green = 1; Blue = 2)
      threshold -
      Returns:
      total intensity greater than the threshold contained within this contour, for the input image and color channel.
    • clone

      public abstract VOIBase clone()
      Overrides:
      clone in class Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
    • contains

      public boolean contains(float iX, float iY)
      Returns true if the input iX, iY is contained within this contour. The z-value of the contour is ignored.
      Parameters:
      iX -
      iY -
      Returns:
    • contain

      public boolean contain(float iX, float iY)
      This is used by SVM boundary training to identify the prostate boundary VOI landmark points.
      Parameters:
      iX -
      iY -
      Returns:
    • contains

      public boolean contains(float iX, float iY, float iZ)
      Returns true if the input iX,iY,iZ is contained within this contour.
      Parameters:
      iX -
      iY -
      iZ -
      Returns:
    • contains

      public boolean contains(int _x, int _y, boolean forceReload)
    • createVolumeVOI

      public VolumeVOI createVolumeVOI(VolumeImage kVolumeImage, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
      Creates the VolumeVOI data structure for rendering this contour in the GPU VolumeRenderer
      Parameters:
      kVolumeImage -
      kTranslate -
      Returns:
      VolumeVOI
    • display

      public void display(boolean show)
      Turns the display setting on/off for the VolumeVOI displayed in the volume renderer.
      Parameters:
      show -
    • cycleActivePt

      public void cycleActivePt(int keyCode)
      Cycles through the active points on the curve.
      Parameters:
      keyCode - int arrow key (up/down/left/right)
    • delete

      public void delete(int iPos)
      Deletes the specified position on the curve.
      Parameters:
      iPos - position on the curve to delete.
    • dispose

      public void dispose()
      Deletes local data members.
    • distanceToVOI

      public float distanceToVOI(int iX, int iY, int iZ)
      Returns the smallest distance from the input point to this contour.
      Parameters:
      iX - input x-position
      iY - input y-position
      iZ - input z-position
      Returns:
      smallest distance from the input to the contour.
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<WildMagic.LibFoundation.Mathematics.Vector3f>
      Specified by:
      equals in interface List<WildMagic.LibFoundation.Mathematics.Vector3f>
      Overrides:
      equals in class Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
    • exportArrays

      public void exportArrays(float[] x, float[] y, float[] z)
      Exports the float arrays of the points of the curve.
      Parameters:
      x - array of x coordinates
      y - array of y coordinates
      z - array of z coordinates
    • exportArrays

      public void exportArrays(int[] x, int[] y, int[] z)
      Exports the arrays of the points of the curve in int array format.
      Parameters:
      x - array of x coordinates
      y - array of y coordinates
      z - array of z coordinates
    • fillVolume

      public void fillVolume(ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
      Renders this contour into the input ModelImage or the input BitSet mask.
      Parameters:
      kVolume - if non-null this contour is rendered into the ModelImage.
      kMask - if non-null this contour is rendered into the mask.
      bIntersection - when true the contour rendered as an intersection with other contours.
      iValue - value to write into the input image.
    • findVOIIndentations2D

      public int findVOIIndentations2D(ModelImage kImage, int sliceNum, Vector<VOIBase> curves, boolean displayIndentations)
    • findPositionAndCurvature

      public int findPositionAndCurvature(Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, Vector<Float> curvatures, boolean smoothCurvature, double[] meanCurvature, double[] stdDevCurvature, double[] meanNegativeCurvature, double negativeHysteresisFraction, double positiveHysteresisFraction, int[] numberOfIndentations, int consecutiveNegativeNeeded, double negativeCurvatureNeeded, double[] totalLength)
      Finds the position/curvature along a VOI. To fill in missing samples requires smoothing spline interpolation.
      Parameters:
      positions - Vector that is filled with the distance along the VOI in millimeters for example
      curvatures - the corresponding curvature along the contour
      meanCurvature -
      stdDevCurvature -
      meanNegativeCurvature -
      negativeHysteresisFraction -
      positiveHysteresisFraction -
      numberOfIndentations -
      consecutiveNegativeNeeded -
      negativeCurvatureNeeded -
      smooth - if true smooth before finding curvature
      Returns:
      the number of points in the position and curvature array that have valid data.
    • findPositionAndIntensity

      public int findPositionAndIntensity(ModelImage kImage, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, Vector<WildMagic.LibFoundation.Mathematics.ColorRGB> colors)
      Finds the position/intensity along a VOI.
      Parameters:
      positions - Vector that is filled with the distance along the VOI in millimeters for example
      colors - the corresponding intensities along the line
      Returns:
      the number of points in the position and intensity array that have valid data.
    • findPositionAndIntensity

      public void findPositionAndIntensity(WildMagic.LibFoundation.Mathematics.Vector3f kStart, WildMagic.LibFoundation.Mathematics.Vector3f kEnd, ModelImage kImage, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, Vector<WildMagic.LibFoundation.Mathematics.ColorRGB> colors)
      Finds the positions and intensities along a line-segment of the VOI.
      Parameters:
      kStart - start position on the VOI.
      kEnd - end position on the VOI
      kImage - input image to read intensity values from
      positions - output list of positions
      colors - output list of colors.
    • getActivePt

      public WildMagic.LibFoundation.Mathematics.Vector3f getActivePt()
      Gets the Vector3f of the active point.
      Returns:
      Vector3f the active point's Vector3f
    • getAnchor

      public int getAnchor()
      Returns the anchor point.
      Returns:
    • getAverage

      public WildMagic.LibFoundation.Mathematics.Vector3f getAverage()
    • getBounds

      public void getBounds(float[] x, float[] y, float[] z)
      Calculates the bounds of the contour.
      Parameters:
      x - two element array where x[0] = min extent of the Contour and x[1] = max extent of the Contour in the x dimension
      y - two element array where y[0] = min extent of the Contour and y[1] = max extent of the Contour in the y dimension
      z - two element array where z[0] = min extent of the Contour and z[1] = max extent of the Contour in the z dimension
    • getBounds

      public void getBounds(int[] x, int[] y, int[] z)
      Calculates the bounds of the contour.
      Parameters:
      x - two element array where x[0] = min extent of the Contour and x[1] = max extent of the Contour in the x dimension
      y - two element array where y[0] = min extent of the Contour and y[1] = max extent of the Contour in the y dimension
      z - two element array where z[0] = min extent of the Contour and z[1] = max extent of the Contour in the z dimension
    • getCenterOfMass

      public WildMagic.LibFoundation.Mathematics.Vector3f getCenterOfMass(ModelImage kImage)
      Gets the center of mass of the contour for a given image
      Parameters:
      kImage - input image.
      Returns:
      center of mass for this contour and the input image.
    • getCenterOfMass

      public void getCenterOfMass(ModelImage kImage, WildMagic.LibFoundation.Mathematics.Vector3f centerPt, int c)
      Gets the center of mass of the contour for the image and color-channel c.
      Parameters:
      kImage - input image.
      centerPt - output point.
      c - color channel.
    • getCenterOfMassB

      public WildMagic.LibFoundation.Mathematics.Vector3f getCenterOfMassB(ModelImage kImage)
      Gets the blue center of mass of the contour.
      Parameters:
      kImage - input image.
      Returns:
      returns the center of mass
    • getCenterOfMassG

      public WildMagic.LibFoundation.Mathematics.Vector3f getCenterOfMassG(ModelImage kImage)
      Gets the green center of mass of the contour.
      Parameters:
      kImage - input image.
      Returns:
      returns the center of mass
    • getCenterOfMassR

      public WildMagic.LibFoundation.Mathematics.Vector3f getCenterOfMassR(ModelImage kImage)
      Gets the red center of mass of the contour.
      Parameters:
      kImage - input image.
      Returns:
      returns the center of mass
    • getContourID

      public int getContourID()
      Returns the contour ID: the index of this contour into the VOI.
      Returns:
      contour ID, or -1 if this contour is not contained in a VOI.
    • getDoGeometricCenterLabel

      public boolean getDoGeometricCenterLabel()
      If doGeometricCenterLabel = true and active == false and closed = true, execute drawGeometricCenterLabel when in drawSelf
      Returns:
      doGeometricCenterLabel
    • getGeometricCenter

      public WildMagic.LibFoundation.Mathematics.Vector3f getGeometricCenter()
      Gets the geometric center of the contour.
      Returns:
      returns the geometric center
    • getGeometricCenterA

      public WildMagic.LibFoundation.Mathematics.Vector3f getGeometricCenterA()
    • getGroup

      public VOI getGroup()
      Returns the VOI object that contains this contour.
      Returns:
      the VOI object that contains this contour.
    • getImageBoundingBox

      public WildMagic.LibFoundation.Mathematics.Vector3f[] getImageBoundingBox()
      Returns the contour bounding-box.
      Returns:
      Vector3f[] with the bounding-box minimum in [0] and the maximum in [1].
    • getLabel

      public String getLabel()
      Gets the label of the VOI.
      Returns:
      label as a String
    • getLastNumPixels

      public int getLastNumPixels()
      Accessor that returns the number of points used in the most recent intensity calculation of this contour.
      Returns:
      the number of points used in the most recent intensity calculation
    • getLengthPtToPt

      public double getLengthPtToPt(float[] resolutions)
      Returns the total length of this contour, based on the input resolutions.
      Parameters:
      resolutions - .
      Returns:
      total length of this contour, scaled by the resolutions.
    • getLengthPtToPt

      public double getLengthPtToPt(float[][] resolutions)
      Returns the total length of this contour, based on the input resolutions.
      Parameters:
      resolutions - .
      Returns:
      total length of this contour, scaled by the resolutions.
    • getLengthString

      public String getLengthString(int iPos0, int iPos1, float[] afResolutions, int[] aiUnits)
      Returns the length of this contour between the two positions along the contour. Based on the input resolutions and units.
      Parameters:
      iPos0 - first position on this contour.
      iPos1 - second position on this contour.
      afResolutions - resolutions.
      aiUnits - units.
      Returns:
      String with the length and units labeled.
    • getAllContourPoints

      public Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getAllContourPoints()
    • getMaskPositions

      public Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getMaskPositions()
    • getName

      public String getName()
      Gets the name of the VOI that contains this contour, null if this contour is not contained in a VOI.
      Returns:
      String
    • getNearBoundPoint

      public int getNearBoundPoint()
    • getNearPoint

      public int getNearPoint()
      Returns the point on the curve nearest the cursor, calculated by nearLine, etc.
      Returns:
      point on the curve nearest the cursor.
    • getNumVoxels

      public int getNumVoxels()
    • getPlane

      public int getPlane()
      Determines if the points on the contour lie on either the x,y,or z-planes. Or not on any plane.
      Returns:
      XPLANE, YPLANE, ZPLANE or NOT_A_PLANE.
    • getProcess

      public boolean getProcess()
      Accessor that returns the process.
      Returns:
      the process
    • getSelectedPoint

      public int getSelectedPoint()
      Returns the last selected point.
      Returns:
    • getSubtype

      public int getSubtype()
    • getTotalLengthString

      public String getTotalLengthString(float[] afResolutions, int[] aiUnits)
      Returns the total length of this contour as a string. Based on the input resolutions and units.
      Parameters:
      afResolutions -
      aiUnits -
      Returns:
      String with the length and units labeled.
    • getType

      public int getType()
      Returns the type of this contour.
      Returns:
      type of this contour.
    • deleteVolumeVOI

      public void deleteVolumeVOI()
    • getVolumeVOI

      public VolumeVOI getVolumeVOI()
      Returns the VolumeVOI data member used to draw this contour in the GPU VOlumeRenderer.
      Returns:
      VolumeVOI for rendering this contour in the GPU VolumeRenderer.
    • importArrays

      public void importArrays(float[] x, float[] y, float[] z, int n)
      Imports new position values into this contour.
      Parameters:
      x - array of x-positions.
      y - array of y-positions.
      z - array of z-positions.
      n - number of values.
    • importArrays

      public void importArrays(int[] x, int[] y, int[] z, int n)
      Imports new position values into this contour.
      Parameters:
      x - array of x-positions.
      y - array of y-positions.
      z - array of z-positions.
      n - number of values.
    • importPoints

      public void importPoints(WildMagic.LibFoundation.Mathematics.Vector3f[] pt)
      Imports new position values into this contour.
      Parameters:
      pt - array of points to import into this contour.
    • isActive

      public boolean isActive()
      Accessor to flag that indicates if an VOI is active.
      Returns:
      flag indicating if an VOI is active
    • isClosed

      public boolean isClosed()
      Flag used to indicate type of contour: true = closed contour (i.e. contour end points are connected) false = open contour
      Returns:
      flag whether the voi contour is closed.
    • isFixed

      public boolean isFixed()
      Accessor to flag that indicates if an VOI is fixed (movable).
      Returns:
      flag indicating if an VOI is fixed
    • isM_bUpdateBounds

      public boolean isM_bUpdateBounds()
    • isM_bUpdateGeometricCenter

      public boolean isM_bUpdateGeometricCenter()
    • isQuickLUT

      public boolean isQuickLUT()
      Returns true if this is a QuickLUT contour.
      Returns:
    • isSplit

      public boolean isSplit()
      Returns true if this is a split-line contour.
      Returns:
    • nearLine

      public boolean nearLine(int iX, int iY, int iZ)
      Returns true if the input position is near the outline of this contour.
      Parameters:
      iX - input x-position.
      iY - input y-position.
      iZ - input z-position
      Returns:
      true if the input position is 'near' the outline of this contour.
    • nearLine

      public boolean nearLine(int iX, int iY, int iZ, int tol)
      Returns true if the input position is near the outline of this contour. Based on the input tolerance.
      Parameters:
      iX - input x-position.
      iY - input y-position.
      iZ - input z-position
      tol - tolerance value for determining if the position is near this contour.
      Returns:
      true if the input position is 'near' the outline of this contour.
    • planeFit

      public WildMagic.LibFoundation.Mathematics.Plane3f planeFit()
      Fits a plane to the points in this contour and returns the plane.
      Returns:
    • reloadPoints

      public void reloadPoints()
      Reloads points in this array for speed purposes.
    • setActive

      public void setActive(boolean active)
      Sets flag to indicate whether or not VOI is active.
      Parameters:
      active - flag sets the activity status of a flag
    • setAnchor

      public void setAnchor()
      Sets the anchor point.
    • setClosed

      public void setClosed(boolean bClosed)
      Sets this contour as open or closed.
      Parameters:
      bClosed -
    • setDoGeometricCenterLabel

      public void setDoGeometricCenterLabel(boolean doGeometricCenterLabel)
      If doGeometricCenterLabel = true and active == false and closed = true, execute drawGeometricCenterLabel when in drawSelf
      Parameters:
      doGeometricCenterLabel -
    • setFixed

      public void setFixed(boolean fixed)
      Sets flag to indicate whether or not VOI is fixed.
      Parameters:
      fixed - flag sets the fixed status of a flag
    • setGroup

      public void setGroup(VOI kGroup)
      Sets the VOI object that contains this contour.
      Parameters:
      kGroup - VOI container for this contour.
    • setLabel

      public void setLabel(String str)
      Sets the label of the VOI.
      Parameters:
      str - the label
    • setMask

      public void setMask(BitSet kMask, int xDim, int yDim, boolean XOR, int polarity)
    • setMaskSlice

      public void setMaskSlice(BitSet kMask, int xDim, boolean XOR, int polarity)
    • setNearBoundPoint

      public void setNearBoundPoint(int i)
      Sets the near boundary point.
      Parameters:
      i -
    • setNearPoint

      public void setNearPoint(int i)
      Sets the near point.
      Parameters:
      i -
    • setPlane

      public void setPlane(int iPlane)
    • setProcess

      public void setProcess(boolean process)
      Sets whether the shape is included in processing.
      Parameters:
      flag - the process flag
    • setQuickLUT

      public void setQuickLUT(boolean bQuickLUT)
      Sets the QuickLUT flag.
      Parameters:
      bQuickLUT -
    • setSelectedPoint

      public void setSelectedPoint(int i)
      Sets the selected point.
      Parameters:
      i -
    • setSplit

      public void setSplit(boolean bSplit)
      Sets the split flag.
      Parameters:
      bSplit -
    • setSubtype

      public void setSubtype(int subtype)
    • getVolumeDisplayRange

      public float getVolumeDisplayRange()
    • setVolumeDisplayRange

      public void setVolumeDisplayRange(float range)
    • slice

      public int slice()
      Returns the slice value of the contour on every plane. If the contour does not exist on the x-plane, returns its value on the y-plane. If the contour does not exist on the y-plane, returns its value on the z-plane. Use slice(int iPlane) for a more reliable value.
      Returns:
    • slice

      public int slice(int iPlane)
      Returns the point value the contour has in common if it lies in the given plane. If the contour does not exist on the given plane, -1 is returned.
      Returns:
    • transform

      public void transform(TransMatrix tMatrix)
      Copies the input VOIBase, transformed by the input TransMatrix.
      Parameters:
      tMatrix - transformation
      kBase - VOI to copy.
    • trimPoints

      public void trimPoints(double constraint, boolean tFlag)
      Trims a contour and then removes collinear points in the resulting contour. If the perpendicular distance from the middle point to the line defined by the 1st and 3rd point is small than the middle point is removed.
      Parameters:
      constraint - factor that controls the number of points removed. A larger constraint removes more points 0.50 typical - removes most "almost/and collinear" points 0.00 - removes only "collinear" points
      tFlag - if true, trim collinear points
    • update

      public void update()
      The contour has changed, set the update flags so statistics are recalculated when needed.
    • update

      public void update(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
      Set the color of this contour.
      Parameters:
      kColor - new color for this contour.
    • update

      public void update(WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
      The contour has been translated, this function translates the geometric center and bounding-box so they don't need to be recalculated.
      Parameters:
      kTranslate - amount by which the contour was translated.
    • containsX

      private boolean containsX(int y, int z)
    • containsY

      private boolean containsY(int x, int z)
    • containsZ

      private boolean containsZ(int x, int y)
    • fill

      private void fill(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax, int iZ, ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
      Helper function for rendering this contour onto the z-plane. Pixels are determined to be inside or outside the contour based on the parameters, aaiCrossingPoints and aiNumCrossings, using a scan-conversion algorithm that traverses each row and column of the bounding box of the sculpt region coloring inside points as it goes.
      Parameters:
      aaiCrossingPoints - column crossing points.
      aiNumCrossings - number of crossing points per row.
      iXMin - contour bounding box x-minimum.
      iXMax - contour bounding box x-maximum.
      iZ - z-plane slice to render into.
      kVolume - output: when non-null this contour is rendered into the input image.
      kMask - output: when non-null this contour is rendered into the input BitSet mask.
      bIntersection - when true the contour rendered as an intersection with other contours.
      iValue - value to write into the input image.
      iYMin - contour bounding box y-minimum.
      iYMax - contour bounding box y-maximum.
    • fill_X

      private void fill_X(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iYMin, int iYMax, int iX, ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
      Helper function for rendering this contour onto the x-plane. Pixels are determined to be inside or outside the contour based on the parameters, aaiCrossingPoints and aiNumCrossings, using a scan-conversion algorithm that traverses each row and column of the bounding box of the sculpt region coloring inside points as it goes.
      Parameters:
      aaiCrossingPoints - column crossing points.
      aiNumCrossings - number of crossing points per row.
      iYMin - contour bounding box y-minimum.
      iYMax - contour bounding box y-maximum.
      iX - x-plane slice to render into.
      kVolume - output: when non-null this contour is rendered into the input image.
      kMask - output: when non-null this contour is rendered into the input BitSet mask.
      bIntersection - when true the contour rendered as an intersection with other contours.
      iValue - value to write into the input image.
      iZMin - contour bounding box z-minimum.
      iZMax - contour bounding box z-maximum.
    • fill_Y

      private void fill_Y(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax, int iY, ModelImage kVolume, BitSet kMask, boolean bIntersection, int iValue)
      Helper function for rendering this contour onto the y-plane. Pixels are determined to be inside or outside the contour based on the parameters, aaiCrossingPoints and aiNumCrossings, using a scan-conversion algorithm that traverses each row and column of the bounding box of the sculpt region coloring inside points as it goes.
      Parameters:
      aaiCrossingPoints - column crossing points.
      aiNumCrossings - number of crossing points per row.
      iXMin - contour bounding box x-minimum.
      iXMax - contour bounding box x-maximum.
      iY - y-plane slice to render into.
      kVolume - output: when non-null this contour is rendered into the input image.
      kMask - output: when non-null this contour is rendered into the input BitSet mask.
      bIntersection - when true the contour rendered as an intersection with other contours.
      iValue - value to write into the input image.
      iZMin - contour bounding box z-minimum.
      iZMax - contour bounding box z-maximum.
    • fillVolume

      private Vector<WildMagic.LibFoundation.Mathematics.Vector3f> fillVolume(BitSet kMask, int xDim, int yDim)
      Renders this contour into the input mask.
      Parameters:
      kMask - input mask.
      xDim - x-dimensions of the input mask.
      yDim - y-dimension of the input mask.
    • fillX

      private void fillX(int iX, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim)
    • fillY

      private void fillY(int iY, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim)
    • fillZ

      private void fillZ(int iZ, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim)
    • outlineRegion

      private void outlineRegion(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax)
      Helper function computes the set of spans indicated by column crossings for rendering this contour into the z-plane.
      Parameters:
      aaiCrossingPoints - output: x-values that the contour crosses
      aiNumCrossings - output: number of crossing points per row.
      iXMin - the minimum x-value of this contour.
      iXMax - the maximum x-value of this contour.
    • outlineRegion_X

      private void outlineRegion_X(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iYMin, int iYMax)
      Helper function computes the set of spans indicated by column crossings for rendering this contour into the x-plane.
      Parameters:
      aaiCrossingPoints - output: z-values that the contour crosses
      aiNumCrossings - output: number of crossing points per row.
      iXMin - the minimum y-value of this contour.
      iXMax - the maximum y-value of this contour.
    • outlineRegion_Y

      private void outlineRegion_Y(float[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iXMax)
      Helper function computes the set of spans indicated by column crossings for rendering this contour into the y-plane.
      Parameters:
      aaiCrossingPoints - output: z-values that the contour crosses
      aiNumCrossings - output: number of crossing points per row.
      iXMin - the minimum x-value of this contour.
      iXMax - the maximum x-value of this contour.
    • areaTwice

      protected float areaTwice(float ptAx, float ptAy, float ptBx, float ptBy, float ptCx, float ptCy)
      Calculates twice the area (cross product of two vectors) of a triangle given three points. This is a private function only called by the function "contains".
      Parameters:
      ptAx - x-coordinate of the first point of the triangle
      ptAy - y-coordinate of the first point of the triangle
      ptBx - x-coordinate of the second point of the triangle
      ptBy - y-coordinate of the second point of the triangle
      ptCx - x-coordinate of the third point of the triangle
      ptCy - y-coordinate of the third point of the triangle
      Returns:
      twice the area of the triangle if CCw or -2*area if CW