Class BurnBaseView
java.lang.Object
gov.nih.mipav.view.renderer.J3D.surfaceview.rfaview.BurnBaseView
- Direct Known Subclasses:
BurnCoolTipView,BurnHeatView,BurnRegularView
The default probe burning type view. The class define the default burning point's geometry shape, and burning path
mark behavior.
- Author:
- Ruida Cheng
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA representation of an edge for the vertex-edge-triangle table.classDOCUMENT ME! -
Field Summary
FieldsModifier and TypeFieldDescription(package private) javax.vecmath.Color3fDefine attenuation lighting colors.(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Color3fDOCUMENT ME!protected javax.vecmath.Color4fBurning point surface color.protected intCurrent burning point index.protected javax.media.j3d.BranchGroup[]Burning point branch group array, used to switch between different buring point.protected javax.media.j3d.BranchGroupThe root branch group the default burning point.protected intBurning type.(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Color3fDOCUMENT ME!protected intVolume difference in voxels for the tumor surface and burning sphere, ellipsoid packings.(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Color3fDOCUMENT ME!vector stack to record the burning index.protected float[]DOCUMENT ME!protected int[]DOCUMENT ME!protected int[]The 3D MRI image stored as a 1D array.protected BitSetDOCUMENT ME!protected BurnBaseView.UnorderedSetInt[]DOCUMENT ME!private javax.media.j3d.Shape3D[]DOCUMENT ME!protected javax.vecmath.Point3f[]DOCUMENT ME!protected floatThe size of a voxel, in voxel units.protected floatThe size of a voxel, in voxel units.protected floatThe size of a voxel, in voxel units.protected intDOCUMENT ME!protected intDOCUMENT ME!protected intDOCUMENT ME!protected intDOCUMENT ME!protected intDOCUMENT ME!protected intDOCUMENT ME!protected inthistogram parameters.protected intThe MRI image bounds and quantity of voxels.protected intDOCUMENT ME!protected intmesh data.protected intThe MRI image bounds and quantity of voxels.protected intThe MRI image bounds and quantity of voxels.protected intThe MRI image bounds and quantity of voxels.protected javax.vecmath.Point3fDOCUMENT ME!protected HashMap<BurnBaseView.Edge, Integer> DOCUMENT ME!protected javax.vecmath.Matrix3fDOCUMENT ME!protected Vector<MaskBurnAttribute> Reference to Mask burning attribute.protected intInitialized the number of burning point.private intfactor above median at which edge values are taken to zero.(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Color4fDOCUMENT ME!protected com.sun.j3d.utils.picking.PickCanvasAgent to set the burning point sphere pickable.(package private) javax.vecmath.Color3fDOCUMENT ME!protected JPanelProbeJPanelProbe reference.(package private) javax.vecmath.Color3fDOCUMENT ME!(package private) javax.vecmath.Color4fDOCUMENT ME!private floatimage space burning point radius.protected javax.vecmath.Point3fBurning sphere radius, semiX, Y, Z in point format.(package private) javax.vecmath.Color3fDefine colors.(package private) javax.vecmath.Color3fDOCUMENT ME!protected booleanFlag to show the burning point label.(package private) javax.vecmath.Color3fDOCUMENT ME!protected javax.media.j3d.BranchGroup[]Default burning point array.protected com.sun.j3d.utils.geometry.SphereBurning point sphere.protected SurfaceRenderSurface Render reference.protected javax.media.j3d.BranchGroup[]Burning point label array.protected javax.vecmath.Vector3fBurning point center.protected BitSetReference to burning point voluem mask.protected floatDefault volume space burning point radius.(package private) javax.vecmath.Color3fDOCUMENT ME! -
Constructor Summary
ConstructorsConstructorDescriptionBurnBaseView(SurfaceRender _surfaceRender, JPanelProbe _probePanel, javax.media.j3d.BranchGroup _burnRootParentBG) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildBurnSceneGraph(float radius, float time) Build the image scene graph structure.voidbuildBurnSceneGraph(float radius, float time, javax.vecmath.Color3f color, int index) Only used by the default burning point type to reset the image sence graph when the burning sphere radius and time changes.protected javax.media.j3d.BranchGroupBuild the entry point image scene graph structure.protected voidAttach some 3D text to a BranchGroup or TransformGroup.voidcalcTotalVolume(SurfaceAttributes surface, TreatmentInformation treatment) Calculate the burning points total volume.protected voidIdentify all voxels that are inside or on the mesh that represents the brain surface.protected javax.media.j3d.BranchGroupcreateSurface(ModelTriangleMesh[] meshes, javax.vecmath.Color4f color, int mode) Creates a surface in the scene graph from an array of triangle meshes.voiddispose()Dispose memory.voidenableBurnLabels(boolean flag) Attach or detach burn labels.protected voidApproximate the brain surface by an ellipsoid.intfindBurnPoint(javax.media.j3d.Shape3D pickedShape) Check whether the burning sphere is picked or not.protected voidfloodFill(int iX, int iY, int iZ) Identify voxels enclosed by the brain surface by using a flood fill.protected voidgenerateEllipsoidMesh(int burnType, float tipLen, int iSubdivisions, boolean isImageSpace) Tessellate a unit sphere centered at the origin.protected voidgenerateSphereMesh(int iSubdivisions, boolean isImageSpace) Tessellate a unit sphere centered at the origin.Get the burnning point ( sphere packing or ellipsoid packing ) mask.javax.vecmath.Color4fgetColor()Get the buring point surface color.final floatGet the volume difference btw tumor surface and burning sphere packings.protected final intgetIndex(int iX, int iY, int iZ) A convenience function for mapping the 3D voxel position (iX,iY,iZ) to a 1D array index.protected voidIdentify all voxels that are inside or on the mesh that represents the brain surface.protected intgetIntersectX(javax.vecmath.Point3f kV0, javax.vecmath.Point3f kV1, javax.vecmath.Point3f kV2, int iY, int iZ) Compute the point of intersection between a line (0,iY,iZ)+t(1,0,0) and the triangle defined by the three input points.protected intgetIntersectY(javax.vecmath.Point3f kV0, javax.vecmath.Point3f kV1, javax.vecmath.Point3f kV2, int iX, int iZ) Compute the point of intersection between a line (iX,0,iZ)+t(0,1,0) and the triangle defined by the three input points.protected intgetIntersectZ(javax.vecmath.Point3f kV0, javax.vecmath.Point3f kV1, javax.vecmath.Point3f kV2, int iX, int iY) Compute the point of intersection between a line (iX,iY,0)+t(0,0,1) and the triangle defined by the three input points.javax.vecmath.Point3fGet the radius( semiX, semiY, semiZ).static javax.vecmath.Vector3fgetRotAngle(javax.media.j3d.Transform3D t3D) DOCUMENT ME!protected javax.media.j3d.Shape3DgetShape(javax.media.j3d.BranchGroup root) Get the shape burning point surface.javax.media.j3d.BranchGroupGet the current burning point brach group.javax.vecmath.Vector3fGet the burning point center coordinates.final floatGet the total tumor voxels of the current treatment in mm^3.voidAnalyze the histogram of the 10-bit binned 3D MRI.protected javax.media.j3d.BranchGroupMark the probing guide line.protected voidreGenerateEllipsoidMesh(int iSubdivisions, float tipLen, boolean isImageSpace, javax.vecmath.Point3f center, javax.media.j3d.Transform3D centerTransform) Tessellate a unit sphere centered at the origin.protected voidreGenerateSphereMesh(int iSubdivisions, javax.vecmath.Point3f center, javax.media.j3d.Transform3D centerTransform) Tessellate a unit sphere centered at the origin.protected voidsetMaskBurnVector(Vector<MaskBurnAttribute> _vector) Initialize the mask burning vector.protected voidsetVolumeMask(BitSet _volumeMask) Initial the volume mask from burnBase.voidstartBurn(float tipLen, float time, int _index) Start burning.
-
Field Details
-
burnColor
protected javax.vecmath.Color4f burnColorBurning point surface color. -
burnIndex
protected int burnIndexCurrent burning point index. -
burningBG
protected javax.media.j3d.BranchGroup[] burningBGBurning point branch group array, used to switch between different buring point. -
burnRootParentBG
protected javax.media.j3d.BranchGroup burnRootParentBGThe root branch group the default burning point. -
burnType
protected int burnTypeBurning type. -
diffVoxels
protected int diffVoxelsVolume difference in voxels for the tumor surface and burning sphere, ellipsoid packings. -
m_afLength
protected float[] m_afLengthDOCUMENT ME! -
m_aiConnect
protected int[] m_aiConnectDOCUMENT ME! -
m_aiImage
protected int[] m_aiImageThe 3D MRI image stored as a 1D array. The mapping from (x,y,z) to 1D is: index = x + xbound*(y + ybound*z). -
m_aiMask
DOCUMENT ME! -
m_akAdjacent
DOCUMENT ME! -
m_akVertex
protected javax.vecmath.Point3f[] m_akVertexDOCUMENT ME! -
m_fXDelta
protected float m_fXDeltaThe size of a voxel, in voxel units. -
m_fYDelta
protected float m_fYDeltaThe size of a voxel, in voxel units. -
m_fZDelta
protected float m_fZDeltaThe size of a voxel, in voxel units. -
m_iBackThreshold
protected int m_iBackThresholdDOCUMENT ME! -
m_iBrightThreshold
protected int m_iBrightThresholdDOCUMENT ME! -
m_iDMax
protected int m_iDMaxDOCUMENT ME! -
m_iEQuantity
protected int m_iEQuantityDOCUMENT ME! -
m_iMaxThreshold
protected int m_iMaxThresholdDOCUMENT ME! -
m_iMedianIntensity
protected int m_iMedianIntensityDOCUMENT ME! -
m_iMinThreshold
protected int m_iMinThresholdhistogram parameters. -
m_iTQuantity
protected int m_iTQuantityDOCUMENT ME! -
m_iVQuantity
protected int m_iVQuantitymesh data. -
m_iXBound
protected int m_iXBoundThe MRI image bounds and quantity of voxels. -
m_iYBound
protected int m_iYBoundThe MRI image bounds and quantity of voxels. -
m_iZBound
protected int m_iZBoundThe MRI image bounds and quantity of voxels. -
m_iQuantity
protected int m_iQuantityThe MRI image bounds and quantity of voxels. -
m_kCenter
protected javax.vecmath.Point3f m_kCenterDOCUMENT ME! -
m_kEMap
DOCUMENT ME! -
m_kRotate
protected javax.vecmath.Matrix3f m_kRotateDOCUMENT ME! -
maskBurnVector
Reference to Mask burning attribute. -
numBurn
protected int numBurnInitialized the number of burning point. -
pickCanvas
protected com.sun.j3d.utils.picking.PickCanvas pickCanvasAgent to set the burning point sphere pickable. -
probePanel
JPanelProbe reference. -
radiusPt
protected javax.vecmath.Point3f radiusPtBurning sphere radius, semiX, Y, Z in point format. -
showLabels
protected boolean showLabelsFlag to show the burning point label. -
sphereBG
protected javax.media.j3d.BranchGroup[] sphereBGDefault burning point array. -
spheres
protected com.sun.j3d.utils.geometry.Sphere spheresBurning point sphere. -
surfaceRender
Surface Render reference. -
textLabelBG
protected javax.media.j3d.BranchGroup[] textLabelBGBurning point label array. -
translate
protected javax.vecmath.Vector3f translateBurning point center. -
volumeMask
Reference to burning point voluem mask. -
volumeSpaceRadius
protected float volumeSpaceRadiusDefault volume space burning point radius. -
ambientColor
javax.vecmath.Color3f ambientColorDefine attenuation lighting colors. -
black
javax.vecmath.Color3f blackDOCUMENT ME! -
blue
javax.vecmath.Color3f blueDOCUMENT ME! -
cyan
javax.vecmath.Color3f cyanDOCUMENT ME! -
diffuseColor
javax.vecmath.Color3f diffuseColorDOCUMENT ME! -
emissiveColor
javax.vecmath.Color3f emissiveColorDOCUMENT ME! -
green
javax.vecmath.Color3f greenDOCUMENT ME! -
indexVector
vector stack to record the burning index. -
orange
javax.vecmath.Color3f orangeDOCUMENT ME! -
orangeColor
javax.vecmath.Color4f orangeColorDOCUMENT ME! -
pink
javax.vecmath.Color3f pinkDOCUMENT ME! -
purple
javax.vecmath.Color3f purpleDOCUMENT ME! -
purpleColor
javax.vecmath.Color4f purpleColorDOCUMENT ME! -
red
javax.vecmath.Color3f redDefine colors. -
sepcualarColor
javax.vecmath.Color3f sepcualarColorDOCUMENT ME! -
silver
javax.vecmath.Color3f silverDOCUMENT ME! -
yellow
javax.vecmath.Color3f yellowDOCUMENT ME! -
m_akSurfaceShape
private javax.media.j3d.Shape3D[] m_akSurfaceShapeDOCUMENT ME! -
nVoxels
private int nVoxelsfactor above median at which edge values are taken to zero. -
radius
private float radiusimage space burning point radius.
-
-
Constructor Details
-
BurnBaseView
public BurnBaseView(SurfaceRender _surfaceRender, JPanelProbe _probePanel, javax.media.j3d.BranchGroup _burnRootParentBG) Constructor. Setup the burning point related branch groups.- Parameters:
_surfaceRender- SurfaceRender refernece._probePanel- JPanelProbe probe control panel reference._burnRootParentBG- BranchGroup root of the burning point.
-
-
Method Details
-
getRotAngle
public static javax.vecmath.Vector3f getRotAngle(javax.media.j3d.Transform3D t3D) DOCUMENT ME!- Parameters:
t3D- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildBurnSceneGraph
public void buildBurnSceneGraph(float radius, float time) Build the image scene graph structure.- Parameters:
radius- burning point sphere radiustime- burning point burning time duration.
-
buildBurnSceneGraph
public void buildBurnSceneGraph(float radius, float time, javax.vecmath.Color3f color, int index) Only used by the default burning point type to reset the image sence graph when the burning sphere radius and time changes.- Parameters:
radius- burning sphere radiustime- burning sphere duration timecolor- burning sphere colorindex- selected burning sphere index
-
calcTotalVolume
Calculate the burning points total volume.- Parameters:
surface- SurfaceAttributes referencetreatment- TreatmentInformation reference
-
dispose
public void dispose()Dispose memory. -
enableBurnLabels
public void enableBurnLabels(boolean flag) Attach or detach burn labels.- Parameters:
flag- whether to show the labels
-
findBurnPoint
public int findBurnPoint(javax.media.j3d.Shape3D pickedShape) Check whether the burning sphere is picked or not.- Parameters:
pickedShape- sphere burning shape.- Returns:
- int burning point index
-
getBurnMask
Get the burnning point ( sphere packing or ellipsoid packing ) mask.- Returns:
- BitSet Burning point volume mask.
-
getColor
public javax.vecmath.Color4f getColor()Get the buring point surface color.- Returns:
- Color4f burning color.
-
getDiffVolume
public final float getDiffVolume()Get the volume difference btw tumor surface and burning sphere packings.- Returns:
- float differenct volume in mm space.
-
getRadius
public javax.vecmath.Point3f getRadius()Get the radius( semiX, semiY, semiZ).- Returns:
- Point3f radius
-
getSphereBG
public javax.media.j3d.BranchGroup getSphereBG()Get the current burning point brach group.- Returns:
- BranchGroup burning point branch group reference.
-
getTranslate
public javax.vecmath.Vector3f getTranslate()Get the burning point center coordinates. Called by the probe control panel to show the current burning point center.- Returns:
- Vector3f burning point center coordinate.
-
getVolume
public final float getVolume()Get the total tumor voxels of the current treatment in mm^3.- Returns:
- float tumor volume in mm space.
-
histogramAnalysis
public void histogramAnalysis()Analyze the histogram of the 10-bit binned 3D MRI. The function computes a minimum threshold, a maximum threshold, and a background threshold that are used in the image term of the surface evolution. A brightness threshold is also computed that is used for determining the initial ellipsoid that approximates the brain surface. -
startBurn
public void startBurn(float tipLen, float time, int _index) Start burning. Show the burning sphere and probing path.- Parameters:
tipLen- the length of the probe tip (cm)time- the time spent burning_index- index of the new burn
-
buildEntryPoint
protected javax.media.j3d.BranchGroup buildEntryPoint()Build the entry point image scene graph structure.- Returns:
- BranchGroup the entry point root branch group.
-
buildText
Attach some 3D text to a BranchGroup or TransformGroup.- Parameters:
index- the group to attach the text tostr- the text to showpos- where to place the text
-
calcVoxels
protected void calcVoxels()Identify all voxels that are inside or on the mesh that represents the brain surface. The surface voxels are constructed by rasterizing the triangles of the mesh in 3D. The centroid of these voxels is used as a seed point for a flood fill of the region enclosed by the surface. -
createSurface
protected javax.media.j3d.BranchGroup createSurface(ModelTriangleMesh[] meshes, javax.vecmath.Color4f color, int mode) Creates a surface in the scene graph from an array of triangle meshes.- Parameters:
meshes- Triangle meshes that make up surfacecolor- Color of surfacemode- DOCUMENT ME!- Returns:
- Parent node of surface.
-
estimateEllipsoid
protected void estimateEllipsoid()Approximate the brain surface by an ellipsoid. The approximation is based on locating all voxels of intensity larger than a brightness threshold and that are part of the upper-half of the head. The idea is that the scalp voxels in the upper-half form lie approximately on an ellipsoidal surface.
NOTE. The assumption is that the traversal from bottom to top of head is in the y-direction of the 3D image. It does not matter if the top of the head has y-values smaller/larger than those for the bottom of the head. If this assumption is not met, the image should be permuted OR this code must be modified to attempt to recognize the orientation of the head
-
floodFill
protected void floodFill(int iX, int iY, int iZ) Identify voxels enclosed by the brain surface by using a flood fill. The flood fill is nonrecursive to avoid overflowing the program stack.- Parameters:
iX- the x-value of the seed point for the filliY- the y-value of the seed point for the filliZ- the z-value of the seed point for the fill
-
generateEllipsoidMesh
protected void generateEllipsoidMesh(int burnType, float tipLen, int iSubdivisions, boolean isImageSpace) Tessellate a unit sphere centered at the origin. Start with an octahedron and subdivide. The final mesh is then affinely mapped to the initial ellipsoid produced by estimateEllipsoid(). The subdivision scheme is described in BrainExtraction.pdf.- Parameters:
burnType- the type of the burntipLen- the length of the probe tip, in cmiSubdivisions- the number of levels to subdivide the ellipsoidisImageSpace- whether to get the mesh in image space
-
generateSphereMesh
protected void generateSphereMesh(int iSubdivisions, boolean isImageSpace) Tessellate a unit sphere centered at the origin. Start with an octahedron and subdivide. The final mesh is then affinely mapped to the initial ellipsoid produced by estimateEllipsoid(). The subdivision scheme is described in BrainExtraction.pdf.- Parameters:
iSubdivisions- the number of levels to subdivide the ellipsoidisImageSpace- DOCUMENT ME!
-
getIndex
protected final int getIndex(int iX, int iY, int iZ) A convenience function for mapping the 3D voxel position (iX,iY,iZ) to a 1D array index. The images are stored as 1D arrays, so this function is used frequently.- Parameters:
iX- the x-value of the voxel positioniY- the y-value of the voxel positioniZ- the z-value of the voxel position- Returns:
- the 1D array index corresponding to (iX,iY,iZ)
-
getInsideVoxels
protected void getInsideVoxels()Identify all voxels that are inside or on the mesh that represents the brain surface. The surface voxels are constructed by rasterizing the triangles of the mesh in 3D. The centroid of these voxels is used as a seed point for a flood fill of the region enclosed by the surface. -
getIntersectX
protected int getIntersectX(javax.vecmath.Point3f kV0, javax.vecmath.Point3f kV1, javax.vecmath.Point3f kV2, int iY, int iZ) Compute the point of intersection between a line (0,iY,iZ)+t(1,0,0) and the triangle defined by the three input points. All calculations are in voxel coordinates and the x-value of the intersection point is truncated to an integer.- Parameters:
kV0- a 3D vertex of the trianglekV1- a 3D vertex of the trianglekV2- a 3D vertex of the triangleiY- the y-value of the origin of the lineiZ- the z-value of the origin of the line- Returns:
- the x-value of the intersection
-
getIntersectY
protected int getIntersectY(javax.vecmath.Point3f kV0, javax.vecmath.Point3f kV1, javax.vecmath.Point3f kV2, int iX, int iZ) Compute the point of intersection between a line (iX,0,iZ)+t(0,1,0) and the triangle defined by the three input points. All calculations are in voxel coordinates and the y-value of the intersection point is truncated to an integer.- Parameters:
kV0- a 3D vertex of the trianglekV1- a 3D vertex of the trianglekV2- a 3D vertex of the triangleiX- the x-value of the origin of the lineiZ- the z-value of the origin of the line- Returns:
- the y-value of the intersection
-
getIntersectZ
protected int getIntersectZ(javax.vecmath.Point3f kV0, javax.vecmath.Point3f kV1, javax.vecmath.Point3f kV2, int iX, int iY) Compute the point of intersection between a line (iX,iY,0)+t(0,0,1) and the triangle defined by the three input points. All calculations are in voxel coordinates and the z-value of the intersection point is truncated to an integer.- Parameters:
kV0- a 3D vertex of the trianglekV1- a 3D vertex of the trianglekV2- a 3D vertex of the triangleiX- the x-value of the origin of the lineiY- the y-value of the origin of the line- Returns:
- the z-value of the intersection
-
getShape
protected javax.media.j3d.Shape3D getShape(javax.media.j3d.BranchGroup root) Get the shape burning point surface.- Parameters:
root- Burning point branchGroup- Returns:
- Shape3D Shape object
-
markProbe
protected javax.media.j3d.BranchGroup markProbe()Mark the probing guide line.- Returns:
- BranchGroup return the guide line root reference.
-
reGenerateEllipsoidMesh
protected void reGenerateEllipsoidMesh(int iSubdivisions, float tipLen, boolean isImageSpace, javax.vecmath.Point3f center, javax.media.j3d.Transform3D centerTransform) Tessellate a unit sphere centered at the origin. Start with an octahedron and subdivide. The final mesh is then affinely mapped to the initial ellipsoid produced by estimateEllipsoid(). The subdivision scheme is described in BrainExtraction.pdf.- Parameters:
iSubdivisions- the number of levels to subdivide the ellipsoidtipLen- float the tip lengthisImageSpace- is image space, always truecenter- Point3f burning center point coordinatecenterTransform- burning center transform
-
reGenerateSphereMesh
protected void reGenerateSphereMesh(int iSubdivisions, javax.vecmath.Point3f center, javax.media.j3d.Transform3D centerTransform) Tessellate a unit sphere centered at the origin. Start with an octahedron and subdivide. The final mesh is then affinely mapped to the initial ellipsoid produced by estimateEllipsoid(). The subdivision scheme is described in BrainExtraction.pdf.- Parameters:
iSubdivisions- the number of levels to subdivide the ellipsoidcenter- Point3f burning center point coordinatecenterTransform- burning center transform
-
setMaskBurnVector
Initialize the mask burning vector.- Parameters:
_vector- MaskBurnVector reference.
-
setVolumeMask
Initial the volume mask from burnBase.- Parameters:
_volumeMask- byte[] array volume mask array.
-