Class VolumeImageMultiDimensionalTransfer
- java.lang.Object
-
- WildMagic.LibApplications.OpenGLApplication.Application
-
- WildMagic.LibApplications.OpenGLApplication.JavaApplication
-
- WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeImageViewer
-
- gov.nih.mipav.view.renderer.WildMagic.Render.MultiDimensionalTransfer.VolumeImageMultiDimensionalTransfer
-
- All Implemented Interfaces:
com.jogamp.opengl.GLEventListener
,java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.io.Serializable
,java.util.EventListener
public class VolumeImageMultiDimensionalTransfer extends VolumeImageViewer implements com.jogamp.opengl.GLEventListener, java.awt.event.KeyListener
This class implements the 2D Histogram display and user-interaction widget in the JPanelMultiDimensionalTransfer class. The widget is displayed with a GLCanvas with a screen-space polygon displaying the 2D Histogram texture as the background. The user can add ClassificationWidgets to the canvas and change their location and size as well as color and blending parameters. This class provides the display and user-interaction for those widgets. The widget parameters are then passed to the Volume Renderer GLSL program in the VolumeRayCast class where they determine how the volume is displayed.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JPanel
container
main container for this object:private java.util.Vector<ClassificationWidget>
m_akWidgets
The list of widgets displayed on the 2D Histogram.private boolean
m_bAdded
When true a new Widget was added with the mouse.private boolean
m_bFirstAdded
private boolean
m_bPickPending
When true there is a pending mouse pick to process.private boolean
m_bUpdateLev
private int
m_iCurrent
The ID of the active and previously active widget.private int
m_iLUTIndex
private int
m_iMouseButton
Stores which button was pressed during mouse drag.private int
m_iMouseX
Stores the mouse position for picking.private int
m_iMouseY
Stores the mouse position for picking.private int
m_iPicked
The ID of theprivate int
m_iPrevious
The ID of the active and previously active widget.private WildMagic.LibFoundation.Mathematics.ColorRGBA
m_kCurrentColor
The current color to use to create a new Widget.private JInterfaceBase
m_kInterface
Reference to the containing JPanel.private WildMagic.LibFoundation.Mathematics.Vector2f
m_kTMax
private WildMagic.LibFoundation.Mathematics.Vector2f
m_kTMin
The bounds on the 2D Histogram texture coordinates used to display the 2D Histogram.private java.lang.String
m_kWidgetType
Defines the current selected widget type.int
MAX_WIDGETS
The maximum number of widgets that can be added to the display.private static long
serialVersionUID
-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeImageViewer
dpiScale, m_bDisplay, m_bDispose, m_bInit, m_iScreenCaptureCounter, m_iSlice, m_kAnimator, m_kCull, m_kCuller, m_kFrame, m_kParent, m_kVolumeImage, m_pkPlane, m_spkEffect, m_spkScene, startTime
-
Fields inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
cameraParams, m_akWorldAxis, m_bCameraMoveable, m_bDArrowPressed, m_bEndPressed, m_bHomePressed, m_bLArrowPressed, m_bLInsertPressed, m_bObjectZoomed, m_bPgDnPressed, m_bPgUpPressed, m_bRArrowPressed, m_bRDeletePressed, m_bTrackBallDown, m_bUArrowPressed, m_bUseTrackBall, m_dAccumulatedTime, m_dFrameRate, m_dLastTime, m_fRotSpeed, m_fRotSpeedFactor, m_fTrnSpeed, m_fTrnSpeedFactor, m_fXDrag0, m_fXTrack0, m_fXTrack1, m_fYDrag0, m_fYTrack0, m_fYTrack1, m_fZoomSpeed, m_iAccumulatedFrameCount, m_iDoPitch, m_iDoRoll, m_iDoYaw, m_iFrameCount, m_iMaxTimer, m_iTimer, m_kSaveRotate, m_mouseRotSpeed, m_spkCamera, m_spkMotionObject, pitchRotationAngle, rollRotationAngle, xCameraMove, xCameraTurn, yawRotationAngle, yCameraMove, yCameraTurn, zCameraMove
-
-
Constructor Summary
Constructors Constructor Description VolumeImageMultiDimensionalTransfer(com.jogamp.opengl.util.Animator animator, com.jogamp.opengl.awt.GLCanvas canvas, double dpiScale, VolumeTriPlanarInterface kParentFrame, VolumeImage kVolumeImage)
Create a new VolumeImageMultiDimensionalTranfer display.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAllWidgets()
private void
createContainer(com.jogamp.opengl.awt.GLCanvas canvas)
Creates the containing JPanel that will display this object.protected void
CreatePlaneNode()
protected void
CreateScene()
void
display()
Set the display to true and call GLCanvas.display;void
display(com.jogamp.opengl.GLAutoDrawable arg0)
void
dispose()
void
dispose(com.jogamp.opengl.GLAutoDrawable arg0)
javax.swing.JPanel
getContainingPanel()
Returns the container for this object.java.util.Vector<ClassificationWidget>
getM_akLev()
int
getPicked()
Returns the ID of the currently picked Widget.java.util.Vector<ClassificationWidget>
getWidgets()
Returns the current Widgets.void
init(com.jogamp.opengl.GLAutoDrawable arg0)
void
keyPressed(java.awt.event.KeyEvent kKey)
keyPressed callback.void
load(java.lang.String fileName)
static VolumeImageMultiDimensionalTransfer
main(com.jogamp.opengl.awt.GLCanvas kCanvas, double dpiScale, VolumeTriPlanarInterface kParent, VolumeImage kVolumeImageA, boolean displayInSeparateFrame)
Iridescence.main creates the Iridescence object and window frame to contain the GLCanvas.void
mouseDragged(java.awt.event.MouseEvent e)
void
mouseMoved(java.awt.event.MouseEvent e)
void
mousePressed(java.awt.event.MouseEvent e)
void
mouseReleased(java.awt.event.MouseEvent e)
protected void
Pick(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Determine which widget is selected with the mouse/void
reshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight)
void
save(java.lang.String fileName)
void
setAlpha(float fAlpha)
void
setBoundary(float fAlpha)
Sets the contribution of the 2nd derivative on the volume rendering for this widget.void
setColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Sets the color of the color transfer function for this widget.void
SetInterface(JInterfaceBase kInterface)
Sets the parent container panel:void
setPicked(int value)
Sets the current picked ID.void
setWidget(java.lang.String kWidgetType)
Sets the widget type for new widgets.void
setWidgets(java.util.Vector<ClassificationWidget> kWidgetList)
Sets the list of Widgets.void
update(java.lang.String kCommand)
private void
updateLev()
Updates the scene graph after a new list of widgets is added.-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeImageViewer
computeElapsedTime, displayChanged, GetCanvas, main, SetAnimator, SetFrame, setStartTime, UpdateSlice, writeImage
-
Methods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
DrawFrameRate, getCameraLocation, getCameraParameters, getObjectParameters, getObjectRotation, InitializeCameraMotion, InitializeCameraMotion, InitializeObjectMotion, keyReleased, keyTyped, LookDown, LookUp, MeasureTime, mouseClicked, mouseEntered, mouseExited, mouseWheelMoved, MoveBackward, MoveCamera, MoveDown, MoveForward, MoveLeft, MoveObject, MoveRight, MoveUp, OnDisplay, OnInitialize, OnTerminate, ResetTime, RotateTrackBall, setCameraLocation, setCameraParameters, setObjectParameters, setObjectRotation, TurnLeft, TurnRight, UpdateCameraRotationSpeed, UpdateCameraTranslationSpeed, UpdateCameraZoomSpeed, UpdateFrameCount, UpdateMouseRotationSpeed
-
Methods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication
GetAspectRatio, GetHeight, GetRenderer, GetWidth, GetWindowTitle, GetXPosition, GetYPosition, OnIdle, OnMove, OnPrecreate, OnResize, SetRenderer
-
Methods inherited from class WildMagic.LibApplications.OpenGLApplication.Application
reloadShaders, TestStreaming
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
MAX_WIDGETS
public int MAX_WIDGETS
The maximum number of widgets that can be added to the display. More can be added, but then the Volume Renderer GLSL program should be changed to add the new widgets.
-
container
private javax.swing.JPanel container
main container for this object:
-
m_iMouseButton
private int m_iMouseButton
Stores which button was pressed during mouse drag.
-
m_iMouseX
private int m_iMouseX
Stores the mouse position for picking.
-
m_iMouseY
private int m_iMouseY
Stores the mouse position for picking.
-
m_kTMin
private WildMagic.LibFoundation.Mathematics.Vector2f m_kTMin
The bounds on the 2D Histogram texture coordinates used to display the 2D Histogram. The texture coordinates are clamped to show only the portions of the texture that are above a threshold value.
-
m_kTMax
private WildMagic.LibFoundation.Mathematics.Vector2f m_kTMax
-
m_akWidgets
private java.util.Vector<ClassificationWidget> m_akWidgets
The list of widgets displayed on the 2D Histogram.
-
m_iCurrent
private int m_iCurrent
The ID of the active and previously active widget.
-
m_iPrevious
private int m_iPrevious
The ID of the active and previously active widget.
-
m_iPicked
private int m_iPicked
The ID of the
-
m_bPickPending
private boolean m_bPickPending
When true there is a pending mouse pick to process.
-
m_kCurrentColor
private WildMagic.LibFoundation.Mathematics.ColorRGBA m_kCurrentColor
The current color to use to create a new Widget.
-
m_bAdded
private boolean m_bAdded
When true a new Widget was added with the mouse.
-
m_kInterface
private JInterfaceBase m_kInterface
Reference to the containing JPanel.
-
m_kWidgetType
private java.lang.String m_kWidgetType
Defines the current selected widget type.
-
m_bFirstAdded
private boolean m_bFirstAdded
-
m_bUpdateLev
private boolean m_bUpdateLev
-
m_iLUTIndex
private int m_iLUTIndex
-
-
Constructor Detail
-
VolumeImageMultiDimensionalTransfer
public VolumeImageMultiDimensionalTransfer(com.jogamp.opengl.util.Animator animator, com.jogamp.opengl.awt.GLCanvas canvas, double dpiScale, VolumeTriPlanarInterface kParentFrame, VolumeImage kVolumeImage)
Create a new VolumeImageMultiDimensionalTranfer display.- Parameters:
canvas
- The canvas to use for the display. The canvas shares a context with the VolumeTriPlanarRenderer.kParentFrame
- parent frame.kVolumeImage
- the VolumeImage with the associated 2D Histogram.
-
-
Method Detail
-
main
public static VolumeImageMultiDimensionalTransfer main(com.jogamp.opengl.awt.GLCanvas kCanvas, double dpiScale, VolumeTriPlanarInterface kParent, VolumeImage kVolumeImageA, boolean displayInSeparateFrame)
Iridescence.main creates the Iridescence object and window frame to contain the GLCanvas. An Animator object is created with the GLCanvas as an argument. The Animator provides the same function as the glutMainLoop() function call commonly used in OpenGL applications.
-
clearAllWidgets
public void clearAllWidgets()
-
display
public void display()
Set the display to true and call GLCanvas.display;
-
display
public void display(com.jogamp.opengl.GLAutoDrawable arg0)
- Specified by:
display
in interfacecom.jogamp.opengl.GLEventListener
- Overrides:
display
in classVolumeImageViewer
-
dispose
public void dispose()
- Overrides:
dispose
in classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
dispose
public void dispose(com.jogamp.opengl.GLAutoDrawable arg0)
- Specified by:
dispose
in interfacecom.jogamp.opengl.GLEventListener
- Overrides:
dispose
in classVolumeImageViewer
-
getContainingPanel
public javax.swing.JPanel getContainingPanel()
Returns the container for this object. The container has a scroll pane and slider for the depth.- Returns:
-
getM_akLev
public java.util.Vector<ClassificationWidget> getM_akLev()
-
getPicked
public int getPicked()
Returns the ID of the currently picked Widget.- Returns:
- the ID of the currently picked Widget.
-
getWidgets
public java.util.Vector<ClassificationWidget> getWidgets()
Returns the current Widgets.- Returns:
- the current Widgets.
-
init
public void init(com.jogamp.opengl.GLAutoDrawable arg0)
- Specified by:
init
in interfacecom.jogamp.opengl.GLEventListener
- Overrides:
init
in classVolumeImageViewer
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent kKey)
keyPressed callback.- Specified by:
keyPressed
in interfacejava.awt.event.KeyListener
- Overrides:
keyPressed
in classVolumeImageViewer
- Parameters:
kKey
- the KeyEvent triggering the callback.
-
load
public void load(java.lang.String fileName)
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMoved
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseMoved
in classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
reshape
public void reshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight)
- Specified by:
reshape
in interfacecom.jogamp.opengl.GLEventListener
- Overrides:
reshape
in classVolumeImageViewer
-
save
public void save(java.lang.String fileName)
-
setAlpha
public void setAlpha(float fAlpha)
-
setBoundary
public void setBoundary(float fAlpha)
Sets the contribution of the 2nd derivative on the volume rendering for this widget.- Parameters:
fAlpha
- the contribution of the 2nd derivative on the volume rendering for this widget.
-
setColor
public void setColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
Sets the color of the color transfer function for this widget.- Parameters:
kColor
- the color of the color transfer function for this widget.
-
SetInterface
public void SetInterface(JInterfaceBase kInterface)
Sets the parent container panel:- Parameters:
kInterface
-
-
setPicked
public void setPicked(int value)
Sets the current picked ID.- Parameters:
value
-
-
setWidget
public void setWidget(java.lang.String kWidgetType)
Sets the widget type for new widgets.- Parameters:
kWidgetType
-
-
setWidgets
public void setWidgets(java.util.Vector<ClassificationWidget> kWidgetList)
Sets the list of Widgets.- Parameters:
kWidgetList
-
-
update
public void update(java.lang.String kCommand)
-
createContainer
private void createContainer(com.jogamp.opengl.awt.GLCanvas canvas)
Creates the containing JPanel that will display this object. The JPanel contains a scroll pane with both horizontal and vertical scroll bars and a horizontal slider for changing where the slice plane intersects the volume in depth.- Parameters:
imageComponent
-
-
CreatePlaneNode
protected void CreatePlaneNode()
- Overrides:
CreatePlaneNode
in classVolumeImageViewer
-
CreateScene
protected void CreateScene()
- Overrides:
CreateScene
in classVolumeImageViewer
-
Pick
protected void Pick(WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Determine which widget is selected with the mouse/
-
updateLev
private void updateLev()
Updates the scene graph after a new list of widgets is added.
-
-