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,KeyListener,MouseListener,MouseMotionListener,MouseWheelListener,Serializable,EventListener
public class VolumeImageMultiDimensionalTransfer
extends VolumeImageViewer
implements com.jogamp.opengl.GLEventListener, 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JPanelmain container for this object:private Vector<ClassificationWidget> The list of widgets displayed on the 2D Histogram.private booleanWhen true a new Widget was added with the mouse.private booleanprivate booleanWhen true there is a pending mouse pick to process.private booleanprivate intThe ID of the active and previously active widget.private intprivate intStores which button was pressed during mouse drag.private intStores the mouse position for picking.private intStores the mouse position for picking.private intThe ID of theprivate intThe ID of the active and previously active widget.private WildMagic.LibFoundation.Mathematics.ColorRGBAThe current color to use to create a new Widget.private JInterfaceBaseReference to the containing JPanel.private WildMagic.LibFoundation.Mathematics.Vector2fprivate WildMagic.LibFoundation.Mathematics.Vector2fThe bounds on the 2D Histogram texture coordinates used to display the 2D Histogram.private StringDefines the current selected widget type.intThe maximum number of widgets that can be added to the display.private static final longFields 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, startTimeFields 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, zCameraMoveFields inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication
m_acWindowTitle, m_eBuffering, m_eDepth, m_eFormat, m_eMultisampling, m_eStencil, m_iHeight, m_iWidth, m_iXPosition, m_iYPosition, m_kBackgroundColor, m_pkRenderer -
Constructor Summary
ConstructorsConstructorDescriptionVolumeImageMultiDimensionalTransfer(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
Modifier and TypeMethodDescriptionvoidprivate voidcreateContainer(com.jogamp.opengl.awt.GLCanvas canvas) Creates the containing JPanel that will display this object.protected voidprotected voidvoiddisplay()Set the display to true and call GLCanvas.display;voiddisplay(com.jogamp.opengl.GLAutoDrawable arg0) voiddispose()voiddispose(com.jogamp.opengl.GLAutoDrawable arg0) Returns the container for this object.intReturns the ID of the currently picked Widget.Returns the current Widgets.voidinit(com.jogamp.opengl.GLAutoDrawable arg0) voidkeyPressed(KeyEvent kKey) keyPressed callback.voidmain(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.voidvoidvoidvoidprotected voidPick(WildMagic.LibGraphics.Rendering.Renderer kRenderer) Determine which widget is selected with the mouse/voidreshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight) voidvoidsetAlpha(float fAlpha) voidsetBoundary(float fAlpha) Sets the contribution of the 2nd derivative on the volume rendering for this widget.voidsetColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor) Sets the color of the color transfer function for this widget.voidSetInterface(JInterfaceBase kInterface) Sets the parent container panel:voidsetPicked(int value) Sets the current picked ID.voidSets the widget type for new widgets.voidsetWidgets(Vector<ClassificationWidget> kWidgetList) Sets the list of Widgets.voidprivate voidUpdates 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, writeImageMethods 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, UpdateMouseRotationSpeedMethods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication
GetAspectRatio, GetHeight, GetRenderer, GetWidth, GetWindowTitle, GetXPosition, GetYPosition, OnIdle, OnMove, OnPrecreate, OnResize, SetRendererMethods inherited from class WildMagic.LibApplications.OpenGLApplication.Application
reloadShaders, TestStreamingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.awt.event.KeyListener
keyReleased, keyTyped
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
MAX_WIDGETS
public int MAX_WIDGETSThe 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
main container for this object: -
m_iMouseButton
private int m_iMouseButtonStores which button was pressed during mouse drag. -
m_iMouseX
private int m_iMouseXStores the mouse position for picking. -
m_iMouseY
private int m_iMouseYStores the mouse position for picking. -
m_kTMin
private WildMagic.LibFoundation.Mathematics.Vector2f m_kTMinThe 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
The list of widgets displayed on the 2D Histogram. -
m_iCurrent
private int m_iCurrentThe ID of the active and previously active widget. -
m_iPrevious
private int m_iPreviousThe ID of the active and previously active widget. -
m_iPicked
private int m_iPickedThe ID of the -
m_bPickPending
private boolean m_bPickPendingWhen true there is a pending mouse pick to process. -
m_kCurrentColor
private WildMagic.LibFoundation.Mathematics.ColorRGBA m_kCurrentColorThe current color to use to create a new Widget. -
m_bAdded
private boolean m_bAddedWhen true a new Widget was added with the mouse. -
m_kInterface
Reference to the containing JPanel. -
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 Details
-
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 Details
-
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:
displayin interfacecom.jogamp.opengl.GLEventListener- Overrides:
displayin classVolumeImageViewer
-
dispose
public void dispose()- Overrides:
disposein classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
dispose
public void dispose(com.jogamp.opengl.GLAutoDrawable arg0) - Specified by:
disposein interfacecom.jogamp.opengl.GLEventListener- Overrides:
disposein classVolumeImageViewer
-
getContainingPanel
Returns the container for this object. The container has a scroll pane and slider for the depth.- Returns:
-
getM_akLev
-
getPicked
public int getPicked()Returns the ID of the currently picked Widget.- Returns:
- the ID of the currently picked Widget.
-
getWidgets
Returns the current Widgets.- Returns:
- the current Widgets.
-
init
public void init(com.jogamp.opengl.GLAutoDrawable arg0) - Specified by:
initin interfacecom.jogamp.opengl.GLEventListener- Overrides:
initin classVolumeImageViewer
-
keyPressed
keyPressed callback.- Specified by:
keyPressedin interfaceKeyListener- Overrides:
keyPressedin classVolumeImageViewer- Parameters:
kKey- the KeyEvent triggering the callback.
-
load
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
reshape
public void reshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight) - Specified by:
reshapein interfacecom.jogamp.opengl.GLEventListener- Overrides:
reshapein classVolumeImageViewer
-
save
-
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
Sets the parent container panel:- Parameters:
kInterface-
-
setPicked
public void setPicked(int value) Sets the current picked ID.- Parameters:
value-
-
setWidget
Sets the widget type for new widgets.- Parameters:
kWidgetType-
-
setWidgets
Sets the list of Widgets.- Parameters:
kWidgetList-
-
update
-
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:
CreatePlaneNodein classVolumeImageViewer
-
CreateScene
protected void CreateScene()- Overrides:
CreateScenein 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.
-