Package mgui.interfaces.shapes.volume
Class Volume3DTexture
java.lang.Object
mgui.interfaces.shapes.volume.Volume3DTexture
- All Implemented Interfaces:
org.jogamp.java3d.ImageComponent3D.Updater
public class Volume3DTexture
extends java.lang.Object
implements org.jogamp.java3d.ImageComponent3D.Updater
Class to create and return Texture3D and TexCoordGeneration objects from a given
set of grid data.
- Author:
- Andrew Reid
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Volume3DTexture.UpdateTextureType
-
Field Summary
Fields Modifier and Type Field Description protected boolean
byRef
protected int
colorSpace
protected ColourMap
colourMap
protected java.awt.image.BufferedImage[]
images
protected int
rDim
protected int
sDim
protected int
tDim
protected org.jogamp.java3d.Texture3D
texture
static int
TYPE_INTENSITY_CMAP
static int
TYPE_INTENSITY_CMAP_ALPHA
static int
TYPE_INTENSITY_GREY
static int
TYPE_INTENSITY_GREY_ALPHA
static int
TYPE_RGB
static int
TYPE_RGB_ALPHA
-
Constructor Summary
Constructors Constructor Description Volume3DTexture(int s, int t, int r)
Volume3DTexture(Volume3DInt volume)
Volume3DTexture(Volume3DInt volume, ColourMap cmap)
-
Method Summary
Modifier and Type Method Description java.awt.image.BufferedImage[]
getByRefImages()
protected java.awt.color.ColorSpace
getColourSpace()
protected int
getFormat()
void
loadImage(int r0, int r1, java.net.URL image)
void
loadImage(int r0, int r1, java.net.URL image, boolean setAlpha, double cutoff, double exp)
Loads an image file at the given url into the texture for planes r0 through r1.protected void
resetImageComponent()
protected void
resetTexture()
void
setCurrentColumn(GridVertexDataColumn column)
Sets the current data column for this texture.void
setCurrentComposite(Volume3DInt volume)
void
setCurrentMask(boolean[][][] mask)
Sets the current mask for this texture; usenull
for no mask.void
setCurrentUpdateType(Volume3DTexture.UpdateTextureType type)
Specifies what type of update will be performed by updateData(org.jogamp.java3d.ImageComponent3D,int,int,int,int,int).boolean
setFromVolume(Volume3DInt volume)
Set this volume from the specified grid.boolean
setFromVolume(Volume3DInt volume, boolean update)
Set this volume from the specified grid.protected void
setTexture()
Produces a stack of R-planar images fromvolume
, based upon the current data column and its associated colour map.void
updateData(org.jogamp.java3d.ImageComponent3D imageComponent, int r_index, int x, int y, int s_size, int t_size)
boolean
updateFromVolume(Volume3DInt volume)
Set this volume from the specified grid.boolean
updateFromVolume(Volume3DInt volume, boolean update)
Updates this volume from the specified grid.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
TYPE_INTENSITY_GREY
public static final int TYPE_INTENSITY_GREY- See Also:
- Constant Field Values
-
TYPE_INTENSITY_GREY_ALPHA
public static final int TYPE_INTENSITY_GREY_ALPHA- See Also:
- Constant Field Values
-
TYPE_INTENSITY_CMAP
public static final int TYPE_INTENSITY_CMAP- See Also:
- Constant Field Values
-
TYPE_INTENSITY_CMAP_ALPHA
public static final int TYPE_INTENSITY_CMAP_ALPHA- See Also:
- Constant Field Values
-
TYPE_RGB
public static final int TYPE_RGB- See Also:
- Constant Field Values
-
TYPE_RGB_ALPHA
public static final int TYPE_RGB_ALPHA- See Also:
- Constant Field Values
-
texture
protected org.jogamp.java3d.Texture3D texture -
sDim
protected int sDim -
tDim
protected int tDim -
rDim
protected int rDim -
colorSpace
protected int colorSpace -
colourMap
-
byRef
protected boolean byRef -
images
protected java.awt.image.BufferedImage[] images
-
-
Constructor Details
-
Volume3DTexture
-
Volume3DTexture
-
Volume3DTexture
public Volume3DTexture(int s, int t, int r)
-
-
Method Details
-
getByRefImages
public java.awt.image.BufferedImage[] getByRefImages() -
setFromVolume
Set this volume from the specified grid.- Parameters:
grid
-
-
setFromVolume
Set this volume from the specified grid.- Parameters:
grid
-update
- - Indicates that this is a by-reference update call
-
updateFromVolume
Set this volume from the specified grid.- Parameters:
grid
-
-
updateFromVolume
Updates this volume from the specified grid.- Parameters:
grid
-update
- - Indicates that this is a by-reference update call
-
setTexture
protected void setTexture()Produces a stack of R-planar images fromvolume
, based upon the current data column and its associated colour map.- Parameters:
volume
-
-
resetTexture
protected void resetTexture() -
getFormat
protected int getFormat() -
resetImageComponent
protected void resetImageComponent() -
getColourSpace
protected java.awt.color.ColorSpace getColourSpace() -
loadImage
public void loadImage(int r0, int r1, java.net.URL image) -
loadImage
public void loadImage(int r0, int r1, java.net.URL image, boolean setAlpha, double cutoff, double exp)Loads an image file at the given url into the texture for planes r0 through r1. If image does not match the dimensions s and t, it will be scaled to fit. If, for example: image.width < sDim, pixels will be inserted to fill the difference. If image.width > sDim, pixels will be removed to fit the image to this texture's dimensions.- Parameters:
r0
- Start r-plane into which to load the imager1
- End r-plane into which to load the imageimage
- URL of the image file to loadhasAlpha
- Determines whether to add/set an alpha channel to an RGB image.cutoff
- The value at which to cut alpha to zero, from 0 to 1 where 0 is completely transparent, and 1 is completely opaque.exp
- Determines the degree of the equation with which alpha proceeds from the cutoff to zero. i.e., determines smoothness of cutoff. A zero or negative value of exp specifies no smoothing.
-
setCurrentMask
public void setCurrentMask(boolean[][][] mask)Sets the current mask for this texture; usenull
for no mask.- Parameters:
mask
-
-
setCurrentColumn
Sets the current data column for this texture.- Parameters:
mask
-
-
setCurrentUpdateType
Specifies what type of update will be performed by updateData(org.jogamp.java3d.ImageComponent3D,int,int,int,int,int).- Parameters:
type
-
-
setCurrentComposite
-
updateData
public void updateData(org.jogamp.java3d.ImageComponent3D imageComponent, int r_index, int x, int y, int s_size, int t_size)- Specified by:
updateData
in interfaceorg.jogamp.java3d.ImageComponent3D.Updater
-