Package gov.nih.mipav.view.renderer.J3D
Class VolumeTexture
java.lang.Object
gov.nih.mipav.view.renderer.J3D.VolumeTexture
Defines 3D texture node for a volume of data. There is a large amount of commented out code. We were trying to have
the texture image updated dynamically (i.e., without having to remove the texture map from the scene, updating the
texture and putting back into the scene. This is slow and causes flicker. However, it turned out there is a bug in
Java3D that makes it impossible to update the texture dynamically. Therefore we left in the code until the bug has
been fixed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ModelImageReference to the image as ModelImage instance.private BufferedImage[]Image buffer for each image slice.protected intThis are the actual dimensions of the texture associated with each dimension of the volume.protected intDOCUMENT ME!protected intDOCUMENT ME!protected javax.vecmath.Vector4fThese vectors are used for mapping each coordinate from its real range into the range [0,1] where real coordinate 0 maps to texture coordinate 0, and real coordinate at the maximum sample index along that axis maps to 1.protected javax.vecmath.Vector4fDOCUMENT ME!protected javax.vecmath.Vector4fDOCUMENT ME!private javax.media.j3d.ImageComponent3DImage component 3D reference which contains the 3D texture volume.protected javax.vecmath.Vector4fThese are declared in the class to avoid allocating temporary instances each call into methods of this class.private javax.media.j3d.TexCoordGenerationin any direction.private javax.media.j3d.TexCoordGenerationDefault axis-aligned texture coordinate generation function.private javax.media.j3d.Texture3D3D texture of the entire volume. -
Constructor Summary
ConstructorsConstructorDescriptionVolumeTexture(ModelImage kVolume) Create texture(s) and automatic texture coordinate generation parameters for each slicing of the specified volume along each of the three axes. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidCreate a single 3D texture coordinate generation function.protected intdimPowerOfTwo(int dim) Convert the dimensions to Power of 2.voidSets all variables to null, disposes.protected voidfinalize()Call dispose.int[]getBufferedRaster(int sliceZ) Access texture data from the BufferedImage with given z slice number.javax.vecmath.Vector4fAccess functions for Mapping from texture coordinates to model coordinates and vice versa: getCoordMapX:javax.vecmath.Vector4fgetCoordMapY:javax.vecmath.Vector4fgetCoordMapZ:getImage()Get the current model image.javax.media.j3d.TexCoordGenerationAccess automatic texture coordinate generation parameters associated with volume for a 3D texture.javax.media.j3d.Texture3DAccess 3D texture object.protected voidRessample images to Power of 2.voidsetImageComponent(int sliceZ) Sets the image component3D to import changed slice data.voidsetTransform(javax.media.j3d.Transform3D kTransform) Apply the specified transform to the axis aligned texture.
-
Field Details
-
image
Reference to the image as ModelImage instance. -
m_iTextureSizeX
protected int m_iTextureSizeXThis are the actual dimensions of the texture associated with each dimension of the volume. -
m_iTextureSizeY
protected int m_iTextureSizeYDOCUMENT ME! -
m_iTextureSizeZ
protected int m_iTextureSizeZDOCUMENT ME! -
m_kCoordMapX
protected javax.vecmath.Vector4f m_kCoordMapXThese vectors are used for mapping each coordinate from its real range into the range [0,1] where real coordinate 0 maps to texture coordinate 0, and real coordinate at the maximum sample index along that axis maps to 1. -
m_kCoordMapY
protected javax.vecmath.Vector4f m_kCoordMapYDOCUMENT ME! -
m_kCoordMapZ
protected javax.vecmath.Vector4f m_kCoordMapZDOCUMENT ME! -
m_kTempPlane
protected javax.vecmath.Vector4f m_kTempPlaneThese are declared in the class to avoid allocating temporary instances each call into methods of this class. -
m_akImage
Image buffer for each image slice. -
m_kImageComponent
private javax.media.j3d.ImageComponent3D m_kImageComponentImage component 3D reference which contains the 3D texture volume. -
m_kTexCoordGeneration
private javax.media.j3d.TexCoordGeneration m_kTexCoordGenerationin any direction. (s,t,r) invalid input: '<'--> (X,Y,Z). -
m_kTexCoordGenerationAxisAligned
private javax.media.j3d.TexCoordGeneration m_kTexCoordGenerationAxisAlignedDefault axis-aligned texture coordinate generation function. -
m_kTexture
private javax.media.j3d.Texture3D m_kTexture3D texture of the entire volume.
-
-
Constructor Details
-
VolumeTexture
Create texture(s) and automatic texture coordinate generation parameters for each slicing of the specified volume along each of the three axes.- Parameters:
kVolume- volume for which to create the associated texture information
-
-
Method Details
-
disposeLocal
public void disposeLocal()Sets all variables to null, disposes. -
getBufferedRaster
public int[] getBufferedRaster(int sliceZ) Access texture data from the BufferedImage with given z slice number.- Parameters:
sliceZ- indicates the image slice that is to be set.- Returns:
- reference to integer array instance of texture data.
-
getCoordMapX
public javax.vecmath.Vector4f getCoordMapX()Access functions for Mapping from texture coordinates to model coordinates and vice versa: getCoordMapX:- Returns:
- DOCUMENT ME!
-
getCoordMapY
public javax.vecmath.Vector4f getCoordMapY()getCoordMapY:- Returns:
- DOCUMENT ME!
-
getCoordMapZ
public javax.vecmath.Vector4f getCoordMapZ()getCoordMapZ:- Returns:
- DOCUMENT ME!
-
getImage
Get the current model image.- Returns:
- image Current model image.
-
getTexCoordGeneration
public javax.media.j3d.TexCoordGeneration getTexCoordGeneration()Access automatic texture coordinate generation parameters associated with volume for a 3D texture.- Returns:
- requested automatic texture coordinate generation parameters
-
getTexture
public javax.media.j3d.Texture3D getTexture()Access 3D texture object.- Returns:
- Texture3D instance of the 3D texture of the image
-
setImageComponent
public void setImageComponent(int sliceZ) Sets the image component3D to import changed slice data.- Parameters:
sliceZ- indicates the image slice that is to be set.
-
setTransform
public void setTransform(javax.media.j3d.Transform3D kTransform) Apply the specified transform to the axis aligned texture.- Parameters:
kTransform- Transform3D
-
dimPowerOfTwo
protected int dimPowerOfTwo(int dim) Convert the dimensions to Power of 2.- Parameters:
dim- Dimension value.- Returns:
- dim Converted dimention value.
-
finalize
Call dispose. -
resampleImage
protected void resampleImage()Ressample images to Power of 2. -
createTexture
private void createTexture()Create a single 3D texture coordinate generation function.
-