Package gov.nih.mipav.model.structures
Class BSplineLattice2Df
java.lang.Object
gov.nih.mipav.model.structures.BSplineLattice2Df
This class manages a 2D lattice of control points given a discretized B-Spline basis for each axis.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WildMagic.LibFoundation.Mathematics.Vector2f[][]DOCUMENT ME!protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretefDOCUMENT ME!protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretefDOCUMENT ME! -
Constructor Summary
ConstructorsConstructorDescriptionBSplineLattice2Df(WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisX, WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisY) Create 2D lattice of control points given a discretized B-Spline basis for each axis. -
Method Summary
Modifier and TypeMethodDescriptioncreateImageMap(int iSizeX, int iSizeY) Create an image of the specified dimensions and fill it to contain a mapping of the coordinates based on the 2D lattice of B-spline control points.voidfinalize()Cleanup memory.WildMagic.LibFoundation.Curves.BSplineBasisDiscretefReturn the discretized B-Spline basis for the X axis.WildMagic.LibFoundation.Curves.BSplineBasisDiscretefReturn the discretized B-Spline basis for the Y axis.voidgetControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint) Retrieve the position of the specified control point.voidgetPosition(float fX, float fY, WildMagic.LibFoundation.Mathematics.Vector2f kPos) Return the B-Spline evaluation for the given input values.voidgetPosition(int iSampleX, int iSampleY, WildMagic.LibFoundation.Mathematics.Vector2f kPos) Return the B-Spline evaluation for the given input values.voidsetControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint) Set the position of the specified control point.
-
Field Details
-
m_aakControlPoint
protected WildMagic.LibFoundation.Mathematics.Vector2f[][] m_aakControlPointDOCUMENT ME! -
m_kBasisX
protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretef m_kBasisXDOCUMENT ME! -
m_kBasisY
protected WildMagic.LibFoundation.Curves.BSplineBasisDiscretef m_kBasisYDOCUMENT ME!
-
-
Constructor Details
-
BSplineLattice2Df
public BSplineLattice2Df(WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisX, WildMagic.LibFoundation.Curves.BSplineBasisDiscretef kBasisY) Create 2D lattice of control points given a discretized B-Spline basis for each axis. Initially, all of the control points are equally spaced.- Parameters:
kBasisX- BSplineBasisDiscretef B-Spline basis for the X axis.kBasisY- BSplineBasisDiscretef B-Spline basis for the Y axis.
-
-
Method Details
-
createImageMap
Create an image of the specified dimensions and fill it to contain a mapping of the coordinates based on the 2D lattice of B-spline control points.- Parameters:
iSizeX- int Number of samples along x axis of image.iSizeY- int Number of samples along y axis of image.- Returns:
- ModelSimpleImage[] Array of two ModelSimpleImage instances. The first one contains the x coordinate and the second contains the y coordinate for the map. Each image has default resolutions of 1 for each axis.
-
finalize
Cleanup memory. -
getBasisX
public WildMagic.LibFoundation.Curves.BSplineBasisDiscretef getBasisX()Return the discretized B-Spline basis for the X axis.- Returns:
- BSplineBasisDiscretef B-Spline basis.
-
getBasisY
public WildMagic.LibFoundation.Curves.BSplineBasisDiscretef getBasisY()Return the discretized B-Spline basis for the Y axis.- Returns:
- BSplineBasisDiscretef B-Spline basis.
-
getControlPoint
public void getControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint) Retrieve the position of the specified control point.- Parameters:
iControlX- int Identifies control point in 2D lattice.iControlY- int Identifies control point in 2D lattice.kPoint- Point2f Where the current coordinates of the control point will be stored upon return.
-
getPosition
public void getPosition(int iSampleX, int iSampleY, WildMagic.LibFoundation.Mathematics.Vector2f kPos) Return the B-Spline evaluation for the given input values. The evaluation is based on the 2D evaluation of the B-Spline basis (one for each axis) and the 2D lattice of control points.- Parameters:
iSampleX- int Sample index along X axis which determines an input value in the [0,1] for that axis' B-Spline basis evaluation.iSampleY- int Sample index along Y axis which determines an input value in the [0,1] for that axis' B-Spline basis evaluation.kPos- Point2f 2D coordinates resulting from evaluation.
-
getPosition
public void getPosition(float fX, float fY, WildMagic.LibFoundation.Mathematics.Vector2f kPos) Return the B-Spline evaluation for the given input values. The evaluation is based on the 2D evaluation of the B-Spline basis (one for each axis) and the 2D lattice of control points. This method is used for interpolating between the discrete samples.- Parameters:
fX- float Sample in [0,1] range for the X axis evaluation of the B-Spline basis.fY- float Sample in [0,1] range for the Y axis evaluation of the B-Spline basis.kPos- Point2f 2D coordinates resulting from evaluation.
-
setControlPoint
public void setControlPoint(int iControlX, int iControlY, WildMagic.LibFoundation.Mathematics.Vector2f kPoint) Set the position of the specified control point. No checks are made on the input coordinates of the control point.- Parameters:
iControlX- int Identifies control point in 2D lattice.iControlY- int Identifies control point in 2D lattice.kPoint- Point2f New coordinates of the control point.
-