Class VOIBase

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean active
      Flag indicating whether or not a VOI is active (selected).
      protected boolean autoLabel
      Automatically generate the label, unless it is set explicitly:
      protected WildMagic.LibFoundation.Mathematics.Vector3f averagePt
      Stores the average of the contour of a VOI.
      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPt
      Stores the black and white center of mass of the contour of a VOI.
      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtB
      Stores the blue center of mass of the contour of a VOI.
      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtG
      Stores the green center of mass of the contour of a VOI.
      protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtR
      Stores the red center of mass of the contour of a VOI.
      static int CIRCLE  
      protected boolean closed
      True when this is a closed contour.
      protected boolean display
      displays the voi in the volume renderer:
      private boolean doGeometricCenterLabel
      If doGeometricCenterLabel = true and if active == false and if closed = true, execute drawGeometricCenterLabel when in drawSelf
      protected static int DOWN
      The down arrow key.
      protected boolean fixed
      Flag that indicates if the VOI is movable.
      protected WildMagic.LibFoundation.Mathematics.Vector3f gcPt
      Stores the geometric center of the contour of a VOI.
      protected java.lang.String label
      Label (Name) for this member of the VOI.
      protected int lastPoint
      Keeps track of the last near point value (for keyboard moving of individual pts.
      protected static int LEFT
      The left arrow key.
      static int LEFT_MIDDLE  
      static int LOWER_LEFT  
      static int LOWER_MIDDLE  
      static int LOWER_RIGHT  
      protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akImageMinMax
      Current contour bounding-box.
      protected boolean m_bQuickLUT
      True is this is a QuickLUT contour.
      protected boolean m_bReloadPoints  
      protected boolean m_bSplit
      True is this is a split-line contour.
      protected boolean m_bUpdateAverage
      Set to true if the geometric center needs updating.
      protected boolean m_bUpdateBounds
      Set to true if the contour bounding-box needs updating.
      protected boolean m_bUpdateGeometricCenter
      Set to true if the geometric center needs updating.
      protected boolean m_bUpdateMask
      Set to true if the contour changes, so the mask will update when needed.
      protected boolean m_bUpdatePlane
      Set to true if the contour plane needs updating.
      protected int m_iAnchorIndex
      Anchor point.
      protected int m_iPlane
      Current plane of this contour.
      protected int m_iVOIType
      VOI type of this contour.
      protected WildMagic.LibFoundation.Mathematics.ColorRGBA m_kColor
      Contour color.
      protected WildMagic.LibFoundation.Mathematics.Vector3f m_kPositionSum  
      protected VolumeVOI m_kVolumeVOI
      Data structure for drawing this contour in the GPU VolumeRenderer
      protected int nearBoundPoint
      Flag used to indicate if the cursor is near a point on the VOI bounding box.
      protected int nearPoint
      Flag used to indicate if the cursor is near a point of the VOI member.
      static int NOT_A_PLANE
      If the points on the contour are not on the x,y, or z-plane.
      static int NOT_A_POINT
      Used in places which usually remember an index into a point vector.
      protected int numPixels
      Number of pixels in the array used in graphing intensity along the boundary.
      protected boolean process
      If true this flag indicates that the shape should be included (applied) when processing the image.
      protected static int RIGHT
      The right arrow key.
      static int RIGHT_MIDDLE  
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      static int SQUARE  
      private int subtype
      initialize subtype to unknown
      static int UNKNOWN_SUBTYPE
      available subtypes for VOI
      protected static int UP
      The up arrow key.
      static int UPPER_LEFT  
      static int UPPER_MIDDLE  
      static int UPPER_RIGHT  
      protected VOI voiGroup
      Reference to the containing VOI object.
      protected float volumeDisplayRange
      Used to display 3D VOIs in the three orthogonal views of the data in the volume renderer
      static int XPLANE
      Used in determining if all points on the contour have the same x-value
      private float[] xPts  
      static int YPLANE
      Used in determining if all points on the contour have the same y-value
      private float[] yPts  
      static int ZPLANE
      Used in determining if all points on the contour have the same z-value
      private float[] zPts  
      • Fields inherited from class java.util.Vector

        capacityIncrement, elementCount, elementData
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      VOIBase()
      Default Constructor.
      VOIBase​(boolean bFixed, boolean bClosed)
      Constructor sets the fixed and closed flags.
      VOIBase​(boolean bFixed, boolean bClosed, java.util.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)  
      VOIBase​(VOIBase kBase)
      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

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      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 area()  
      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.
      java.util.Vector<java.lang.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.
      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.
      java.util.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 clone()  
      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)  
      VolumeVOI 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 deleteVolumeVOI()  
      void display​(boolean show)
      Turns the display setting on/off for the VolumeVOI displayed in the volume renderer.
      void dispose()
      Deletes local data members.
      float distanceToVOI​(int iX, int iY, int iZ)
      Returns the smallest distance from the input point to this contour.
      boolean equals​(java.lang.Object o)  
      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, java.util.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, java.util.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, java.util.BitSet kMask, boolean bIntersection, int iValue)
      Helper function for rendering this contour onto the y-plane.
      void fillVolume​(ModelImage kVolume, java.util.BitSet kMask, boolean bIntersection, int iValue)
      Renders this contour into the input ModelImage or the input BitSet mask.
      private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> fillVolume​(java.util.BitSet kMask, int xDim, int yDim)
      Renders this contour into the input mask.
      private void fillX​(int iX, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, java.util.BitSet kMask, int xDim, int yDim)  
      private void fillY​(int iY, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, java.util.BitSet kMask, int xDim, int yDim)  
      private void fillZ​(int iZ, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, java.util.BitSet kMask, int xDim, int yDim)  
      int findPositionAndCurvature​(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, java.util.Vector<java.lang.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, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, java.util.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, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, java.util.Vector<WildMagic.LibFoundation.Mathematics.ColorRGB> colors)
      Finds the positions and intensities along a line-segment of the VOI.
      int findVOIIndentations2D​(ModelImage kImage, int sliceNum, java.util.Vector<VOIBase> curves, boolean displayIndentations)  
      WildMagic.LibFoundation.Mathematics.Vector3f getActivePt()
      Gets the Vector3f of the active point.
      java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getAllContourPoints()  
      int getAnchor()
      Returns the anchor point.
      WildMagic.LibFoundation.Mathematics.Vector3f getAverage()  
      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 getCenterOfMass​(ModelImage kImage)
      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 getCenterOfMassB​(ModelImage kImage)
      Gets the blue center of mass of the contour.
      WildMagic.LibFoundation.Mathematics.Vector3f getCenterOfMassG​(ModelImage kImage)
      Gets the green center of mass of the contour.
      WildMagic.LibFoundation.Mathematics.Vector3f getCenterOfMassR​(ModelImage kImage)
      Gets the red center of mass of the contour.
      int getContourID()
      Returns the contour ID: the index of this contour into the VOI.
      boolean getDoGeometricCenterLabel()
      If doGeometricCenterLabel = true and active == false and closed = true, execute drawGeometricCenterLabel when in drawSelf
      WildMagic.LibFoundation.Mathematics.Vector3f getGeometricCenter()
      Gets the geometric center of the contour.
      WildMagic.LibFoundation.Mathematics.Vector3f getGeometricCenterA()  
      VOI getGroup()
      Returns the VOI object that contains this contour.
      WildMagic.LibFoundation.Mathematics.Vector3f[] getImageBoundingBox()
      Returns the contour bounding-box.
      java.lang.String getLabel()
      Gets the label of the VOI.
      int getLastNumPixels()
      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.
      java.lang.String getLengthString​(int iPos0, int iPos1, float[] afResolutions, int[] aiUnits)
      Returns the length of this contour between the two positions along the contour.
      java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getMaskPositions()  
      java.lang.String getName()
      Gets the name of the VOI that contains this contour, null if this contour is not contained in a VOI.
      int getNearBoundPoint()  
      int getNearPoint()
      Returns the point on the curve nearest the cursor, calculated by nearLine, etc.
      int getNumVoxels()  
      int getPlane()
      Determines if the points on the contour lie on either the x,y,or z-planes.
      boolean getProcess()
      Accessor that returns the process.
      int getSelectedPoint()
      Returns the last selected point.
      int getSubtype()  
      java.lang.String getTotalLengthString​(float[] afResolutions, int[] aiUnits)
      Returns the total length of this contour as a string.
      int getType()
      Returns the type of this contour.
      float getVolumeDisplayRange()  
      VolumeVOI getVolumeVOI()
      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 isActive()
      Accessor to flag that indicates if an VOI is active.
      boolean isClosed()
      Flag used to indicate type of contour: true = closed contour (i.e.
      boolean isFixed()
      Accessor to flag that indicates if an VOI is fixed (movable).
      boolean isM_bUpdateBounds()  
      boolean isM_bUpdateGeometricCenter()  
      boolean isQuickLUT()
      Returns true if this is a QuickLUT contour.
      boolean isSplit()
      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 planeFit()
      Fits a plane to the points in this contour and returns the plane.
      void reloadPoints()
      Reloads points in this array for speed purposes.
      void setActive​(boolean active)
      Sets flag to indicate whether or not VOI is active.
      void setAnchor()
      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 setLabel​(java.lang.String str)
      Sets the label of the VOI.
      void setMask​(java.util.BitSet kMask, int xDim, int yDim, boolean XOR, int polarity)  
      void setMaskSlice​(java.util.BitSet kMask, int xDim, boolean XOR, int polarity)  
      void setNearBoundPoint​(int i)
      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 setSelectedPoint​(int i)
      Sets the selected point.
      void setSplit​(boolean bSplit)
      Sets the split flag.
      void setSubtype​(int subtype)  
      void setVolumeDisplayRange​(float range)  
      int slice()
      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 transform​(TransMatrix tMatrix)
      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 update()
      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.util.Vector

        add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, stream, toArray
    • Field Detail

      • serialVersionUID

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

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

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

        public static final int ZPLANE
        Used in determining if all points on the contour have the same z-value
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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 java.lang.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:
        Constant Field Values
      • 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 Detail

      • VOIBase

        public VOIBase()
        Default Constructor. Initializes the Vector : 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,
                       java.util.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 Detail

      • 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.
      • calcIntensity

        public java.util.Vector<java.lang.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 java.util.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 java.util.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​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<WildMagic.LibFoundation.Mathematics.Vector3f>
        Specified by:
        equals in interface java.util.List<WildMagic.LibFoundation.Mathematics.Vector3f>
        Overrides:
        equals in class java.util.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,
                               java.util.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,
                                         java.util.Vector<VOIBase> curves,
                                         boolean displayIndentations)
      • findPositionAndCurvature

        public int findPositionAndCurvature​(java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions,
                                            java.util.Vector<java.lang.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
        smooth - if true smooth before finding curvature
        meanCurvature -
        stdDevCurvature -
        meanNegativeCurvature -
        negativeHysteresisFraction -
        positiveHysteresisFraction -
        numberOfIndentations -
        consecutiveNegativeNeeded -
        negativeCurvatureNeeded -
        Returns:
        the number of points in the position and curvature array that have valid data.
      • findPositionAndIntensity

        public int findPositionAndIntensity​(ModelImage kImage,
                                            java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions,
                                            java.util.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,
                                             java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions,
                                             java.util.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 java.lang.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 java.lang.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 java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getAllContourPoints()
      • getMaskPositions

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

        public java.lang.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 java.lang.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​(java.lang.String str)
        Sets the label of the VOI.
        Parameters:
        str - the label
      • setMask

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

        public void setMaskSlice​(java.util.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:
        kBase - VOI to copy.
        tMatrix - transformation
      • 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,
                          java.util.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.
        iYMin - contour bounding box y-minimum.
        iXMax - contour bounding box x-maximum.
        iYMax - contour bounding box y-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.
      • fill_X

        private void fill_X​(float[][] aaiCrossingPoints,
                            int[] aiNumCrossings,
                            int iYMin,
                            int iYMax,
                            int iX,
                            ModelImage kVolume,
                            java.util.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.
        iZMin - contour bounding box z-minimum.
        iYMax - contour bounding box y-maximum.
        iZMax - contour bounding box z-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.
      • fill_Y

        private void fill_Y​(float[][] aaiCrossingPoints,
                            int[] aiNumCrossings,
                            int iXMin,
                            int iXMax,
                            int iY,
                            ModelImage kVolume,
                            java.util.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.
        iZMin - contour bounding box z-minimum.
        iXMax - contour bounding box x-maximum.
        iZMax - contour bounding box z-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.
      • fillVolume

        private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> fillVolume​(java.util.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,
                           java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions,
                           java.util.BitSet kMask,
                           int xDim,
                           int yDim)
      • fillY

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

        private void fillZ​(int iZ,
                           java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions,
                           java.util.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