visualize
Class RayCasting

java.lang.Object
  extended by visualize.RayCasting

public class RayCasting
extends java.lang.Object

The Class RayCasting is used for computing the 3-D view using RayCasting or Maximum-Intensity-Projection.

Version:
1.44
Author:
Fabian Hollaus, Markus Diem

Field Summary
static int FBO_BACK
           
static int FBO_FRONT
           
static int FBO_TEXTURE_BACK
           
static int FBO_TEXTURE_FRONT
           
static int GRADIENT_TEX
           
static int T_COLORS
           
static int VOLUME_TEX
           
static int X_DIR
           
static int Y_DIR
           
static int Z_DIR
           
 
Constructor Summary
RayCasting(javax.media.opengl.glu.GLU glu)
          Creates a new RayCasting-object.
 
Method Summary
static void checkLogInfo(javax.media.opengl.GL gl, int shader)
          Prints out the Info-Log of the shader passed in.
 void createFBO(javax.media.opengl.GL gl)
          For raycasting the coordinates of the rays are needed.
 void initShader(javax.media.opengl.GL gl)
          Loads the vertex-shader from raycasting.vsh and the fragment-shader from raycasting.fsh.
 void render(javax.media.opengl.GL gl)
          Is called continuously when the raycasting tab in the MainForm is activated and renders the 3-D Scene to the screen.
static void setShader(boolean mip)
          Defines if raycasting or Maximum-Intensity-Projection is used in the fragment-shader.
static void setStepSize(int stepS)
          Sets the step-size for computing the 3-D scene
 void setTexSize(float[] texSize)
          Sets the size of the volume-texture.
static void setTransferFunctionChanged(boolean transColors)
          Called when the transfer-function is changed by the user.
 void setVolumeTex(int[] volumeTex)
          Sets the volume-texture
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X_DIR

public static final int X_DIR
See Also:
Constant Field Values

Y_DIR

public static final int Y_DIR
See Also:
Constant Field Values

Z_DIR

public static final int Z_DIR
See Also:
Constant Field Values

FBO_TEXTURE_FRONT

public static final int FBO_TEXTURE_FRONT
See Also:
Constant Field Values

FBO_FRONT

public static final int FBO_FRONT
See Also:
Constant Field Values

FBO_TEXTURE_BACK

public static final int FBO_TEXTURE_BACK
See Also:
Constant Field Values

FBO_BACK

public static final int FBO_BACK
See Also:
Constant Field Values

T_COLORS

public static final int T_COLORS
See Also:
Constant Field Values

VOLUME_TEX

public static final int VOLUME_TEX
See Also:
Constant Field Values

GRADIENT_TEX

public static final int GRADIENT_TEX
See Also:
Constant Field Values
Constructor Detail

RayCasting

public RayCasting(javax.media.opengl.glu.GLU glu)
Creates a new RayCasting-object.

Parameters:
glu - provides access to the OpenGL Utility Library (GLU).
Method Detail

initShader

public void initShader(javax.media.opengl.GL gl)
Loads the vertex-shader from raycasting.vsh and the fragment-shader from raycasting.fsh. The two shaders are also compiled.

Parameters:
gl -

checkLogInfo

public static void checkLogInfo(javax.media.opengl.GL gl,
                                int shader)
Prints out the Info-Log of the shader passed in.

Parameters:
gl - basic interface to OpenGL
shader - shader which is going to be checked

createFBO

public void createFBO(javax.media.opengl.GL gl)
For raycasting the coordinates of the rays are needed. The coordinates are computed using a unitcube where the colors of the cube represent coordinates. The front- and back-face of the unitcube are stored in FrameBuffer-objects and those FrameBuffer-objects are created here.

Parameters:
gl - basic interface to OpenGL

render

public void render(javax.media.opengl.GL gl)
Is called continuously when the raycasting tab in the MainForm is activated and renders the 3-D Scene to the screen. To finish this task at first the front- and backface of the unitcube are computed, and are used later in computing the ray-vector in the fragment shader, where the volume-texture is rendered to screen.

Parameters:
gl - basic interface to OpenGL

setTexSize

public void setTexSize(float[] texSize)
Sets the size of the volume-texture.

Parameters:
texSize - texture-size in Float-array form.

setVolumeTex

public void setVolumeTex(int[] volumeTex)
Sets the volume-texture

Parameters:
volumeTex - volume-texture in integer-array form.

setShader

public static void setShader(boolean mip)
Defines if raycasting or Maximum-Intensity-Projection is used in the fragment-shader.

Parameters:
mip - Boolean describing if Maximum-Intensity-Projection is used or not.

setStepSize

public static void setStepSize(int stepS)
Sets the step-size for computing the 3-D scene

Parameters:
stepS - step-size in integer form.

setTransferFunctionChanged

public static void setTransferFunctionChanged(boolean transColors)
Called when the transfer-function is changed by the user.

Parameters:
transColors - If this boolean is true the content of the GradientColorPanel has changed. Otherwise the LineDrawPanel-content has changed.