Class JPanelSurfaceTexture
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gov.nih.mipav.view.renderer.JPanelRendererBase
gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
gov.nih.mipav.view.renderer.J3D.surfaceview.JPanelSurfaceTexture
- All Implemented Interfaces:
ViewImageUpdateInterface,ActionListener,FocusListener,ItemListener,KeyListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
JPanelSurfaceTexture. Enables texture-mapping of the ModelImage data onto a surface triangle mesh. The Texture
coordinates of the mesh are calculated in the SurfaceMask class. This class creates the ImageComponent3D object that
is passed to the Texture3D object when the surface display attributes (TextureUnitState) are created. The
ImageComponent3D object contained within this class updates when the user changes the ModelLUT associated with the
texture.
The user can change the ModelLUT independently of the ModelLUT associated with the ModelImage, or if the user selects the option of using the ModelLUT associated with the ModelImage, then the texture updates as the user updates that LUT. This class implements the ViewImageUpdateInterface to capture LUT changes.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JFrameHistogramDisplay the independent LUT for Black/White images.private ModelImageModelImage used to generate the 3D texture:.private ModelImageReference to ModelImage A for linking the texture to the imageA LUT.private JRadioButtonRadioButton for turing on the surface image texture:.private JRadioButtonRadioButton for turing on the surface image per-vertex color:.private StringStores the currently-loaded ModelImage directory name:.private StringStores the currently-loaded ModelImage file name:.private JLabelDisplay the currently-loaded ModelImage file name:.private JRadioButtonRadioButton for turing off the surface image:.private JButtonLoad a new ModelImage:.private ButtonGroupGrouping the radio buttons:.private ModelImageIndependent ModelImage for independent LUT.private ModelLUTThe LUT associated with the ModelImage imageA:.private ModelLUTThe LUT associated with the independent texture LUT:.private JRadioButtonUse the ModelImage LUT.private JRadioButtonUse a separate LUT.private PatientSliceRenders the ModelImage data with LUT changes.private ModelRGBThe RGB LUT associated with the ModelImage imageA:.private ModelRGBThe RGB LUT associated with the independent texture LUT:.private javax.media.j3d.ImageComponent3DThe ModelImage texture with LUT changes, used with the Texture3D.private javax.media.j3d.Texture3D3D Texture used to display the ModelImage data as a texture mapped onto the ModelTriangleMesh.private ButtonGroupGrouping the radio buttons:.private intCurrently selected ModelImage display type:.private javax.media.j3d.TextureUnitState[]TextureUnitState contains texture information for the rendered surfaces:.static final intNo display:.private static final longUse serialVersionUID for interoperability.static final intDisplays the ModelImage with 3D Texture-mapping :.static final intDisplays the ModelImage with per-vertex colors:.Fields inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
rayBasedRender, renderBaseFields inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
applyButton, cancelButton, cancelFlag, closeButton, helpButton, isActiveImage, mainPanel, NEW, OKButton, REPLACE, runInSeparateThread, serif12, serif12BFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) actionPerformed, listens for interface events.private voidCreates a 3D Texture object for the ModelImage displayed in the SurfaceRender object.voiddispose()Removes this object from the ModelImage imageDisplayListener list.private javax.media.j3d.ImageComponent3Dgenerates an ImageComponent3D containing the ModelImage data.booleanReturns whether the ModelTriangleMesh is to be displayed with the ModelImage data as a texture or not.Returns The SurfaceRender ModelImage imageA for linking to the LUT.Returns the ModelImage associated with the independent LUT.getLUT()Return the current ModelLUT:.Returns the mainPanel.getRGBT()Return the current ModelRGBT:.Returns The ModelImage that is the data source for the Texture3D.intReturns the texture status, either TEXTURE, VERTEX_COLOR, or NONE.javax.media.j3d.TextureUnitState[]Returns the volume texture TextureUnitState.private voidinit()Initializes the interface, and generates the first default texture.private voidinitLUT()Initializes or re-initializes the Histogram LUT interface based on the currently-loaded ModelImage.private voidLoad a new ModelImage to use for the 3D Texture display:voidsetEnabled(boolean flag) Enables or disables the interface.voidUpdate the ModelRGB associated with the separate texture, and regenerate the ImageComponente3D volume texture.voidUpdate the ModelRGB associated with the ModelImage texture, and regenerate the ImageComponente3D volume texture.voidsetSlice(int slice) ViewImageUpdateInterface, unused here.voidsetTimeSlice(int tSlice) ViewImageUpdateInterface, unused here.booleanViewImageUpdateInterface, unused here.booleanViewImageUpdateInterface, unused here.booleanupdateImages(boolean flag) ViewImageUpdateInterface, unused here.booleanupdateImages(ModelLUT LUTa, ModelLUT LUTb, boolean flag, int interpMode) updateImages, called when the ModelLUT changes.voidupdateSurfaceTextureImage(BitSet paintMask, javax.vecmath.Color4f kColor) updateSurfaceTextureImage.private voidUpdaes the ImageComponent3D data if the texture display is turned on.Methods inherited from class gov.nih.mipav.view.renderer.J3D.JPanelRendererJ3D
disposeLocal, getSurfaceRender, setRayBasedRender, setSurfaceRenderMethods inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
buildApplyButton, buildCancelButton, buildCloseButton, buildHelpButton, buildOKButton, buildTitledBorder, finalize, focusGained, focusLost, isCancelled, itemStateChanged, keyPressed, keyReleased, keyTyped, makeString, resizePanel, setLeftHandSystem, setVisible, setVisibleStandard, setWCSystem, testParameterMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.event.FocusListener
focusGained, focusLostMethods inherited from interface java.awt.event.ItemListener
itemStateChangedMethods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
NONE
public static final int NONENo display:.- See Also:
-
TEXTURE
public static final int TEXTUREDisplays the ModelImage with 3D Texture-mapping :.- See Also:
-
VERTEX_COLOR
public static final int VERTEX_COLORDisplays the ModelImage with per-vertex colors:.- See Also:
-
mHistogram
Display the independent LUT for Black/White images. -
mImageA
ModelImage used to generate the 3D texture:. -
mImageALink
Reference to ModelImage A for linking the texture to the imageA LUT. -
mImageAsTextureRadioButton
RadioButton for turing on the surface image texture:. -
mImageAsVertexColorRadioButton
RadioButton for turing on the surface image per-vertex color:. -
mImageDirName
Stores the currently-loaded ModelImage directory name:. -
mImageFileName
Stores the currently-loaded ModelImage file name:. -
mImageFileNameLabel
Display the currently-loaded ModelImage file name:. -
mImageNoneRadioButton
RadioButton for turing off the surface image:. -
mLoadImageButton
Load a new ModelImage:. -
mLUTButtonGroup
Grouping the radio buttons:. -
mLUTImageA
Independent ModelImage for independent LUT. -
mLUTModel
The LUT associated with the ModelImage imageA:. -
mLUTSeparate
The LUT associated with the independent texture LUT:. -
mModelLUTRadioButton
Use the ModelImage LUT. -
mNewLUTRadioButton
Use a separate LUT. -
mPatientSlice
Renders the ModelImage data with LUT changes. -
mRGBModel
The RGB LUT associated with the ModelImage imageA:. -
mRGBSeparate
The RGB LUT associated with the independent texture LUT:. -
mSurfaceTextureImage
private javax.media.j3d.ImageComponent3D mSurfaceTextureImageThe ModelImage texture with LUT changes, used with the Texture3D. -
mTexture
private javax.media.j3d.Texture3D mTexture3D Texture used to display the ModelImage data as a texture mapped onto the ModelTriangleMesh. -
mTextureButtonGroup
Grouping the radio buttons:. -
mTextureStatus
private int mTextureStatusCurrently selected ModelImage display type:. -
mTextureUnitState
private javax.media.j3d.TextureUnitState[] mTextureUnitStateTextureUnitState contains texture information for the rendered surfaces:.
-
-
Constructor Details
-
JPanelSurfaceTexture
Constructor:- Parameters:
kView- the SurfaceRender this panel is displayed withimageA- the ModelImage used to generate the volume texture.
-
-
Method Details
-
actionPerformed
actionPerformed, listens for interface events.- Specified by:
actionPerformedin interfaceActionListener- Specified by:
actionPerformedin classJPanelRendererBase- Parameters:
event- ActionEvent generated by the interface.
-
dispose
public void dispose()Removes this object from the ModelImage imageDisplayListener list. -
getEnabled
public boolean getEnabled()Returns whether the ModelTriangleMesh is to be displayed with the ModelImage data as a texture or not.- Returns:
- true when the ModelImageMesh is texture-mapped, false otherwise.
-
getImageLink
Returns The SurfaceRender ModelImage imageA for linking to the LUT.- Returns:
- mImageALink, for identifying the ModelLUT associated with mImageA.
-
getImageSeparate
Returns the ModelImage associated with the independent LUT.- Returns:
- the ModelImage associated with the independent LUT
-
getLUT
Return the current ModelLUT:.- Returns:
- the currently used ModelLUT
-
getMainPanel
Returns the mainPanel.- Specified by:
getMainPanelin classJPanelRendererBase- Returns:
- mainPanel;
-
getRGBT
Return the current ModelRGBT:.- Returns:
- the currently used ModelRGBT
-
getTextureImage
Returns The ModelImage that is the data source for the Texture3D.- Returns:
- mImageA, the ModelImage used to generate the Texture3D
-
getTextureStatus
public int getTextureStatus()Returns the texture status, either TEXTURE, VERTEX_COLOR, or NONE.- Returns:
- TEXTURE, VERTEX_COLOR, or NONE
-
getTextureUnitState
public javax.media.j3d.TextureUnitState[] getTextureUnitState()Returns the volume texture TextureUnitState.- Returns:
- mTextureUnitState, the volume texture data.
-
setEnabled
public void setEnabled(boolean flag) Enables or disables the interface. Called when a surface is added/removed from the JPanelSurface class.- Overrides:
setEnabledin classJComponent- Parameters:
flag- when true enable the interface, when false disable the interface.
-
setRGBTA
Update the ModelRGB associated with the separate texture, and regenerate the ImageComponente3D volume texture.- Parameters:
RGBTa- the new ModelRGB for the separate texture.
-
setRGBTB
Update the ModelRGB associated with the ModelImage texture, and regenerate the ImageComponente3D volume texture.- Parameters:
RGBTb- the new ModelRGB for the ModelImage texture.
-
setSlice
public void setSlice(int slice) ViewImageUpdateInterface, unused here.- Specified by:
setSlicein interfaceViewImageUpdateInterface- Parameters:
slice- DOCUMENT ME!
-
setTimeSlice
public void setTimeSlice(int tSlice) ViewImageUpdateInterface, unused here.- Specified by:
setTimeSlicein interfaceViewImageUpdateInterface- Parameters:
tSlice- DOCUMENT ME!
-
updateImageExtents
public boolean updateImageExtents()ViewImageUpdateInterface, unused here.- Specified by:
updateImageExtentsin interfaceViewImageUpdateInterface- Returns:
- DOCUMENT ME!
-
updateImages
public boolean updateImages()ViewImageUpdateInterface, unused here.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Returns:
- DOCUMENT ME!
-
updateImages
public boolean updateImages(boolean flag) ViewImageUpdateInterface, unused here.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
flag- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
updateImages
updateImages, called when the ModelLUT changes. Updates the ImageComponent3D object for Texture3D updates. The ImageComponent3D object is only updated if it is currently displayed.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
LUTa- the LUT associated with the independent textureLUTb- the LUT associated with the ModelImageflag- forces update (ignored here)interpMode- (ignored here)- Returns:
- DOCUMENT ME!
-
updateSurfaceTextureImage
updateSurfaceTextureImage. Paints the ImageComponent3D object with the paint mask.- Parameters:
paintMask- paint bit map to add to the texture.kColor- DOCUMENT ME!
-
createVolumeTexture
private void createVolumeTexture()Creates a 3D Texture object for the ModelImage displayed in the SurfaceRender object. The Texture3D object is used for texture-mapping on any or all ModelTriangleMesh objects displayed in the SurfaceRender. -
generateVolumeTexture
private javax.media.j3d.ImageComponent3D generateVolumeTexture()generates an ImageComponent3D containing the ModelImage data. Uses the PatientSlice object to output the data into the ImageComponent3D, so lut changes can be applied. The ImageComponent3D is used to create a Texture3D object for texture-mapping the ModelImage data onto ModelTriangleMesh objects.- Returns:
- DOCUMENT ME!
-
init
private void init()Initializes the interface, and generates the first default texture. -
initLUT
private void initLUT()Initializes or re-initializes the Histogram LUT interface based on the currently-loaded ModelImage. -
loadingImage
private void loadingImage()Load a new ModelImage to use for the 3D Texture display: -
updateTexture
private void updateTexture()Updaes the ImageComponent3D data if the texture display is turned on. Notifies the JPanelSurface object of the update.
-