Class MjCorticalMesh
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.brainflattenerview.MjCorticalMesh
-
public class MjCorticalMesh extends java.lang.Object
DOCUMENT ME!
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MjCorticalMesh.Edge
DOCUMENT ME!static class
MjCorticalMesh.Polylines
DOCUMENT ME!static class
MjCorticalMesh.Triangle
DOCUMENT ME!static class
MjCorticalMesh.Vertex
DOCUMENT ME!
-
Field Summary
Fields Modifier and Type Field Description private float[]
m_afAvrConvexity
DOCUMENT ME!private float[]
m_afMeanCurvature
DOCUMENT ME!private int[]
m_aiConnect
DOCUMENT ME!private javax.vecmath.Color4f[]
m_akColor
DOCUMENT ME!private javax.vecmath.Point3f[]
m_akCylinder
projection of sphere onto cylinder.private MjCorticalMesh.Edge[]
m_akEdge
DOCUMENT ME!private MjVector3f[]
m_akNormal
DOCUMENT ME!private javax.vecmath.Point2f[]
m_akPlane
Conformal mapping to a plane.private javax.vecmath.Point3f[]
m_akPoint
mesh attributes.private javax.vecmath.Point3f[]
m_akSphere
Conformal mapping to a sphere. rho is the radius of the stereographic sphere.private MjCorticalMesh.Triangle[]
m_akTriangle
DOCUMENT ME!private MjCorticalMesh.Vertex[]
m_akVertex
DOCUMENT ME!private float
m_fMaxAvrConvexity
DOCUMENT ME!private float
m_fMaxDistance
DOCUMENT ME!private float
m_fMaxMeanCurvature
DOCUMENT ME!private float
m_fMinAvrConvexity
DOCUMENT ME!private float
m_fMinDistance
DOCUMENT ME!private float
m_fMinMeanCurvature
DOCUMENT ME!private float
m_fRho
DOCUMENT ME!private float
m_fSurfaceArea
DOCUMENT ME!private int
m_iEQuantity
DOCUMENT ME!private int
m_iPunctureTri
The index of the puncture triangle for computing the conformal mapping:.private int
m_iTQuantity
DOCUMENT ME!private int
m_iVQuantity
mesh topology.private java.util.HashMap
m_kDistance
vertex-vertex distances measured along edge paths.private java.util.HashMap
m_kInitDistance
surface inflation.private javax.vecmath.Point2f
m_kPlaneMax
DOCUMENT ME!private javax.vecmath.Point2f
m_kPlaneMin
DOCUMENT ME!
-
Constructor Summary
Constructors Constructor Description MjCorticalMesh(int iVQuantity, javax.vecmath.Point3f[] akPoint, int iTQuantity, int[] aiConnect)
Creates a new MjCorticalMesh object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeConformalMapping()
conformal mapping of mesh to plane and sphere, projection to cylinder.private void
computeDistance(int iSize, int iSource, boolean bInitiator)
compute distances within specified neighborhood size (size >= 1).void
computeDistances(int iSize)
Computes the distances of vertex pairsfor which an edge-path exists with at most iSize edges. private void
computeExtremes()
DOCUMENT ME!void
computeMeanCurvature()
mean curvature.void
computeNormals()
compute vertex normals as averages of triangle normals.private float
computeRadius(MjVector2f kV0, MjVector2f kV1, MjVector2f kV2, float fAreaFraction)
DOCUMENT ME!void
computeSurfaceArea()
surface area of the mesh (input mesh is closed, manifold).private static boolean
contains(javax.vecmath.Point2f[] akVertex, javax.vecmath.Point2f kP)
support for point-in-triangle tests; The akVertex array must have length 3.void
disposeLocal()
DOCUMENT ME!float
doInflation(int iOperation)
surface inflation operation 0 = initialize 1 = inflate 2 = terminate.private float
doInflationStep()
surface inflation.protected void
finalize()
DOCUMENT ME!float[]
getAvrConvexity()
DOCUMENT ME!private javax.vecmath.Point3f
getBarycentric(javax.vecmath.Point2f kP, int i)
Support for conformal mapping to planar triangle mesh.javax.vecmath.Color4f[]
getColorCopy()
DOCUMENT ME!javax.vecmath.Color4f[]
getColors()
DOCUMENT ME!int[]
getConnectivity()
DOCUMENT ME!int[]
getConnectivityCopy()
DOCUMENT ME!private int
getContainingTriangle(javax.vecmath.Point2f kP, int iStart)
Support for conformal mapping to planar triangle mesh.javax.vecmath.Point3f[]
getCylinderCoordinates()
DOCUMENT ME!float
getDistance(int iV0, int iV1)
Vertex-vertex distance measured along the shortest edge-path connecting the two vertices.java.util.HashMap
getDistanceMap()
access to the distance map - stored in map from MjEdgeKey to Float.MjCorticalMesh.Edge[]
getEdges()
DOCUMENT ME!int
getEQuantity()
DOCUMENT ME!MjCorticalMesh.Polylines
getLatitude(float fZNormal, float fMBias, float fSBias, float fPBias)
Produce polylines that are superimposed on the input cortical mesh, sphere, and plane.MjCorticalMesh.Polylines
getLongitude(float fAngle, float fMBias, float fSBias, float fPBias)
DOCUMENT ME!float
getMaxAvrConvexity()
DOCUMENT ME!float
getMaxDistance()
DOCUMENT ME!float
getMaxMeanCurvature()
DOCUMENT ME!float[]
getMeanCurvature()
DOCUMENT ME!float
getMinAvrConvexity()
DOCUMENT ME!float
getMinDistance()
DOCUMENT ME!float
getMinMeanCurvature()
DOCUMENT ME!javax.vecmath.Vector3f[]
getNormalCopy()
DOCUMENT ME!MjVector3f[]
getNormals()
DOCUMENT ME!javax.vecmath.Point2f[]
getPlaneCoordinates()
DOCUMENT ME!javax.vecmath.Point2f
getPlaneMax()
DOCUMENT ME!javax.vecmath.Point2f
getPlaneMin()
DOCUMENT ME!javax.vecmath.Point3f[]
getPointCopy()
DOCUMENT ME!javax.vecmath.Point3f[]
getPoints()
attribute member access.javax.vecmath.Point3f[]
getSphereCoordinates()
DOCUMENT ME!private float
getStereographicRadius()
support for unfolding.float
getSurfaceArea()
DOCUMENT ME!int
getTQuantity()
DOCUMENT ME!MjCorticalMesh.Triangle[]
getTriangles()
DOCUMENT ME!MjCorticalMesh.Vertex[]
getVertices()
DOCUMENT ME!int
getVQuantity()
topology member access.float
scaleToCube()
uniformly scale points to [-1,1]^3, originally in [min,max]^3 returns 2D vector with (min,max) as the elements public Vector2f scaleToCube ().void
setPunctureTriangle(int[] aiIndex)
Set the index of the triangle used to "puncture" the mesh before the conformal mapping is computed.
-
-
-
Field Detail
-
m_afAvrConvexity
private float[] m_afAvrConvexity
DOCUMENT ME!
-
m_afMeanCurvature
private float[] m_afMeanCurvature
DOCUMENT ME!
-
m_aiConnect
private int[] m_aiConnect
DOCUMENT ME!
-
m_akColor
private javax.vecmath.Color4f[] m_akColor
DOCUMENT ME!
-
m_akCylinder
private javax.vecmath.Point3f[] m_akCylinder
projection of sphere onto cylinder.
-
m_akEdge
private MjCorticalMesh.Edge[] m_akEdge
DOCUMENT ME!
-
m_akNormal
private MjVector3f[] m_akNormal
DOCUMENT ME!
-
m_akPlane
private javax.vecmath.Point2f[] m_akPlane
Conformal mapping to a plane. The (u,v) points correspond to the (x,y,z) mesh points.
-
m_akPoint
private javax.vecmath.Point3f[] m_akPoint
mesh attributes.
-
m_akSphere
private javax.vecmath.Point3f[] m_akSphere
Conformal mapping to a sphere. rho is the radius of the stereographic sphere.
-
m_akTriangle
private MjCorticalMesh.Triangle[] m_akTriangle
DOCUMENT ME!
-
m_akVertex
private MjCorticalMesh.Vertex[] m_akVertex
DOCUMENT ME!
-
m_fMaxAvrConvexity
private float m_fMaxAvrConvexity
DOCUMENT ME!
-
m_fMaxDistance
private float m_fMaxDistance
DOCUMENT ME!
-
m_fMaxMeanCurvature
private float m_fMaxMeanCurvature
DOCUMENT ME!
-
m_fMinAvrConvexity
private float m_fMinAvrConvexity
DOCUMENT ME!
-
m_fMinDistance
private float m_fMinDistance
DOCUMENT ME!
-
m_fMinMeanCurvature
private float m_fMinMeanCurvature
DOCUMENT ME!
-
m_fRho
private float m_fRho
DOCUMENT ME!
-
m_fSurfaceArea
private float m_fSurfaceArea
DOCUMENT ME!
-
m_iEQuantity
private int m_iEQuantity
DOCUMENT ME!
-
m_iPunctureTri
private int m_iPunctureTri
The index of the puncture triangle for computing the conformal mapping:.
-
m_iTQuantity
private int m_iTQuantity
DOCUMENT ME!
-
m_iVQuantity
private int m_iVQuantity
mesh topology.
-
m_kDistance
private java.util.HashMap m_kDistance
vertex-vertex distances measured along edge paths.
-
m_kInitDistance
private java.util.HashMap m_kInitDistance
surface inflation.
-
m_kPlaneMax
private javax.vecmath.Point2f m_kPlaneMax
DOCUMENT ME!
-
m_kPlaneMin
private javax.vecmath.Point2f m_kPlaneMin
DOCUMENT ME!
-
-
Method Detail
-
computeConformalMapping
public void computeConformalMapping()
conformal mapping of mesh to plane and sphere, projection to cylinder.
-
computeDistances
public void computeDistances(int iSize)
Computes the distances of vertex pairsfor which an edge-path exists with at most iSize edges. - Parameters:
iSize
- DOCUMENT ME!
-
computeMeanCurvature
public void computeMeanCurvature()
mean curvature.
-
computeNormals
public void computeNormals()
compute vertex normals as averages of triangle normals.
-
computeSurfaceArea
public void computeSurfaceArea()
surface area of the mesh (input mesh is closed, manifold).
-
disposeLocal
public void disposeLocal()
DOCUMENT ME!
-
doInflation
public float doInflation(int iOperation)
surface inflation operation 0 = initialize 1 = inflate 2 = terminate.- Parameters:
iOperation
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getAvrConvexity
public float[] getAvrConvexity()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getColorCopy
public javax.vecmath.Color4f[] getColorCopy()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getColors
public javax.vecmath.Color4f[] getColors()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getConnectivity
public int[] getConnectivity()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getConnectivityCopy
public int[] getConnectivityCopy()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getCylinderCoordinates
public javax.vecmath.Point3f[] getCylinderCoordinates()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getDistance
public float getDistance(int iV0, int iV1)
Vertex-vertex distance measured along the shortest edge-path connecting the two vertices.- Parameters:
iV0
- DOCUMENT ME!iV1
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getDistanceMap
public java.util.HashMap getDistanceMap()
access to the distance map - stored in map from MjEdgeKey to Float.- Returns:
- DOCUMENT ME!
-
getEdges
public MjCorticalMesh.Edge[] getEdges()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getEQuantity
public int getEQuantity()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getLatitude
public MjCorticalMesh.Polylines getLatitude(float fZNormal, float fMBias, float fSBias, float fPBias)
Produce polylines that are superimposed on the input cortical mesh, sphere, and plane. The znormal value indicates the z-slice on the unit sphere that is mapped to the polyline on the mesh. This value is in (-1,1). The angle value indicates the theta-slice on the unit sphere, theta measured as a positive angle counterclockwise from the x-axis towards the y-axis. This value is in [0,2*pi]. The bias value adds a small amount to the polyline to raise it above the mesh surface to avoid z-buffer fighting.- Parameters:
fZNormal
- DOCUMENT ME!fMBias
- DOCUMENT ME!fSBias
- DOCUMENT ME!fPBias
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getLongitude
public MjCorticalMesh.Polylines getLongitude(float fAngle, float fMBias, float fSBias, float fPBias)
DOCUMENT ME!- Parameters:
fAngle
- DOCUMENT ME!fMBias
- DOCUMENT ME!fSBias
- DOCUMENT ME!fPBias
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getMaxAvrConvexity
public float getMaxAvrConvexity()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getMaxDistance
public float getMaxDistance()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getMaxMeanCurvature
public float getMaxMeanCurvature()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getMeanCurvature
public float[] getMeanCurvature()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getMinAvrConvexity
public float getMinAvrConvexity()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getMinDistance
public float getMinDistance()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getMinMeanCurvature
public float getMinMeanCurvature()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getNormalCopy
public javax.vecmath.Vector3f[] getNormalCopy()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getNormals
public MjVector3f[] getNormals()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPlaneCoordinates
public javax.vecmath.Point2f[] getPlaneCoordinates()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPlaneMax
public javax.vecmath.Point2f getPlaneMax()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPlaneMin
public javax.vecmath.Point2f getPlaneMin()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPointCopy
public javax.vecmath.Point3f[] getPointCopy()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPoints
public javax.vecmath.Point3f[] getPoints()
attribute member access.- Returns:
- DOCUMENT ME!
-
getSphereCoordinates
public javax.vecmath.Point3f[] getSphereCoordinates()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getSurfaceArea
public float getSurfaceArea()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getTQuantity
public int getTQuantity()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getTriangles
public MjCorticalMesh.Triangle[] getTriangles()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getVertices
public MjCorticalMesh.Vertex[] getVertices()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getVQuantity
public int getVQuantity()
topology member access.- Returns:
- DOCUMENT ME!
-
scaleToCube
public float scaleToCube()
uniformly scale points to [-1,1]^3, originally in [min,max]^3 returns 2D vector with (min,max) as the elements public Vector2f scaleToCube ().- Returns:
- DOCUMENT ME!
-
setPunctureTriangle
public void setPunctureTriangle(int[] aiIndex)
Set the index of the triangle used to "puncture" the mesh before the conformal mapping is computed. The triangle is found based on the three index values that describe the triangle:- Parameters:
aiIndex
- DOCUMENT ME!
-
finalize
protected void finalize() throws java.lang.Throwable
DOCUMENT ME!- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
contains
private static boolean contains(javax.vecmath.Point2f[] akVertex, javax.vecmath.Point2f kP)
support for point-in-triangle tests; The akVertex array must have length 3.- Parameters:
akVertex
- DOCUMENT ME!kP
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
computeDistance
private void computeDistance(int iSize, int iSource, boolean bInitiator)
compute distances within specified neighborhood size (size >= 1).- Parameters:
iSize
- DOCUMENT ME!iSource
- DOCUMENT ME!bInitiator
- DOCUMENT ME!
-
computeExtremes
private void computeExtremes()
DOCUMENT ME!
-
computeRadius
private float computeRadius(MjVector2f kV0, MjVector2f kV1, MjVector2f kV2, float fAreaFraction)
DOCUMENT ME!- Parameters:
kV0
- DOCUMENT ME!kV1
- DOCUMENT ME!kV2
- DOCUMENT ME!fAreaFraction
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
doInflationStep
private float doInflationStep()
surface inflation.- Returns:
- DOCUMENT ME!
-
getBarycentric
private javax.vecmath.Point3f getBarycentric(javax.vecmath.Point2f kP, int i)
Support for conformal mapping to planar triangle mesh. Once the containing triangle i is found, compute the barycentric coordinates of P relative to the triangle vertices V0, V1, and V2.- Parameters:
kP
- DOCUMENT ME!i
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getContainingTriangle
private int getContainingTriangle(javax.vecmath.Point2f kP, int iStart)
Support for conformal mapping to planar triangle mesh. Use a linear walk to locate a triangle containing P. The index of such a triangle is returned, unless there is no containing triangle in which case the return value is -1. The "start" index is the suggested starting triangle. When testing a lot of points that are ordered in some spatial manner, the chance that the triangle containing the previous test point will contain the next test point (or a neighbor might contain it). Taking advantage of spatial coherence should speed up the search in "batch mode".- Parameters:
kP
- DOCUMENT ME!iStart
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getStereographicRadius
private float getStereographicRadius()
support for unfolding.- Returns:
- DOCUMENT ME!
-
-