Package gov.nih.mipav.model.structures
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
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
FieldsModifier and TypeFieldDescriptionprotected booleanFlag indicating whether or not a VOI is active (selected).protected booleanAutomatically generate the label, unless it is set explicitly:protected WildMagic.LibFoundation.Mathematics.Vector3fStores the average of the contour of a VOI.protected WildMagic.LibFoundation.Mathematics.Vector3fStores the black and white center of mass of the contour of a VOI.protected WildMagic.LibFoundation.Mathematics.Vector3fStores the blue center of mass of the contour of a VOI.protected WildMagic.LibFoundation.Mathematics.Vector3fStores the green center of mass of the contour of a VOI.protected WildMagic.LibFoundation.Mathematics.Vector3fStores the red center of mass of the contour of a VOI.static final intprotected booleanTrue when this is a closed contour.protected booleandisplays the voi in the volume renderer:private booleanIf doGeometricCenterLabel = true and if active == false and if closed = true, execute drawGeometricCenterLabel when in drawSelfprotected static final intThe down arrow key.protected booleanFlag that indicates if the VOI is movable.protected WildMagic.LibFoundation.Mathematics.Vector3fStores the geometric center of the contour of a VOI.protected StringLabel (Name) for this member of the VOI.protected intKeeps track of the last near point value (for keyboard moving of individual pts.protected static final intThe left arrow key.static final intstatic final intstatic final intstatic final intprotected WildMagic.LibFoundation.Mathematics.Vector3f[]Current contour bounding-box.protected booleanTrue is this is a QuickLUT contour.protected booleanprotected booleanTrue is this is a split-line contour.protected booleanSet to true if the geometric center needs updating.protected booleanSet to true if the contour bounding-box needs updating.protected booleanSet to true if the geometric center needs updating.protected booleanSet to true if the contour changes, so the mask will update when needed.protected booleanSet to true if the contour plane needs updating.protected intAnchor point.protected intCurrent plane of this contour.protected intVOI type of this contour.protected WildMagic.LibFoundation.Mathematics.ColorRGBAContour color.protected WildMagic.LibFoundation.Mathematics.Vector3fprotected VolumeVOIData structure for drawing this contour in the GPU VolumeRendererprotected intFlag used to indicate if the cursor is near a point on the VOI bounding box.protected intFlag used to indicate if the cursor is near a point of the VOI member.static final intIf the points on the contour are not on the x,y, or z-plane.static final intUsed in places which usually remember an index into a point vector.protected intNumber of pixels in the array used in graphing intensity along the boundary.protected booleanIf true this flag indicates that the shape should be included (applied) when processing the image.protected static final intThe right arrow key.static final intprivate static final longUse serialVersionUID for interoperability.static final intprivate intinitialize subtype to unknownstatic final intavailable subtypes for VOIprotected static final intThe up arrow key.static final intstatic final intstatic final intprotected VOIReference to the containing VOI object.protected floatUsed to display 3D VOIs in the three orthogonal views of the data in the volume rendererstatic final intUsed in determining if all points on the contour have the same x-valueprivate float[]static final intUsed in determining if all points on the contour have the same y-valueprivate float[]static final intUsed in determining if all points on the contour have the same z-valueprivate float[]Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementDataFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionVOIBase()Default Constructor.VOIBase(boolean bFixed, boolean bClosed) Constructor sets the fixed and closed flags.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.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 TypeMethodDescriptionvoidaddElement(float x, float y, float z) Adds a point to the curve.voidaddElement(int x, int y, int z) Adds a point to the curve.doublearea()protected floatareaTwice(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.floatcalcIntensity(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.floatcalcIntensityThreshold(ModelImage kImage, float threshold, int t) Calculates the total intensity contained within this contour, equal to of greater than the threshold.floatcalcRGBIntensity(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.floatcalcRGBIntensityThreshold(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 VOIBaseclone()booleancontain(float iX, float iY) This is used by SVM boundary training to identify the prostate boundary VOI landmark points.booleancontains(float iX, float iY) Returns true if the input iX, iY is contained within this contour.booleancontains(float iX, float iY, float iZ) Returns true if the input iX,iY,iZ is contained within this contour.booleancontains(int _x, int _y, boolean forceReload) private booleancontainsX(int y, int z) private booleancontainsY(int x, int z) private booleancontainsZ(int x, int y) createVolumeVOI(VolumeImage kVolumeImage, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate) Creates the VolumeVOI data structure for rendering this contour in the GPU VolumeRenderervoidcycleActivePt(int keyCode) Cycles through the active points on the curve.voiddelete(int iPos) Deletes the specified position on the curve.voidvoiddisplay(boolean show) Turns the display setting on/off for the VolumeVOI displayed in the volume renderer.voiddispose()Deletes local data members.floatdistanceToVOI(int iX, int iY, int iZ) Returns the smallest distance from the input point to this contour.booleanvoidexportArrays(float[] x, float[] y, float[] z) Exports the float arrays of the points of the curve.voidexportArrays(int[] x, int[] y, int[] z) Exports the arrays of the points of the curve in int array format.private voidfill(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 voidfill_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 voidfill_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.voidfillVolume(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 voidfillX(int iX, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim) private voidfillY(int iY, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim) private voidfillZ(int iZ, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> kMaskPositions, BitSet kMask, int xDim, int yDim) intfindPositionAndCurvature(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.intfindPositionAndIntensity(ModelImage kImage, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> positions, Vector<WildMagic.LibFoundation.Mathematics.ColorRGB> colors) Finds the position/intensity along a VOI.voidfindPositionAndIntensity(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.intfindVOIIndentations2D(ModelImage kImage, int sliceNum, Vector<VOIBase> curves, boolean displayIndentations) WildMagic.LibFoundation.Mathematics.Vector3fGets the Vector3f of the active point.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> intReturns the anchor point.WildMagic.LibFoundation.Mathematics.Vector3fvoidgetBounds(float[] x, float[] y, float[] z) Calculates the bounds of the contour.voidgetBounds(int[] x, int[] y, int[] z) Calculates the bounds of the contour.WildMagic.LibFoundation.Mathematics.Vector3fgetCenterOfMass(ModelImage kImage) Gets the center of mass of the contour for a given imagevoidgetCenterOfMass(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.Vector3fgetCenterOfMassB(ModelImage kImage) Gets the blue center of mass of the contour.WildMagic.LibFoundation.Mathematics.Vector3fgetCenterOfMassG(ModelImage kImage) Gets the green center of mass of the contour.WildMagic.LibFoundation.Mathematics.Vector3fgetCenterOfMassR(ModelImage kImage) Gets the red center of mass of the contour.intReturns the contour ID: the index of this contour into the VOI.booleanIf doGeometricCenterLabel = true and active == false and closed = true, execute drawGeometricCenterLabel when in drawSelfWildMagic.LibFoundation.Mathematics.Vector3fGets the geometric center of the contour.WildMagic.LibFoundation.Mathematics.Vector3fgetGroup()Returns the VOI object that contains this contour.WildMagic.LibFoundation.Mathematics.Vector3f[]Returns the contour bounding-box.getLabel()Gets the label of the VOI.intAccessor that returns the number of points used in the most recent intensity calculation of this contour.doublegetLengthPtToPt(float[] resolutions) Returns the total length of this contour, based on the input resolutions.doublegetLengthPtToPt(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> getName()Gets the name of the VOI that contains this contour, null if this contour is not contained in a VOI.intintReturns the point on the curve nearest the cursor, calculated by nearLine, etc.intintgetPlane()Determines if the points on the contour lie on either the x,y,or z-planes.booleanAccessor that returns the process.intReturns the last selected point.intgetTotalLengthString(float[] afResolutions, int[] aiUnits) Returns the total length of this contour as a string.intgetType()Returns the type of this contour.floatReturns the VolumeVOI data member used to draw this contour in the GPU VOlumeRenderer.voidimportArrays(float[] x, float[] y, float[] z, int n) Imports new position values into this contour.voidimportArrays(int[] x, int[] y, int[] z, int n) Imports new position values into this contour.voidimportPoints(WildMagic.LibFoundation.Mathematics.Vector3f[] pt) Imports new position values into this contour.booleanisActive()Accessor to flag that indicates if an VOI is active.booleanisClosed()Flag used to indicate type of contour: true = closed contour (i.e.booleanisFixed()Accessor to flag that indicates if an VOI is fixed (movable).booleanbooleanbooleanReturns true if this is a QuickLUT contour.booleanisSplit()Returns true if this is a split-line contour.booleannearLine(int iX, int iY, int iZ) Returns true if the input position is near the outline of this contour.booleannearLine(int iX, int iY, int iZ, int tol) Returns true if the input position is near the outline of this contour.private voidoutlineRegion(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 voidoutlineRegion_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 voidoutlineRegion_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.Plane3fplaneFit()Fits a plane to the points in this contour and returns the plane.voidReloads points in this array for speed purposes.voidsetActive(boolean active) Sets flag to indicate whether or not VOI is active.voidSets the anchor point.voidsetClosed(boolean bClosed) Sets this contour as open or closed.voidsetDoGeometricCenterLabel(boolean doGeometricCenterLabel) If doGeometricCenterLabel = true and active == false and closed = true, execute drawGeometricCenterLabel when in drawSelfvoidsetFixed(boolean fixed) Sets flag to indicate whether or not VOI is fixed.voidSets the VOI object that contains this contour.voidSets the label of the VOI.voidvoidsetMaskSlice(BitSet kMask, int xDim, boolean XOR, int polarity) voidsetNearBoundPoint(int i) Sets the near boundary point.voidsetNearPoint(int i) Sets the near point.voidsetPlane(int iPlane) voidsetProcess(boolean process) Sets whether the shape is included in processing.voidsetQuickLUT(boolean bQuickLUT) Sets the QuickLUT flag.voidsetSelectedPoint(int i) Sets the selected point.voidsetSplit(boolean bSplit) Sets the split flag.voidsetSubtype(int subtype) voidsetVOIIntensities(ModelImage kImage, double newValue, int t) voidsetVOIIntensities(ModelImage kImage, Vector<Double> newValue, int t) voidsetVolumeDisplayRange(float range) intslice()Returns the slice value of the contour on every plane.intslice(int iPlane) Returns the point value the contour has in common if it lies in the given plane.private static voidsortCrossingPoints(float[] aiList, int iNumElements) Sorts the edge crossing points in place.voidtransform(TransMatrix tMatrix) Copies the input VOIBase, transformed by the input TransMatrix.voidtrimPoints(double constraint, boolean tFlag) Trims a contour and then removes collinear points in the resulting contour.voidupdate()The contour has changed, set the update flags so statistics are recalculated when needed.voidupdate(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor) Set the color of this contour.voidupdate(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, trimToSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
XPLANE
public static final int XPLANEUsed in determining if all points on the contour have the same x-value- See Also:
-
YPLANE
public static final int YPLANEUsed in determining if all points on the contour have the same y-value- See Also:
-
ZPLANE
public static final int ZPLANEUsed in determining if all points on the contour have the same z-value- See Also:
-
NOT_A_PLANE
public static final int NOT_A_PLANEIf 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_POINTUsed 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 UPThe up arrow key.- See Also:
-
LEFT
protected static final int LEFTThe left arrow key.- See Also:
-
DOWN
protected static final int DOWNThe down arrow key.- See Also:
-
RIGHT
protected static final int RIGHTThe right arrow key.- See Also:
-
active
protected boolean activeFlag 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 gcPtStores the geometric center of the contour of a VOI. -
averagePt
protected WildMagic.LibFoundation.Mathematics.Vector3f averagePtStores the average of the contour of a VOI. -
cenMassPt
protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtStores the black and white center of mass of the contour of a VOI. -
cenMassPtR
protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtRStores the red center of mass of the contour of a VOI. -
cenMassPtG
protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtGStores the green center of mass of the contour of a VOI. -
cenMassPtB
protected WildMagic.LibFoundation.Mathematics.Vector3f cenMassPtBStores the blue center of mass of the contour of a VOI. -
fixed
protected boolean fixedFlag that indicates if the VOI is movable. -
label
Label (Name) for this member of the VOI. -
autoLabel
protected boolean autoLabelAutomatically generate the label, unless it is set explicitly: -
lastPoint
protected int lastPointKeeps track of the last near point value (for keyboard moving of individual pts. -
nearPoint
protected int nearPointFlag used to indicate if the cursor is near a point of the VOI member. -
nearBoundPoint
protected int nearBoundPointFlag used to indicate if the cursor is near a point on the VOI bounding box. -
voiGroup
Reference to the containing VOI object. -
process
protected boolean processIf 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 doGeometricCenterLabelIf doGeometricCenterLabel = true and if active == false and if closed = true, execute drawGeometricCenterLabel when in drawSelf -
m_bUpdateMask
protected boolean m_bUpdateMaskSet to true if the contour changes, so the mask will update when needed. -
m_bUpdateBounds
protected boolean m_bUpdateBoundsSet to true if the contour bounding-box needs updating. -
m_bUpdateGeometricCenter
protected boolean m_bUpdateGeometricCenterSet to true if the geometric center needs updating. -
m_bUpdateAverage
protected boolean m_bUpdateAverageSet to true if the geometric center needs updating. -
m_bReloadPoints
protected boolean m_bReloadPoints -
m_bUpdatePlane
protected boolean m_bUpdatePlaneSet to true if the contour plane needs updating. -
m_iVOIType
protected int m_iVOITypeVOI type of this contour. -
m_iAnchorIndex
protected int m_iAnchorIndexAnchor point. -
closed
protected boolean closedTrue when this is a closed contour. -
m_bSplit
protected boolean m_bSplitTrue is this is a split-line contour. -
m_bQuickLUT
protected boolean m_bQuickLUTTrue is this is a QuickLUT contour. -
m_iPlane
protected int m_iPlaneCurrent plane of this contour. -
m_akImageMinMax
protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akImageMinMaxCurrent contour bounding-box. -
m_kColor
protected WildMagic.LibFoundation.Mathematics.ColorRGBA m_kColorContour color. -
m_kVolumeVOI
Data structure for drawing this contour in the GPU VolumeRenderer -
volumeDisplayRange
protected float volumeDisplayRangeUsed to display 3D VOIs in the three orthogonal views of the data in the volume renderer -
numPixels
protected int numPixelsNumber 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_SUBTYPEavailable subtypes for VOI- See Also:
-
CIRCLE
public static final int CIRCLE- See Also:
-
SQUARE
public static final int SQUARE- See Also:
-
subtype
private int subtypeinitialize subtype to unknown -
display
protected boolean displaydisplays 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
Copies the input VOIBase into a new VOIBase object.- Parameters:
kBase-
-
VOIBase
Copies the input contour and changes it's slice +/-- Parameters:
kBase-iPropDir-
-
VOIBase
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 positionsiNumElements- number of positions.
-
addElement
public void addElement(float x, float y, float z) Adds a point to the curve.- Parameters:
x- x coordinate of pointy- y coordinate of pointz- 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 pointy- y coordinate of pointz- z coordinate of point
-
area
public double area() -
calcIntensity
Calculated the total intensity contained within this contour.- Parameters:
kImage-- Returns:
- total intensity.
-
setVOIIntensities
-
setVOIIntensities
-
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
Calculates the total intensity contained within this contour, equal to of greater than the threshold.- Parameters:
kImage- input imagethreshold-- 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
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
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
-
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-positioniY- input y-positioniZ- input z-position- Returns:
- smallest distance from the input to the contour.
-
equals
-
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 coordinatesy- array of y coordinatesz- 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 coordinatesy- array of y coordinatesz- array of z coordinates
-
fillVolume
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 examplecurvatures- the corresponding curvature along the contourmeanCurvature-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 examplecolors- 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 VOIkImage- input image to read intensity values frompositions- output list of positionscolors- 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 dimensiony- two element array where y[0] = min extent of the Contour and y[1] = max extent of the Contour in the y dimensionz- 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 dimensiony- two element array where y[0] = min extent of the Contour and y[1] = max extent of the Contour in the y dimensionz- two element array where z[0] = min extent of the Contour and z[1] = max extent of the Contour in the z dimension
-
getCenterOfMass
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
Gets the blue center of mass of the contour.- Parameters:
kImage- input image.- Returns:
- returns the center of mass
-
getCenterOfMassG
Gets the green center of mass of the contour.- Parameters:
kImage- input image.- Returns:
- returns the center of mass
-
getCenterOfMassR
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
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
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
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
-
getMaskPositions
-
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
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
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-positiontol- 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
Sets the VOI object that contains this contour.- Parameters:
kGroup- VOI container for this contour.
-
setLabel
Sets the label of the VOI.- Parameters:
str- the label
-
setMask
-
setMaskSlice
-
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. Useslice(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
Copies the input VOIBase, transformed by the input TransMatrix.- Parameters:
tMatrix- transformationkBase- 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" pointstFlag- 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
-
fillY
-
fillZ
-
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 crossesaiNumCrossings- 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 crossesaiNumCrossings- 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 crossesaiNumCrossings- 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 triangleptAy- y-coordinate of the first point of the triangleptBx- x-coordinate of the second point of the triangleptBy- y-coordinate of the second point of the triangleptCx- x-coordinate of the third point of the triangleptCy- y-coordinate of the third point of the triangle- Returns:
- twice the area of the triangle if CCw or -2*area if CW
-