Class JPanelSurfaceTexture

All Implemented Interfaces:
ViewImageUpdateInterface, ActionListener, FocusListener, ItemListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class JPanelSurfaceTexture extends JPanelRendererJ3D implements ViewImageUpdateInterface
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:
  • invalid reference
    JPanelSurface.java
  • invalid reference
    SurfaceMask.java
  • invalid reference
    ModelImage.java
  • Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • NONE

      public static final int NONE
      No display:.
      See Also:
    • TEXTURE

      public static final int TEXTURE
      Displays the ModelImage with 3D Texture-mapping :.
      See Also:
    • VERTEX_COLOR

      public static final int VERTEX_COLOR
      Displays the ModelImage with per-vertex colors:.
      See Also:
    • mHistogram

      private JFrameHistogram mHistogram
      Display the independent LUT for Black/White images.
    • mImageA

      private ModelImage mImageA
      ModelImage used to generate the 3D texture:.
    • mImageAsTextureRadioButton

      private JRadioButton mImageAsTextureRadioButton
      RadioButton for turing on the surface image texture:.
    • mImageAsVertexColorRadioButton

      private JRadioButton mImageAsVertexColorRadioButton
      RadioButton for turing on the surface image per-vertex color:.
    • mImageDirName

      private String mImageDirName
      Stores the currently-loaded ModelImage directory name:.
    • mImageFileName

      private String mImageFileName
      Stores the currently-loaded ModelImage file name:.
    • mImageFileNameLabel

      private JLabel mImageFileNameLabel
      Display the currently-loaded ModelImage file name:.
    • mImageNoneRadioButton

      private JRadioButton mImageNoneRadioButton
      RadioButton for turing off the surface image:.
    • mLoadImageButton

      private JButton mLoadImageButton
      Load a new ModelImage:.
    • mLUTButtonGroup

      private ButtonGroup mLUTButtonGroup
      Grouping the radio buttons:.
    • mLUTImageA

      private ModelImage mLUTImageA
      Independent ModelImage for independent LUT.
    • mLUTModel

      private ModelLUT mLUTModel
      The LUT associated with the ModelImage imageA:.
    • mLUTSeparate

      private ModelLUT mLUTSeparate
      The LUT associated with the independent texture LUT:.
    • mModelLUTRadioButton

      private JRadioButton mModelLUTRadioButton
      Use the ModelImage LUT.
    • mNewLUTRadioButton

      private JRadioButton mNewLUTRadioButton
      Use a separate LUT.
    • mPatientSlice

      private PatientSlice mPatientSlice
      Renders the ModelImage data with LUT changes.
    • mRGBModel

      private ModelRGB mRGBModel
      The RGB LUT associated with the ModelImage imageA:.
    • mRGBSeparate

      private ModelRGB mRGBSeparate
      The RGB LUT associated with the independent texture LUT:.
    • mSurfaceTextureImage

      private javax.media.j3d.ImageComponent3D mSurfaceTextureImage
      The ModelImage texture with LUT changes, used with the Texture3D.
    • mTexture

      private javax.media.j3d.Texture3D mTexture
      3D Texture used to display the ModelImage data as a texture mapped onto the ModelTriangleMesh.
    • mTextureButtonGroup

      private ButtonGroup mTextureButtonGroup
      Grouping the radio buttons:.
    • mTextureStatus

      private int mTextureStatus
      Currently selected ModelImage display type:.
    • mTextureUnitState

      private javax.media.j3d.TextureUnitState[] mTextureUnitState
      TextureUnitState contains texture information for the rendered surfaces:.
  • Constructor Details

    • JPanelSurfaceTexture

      public JPanelSurfaceTexture(SurfaceRender kView, ModelImage imageA)
      Constructor:
      Parameters:
      kView - the SurfaceRender this panel is displayed with
      imageA - the ModelImage used to generate the volume texture.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      actionPerformed, listens for interface events.
      Specified by:
      actionPerformed in interface ActionListener
      Specified by:
      actionPerformed in class JPanelRendererBase
      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

      public ModelImage getImageLink()
      Returns The SurfaceRender ModelImage imageA for linking to the LUT.
      Returns:
      mImageALink, for identifying the ModelLUT associated with mImageA.
    • getImageSeparate

      public ModelImage getImageSeparate()
      Returns the ModelImage associated with the independent LUT.
      Returns:
      the ModelImage associated with the independent LUT
    • getLUT

      public ModelLUT getLUT()
      Return the current ModelLUT:.
      Returns:
      the currently used ModelLUT
    • getMainPanel

      public JPanel getMainPanel()
      Returns the mainPanel.
      Specified by:
      getMainPanel in class JPanelRendererBase
      Returns:
      mainPanel;
    • getRGBT

      public ModelRGB getRGBT()
      Return the current ModelRGBT:.
      Returns:
      the currently used ModelRGBT
    • getTextureImage

      public ModelImage 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:
      setEnabled in class JComponent
      Parameters:
      flag - when true enable the interface, when false disable the interface.
    • setRGBTA

      public void setRGBTA(ModelRGB RGBTa)
      Update the ModelRGB associated with the separate texture, and regenerate the ImageComponente3D volume texture.
      Parameters:
      RGBTa - the new ModelRGB for the separate texture.
    • setRGBTB

      public void setRGBTB(ModelRGB RGBTb)
      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:
      setSlice in interface ViewImageUpdateInterface
      Parameters:
      slice - DOCUMENT ME!
    • setTimeSlice

      public void setTimeSlice(int tSlice)
      ViewImageUpdateInterface, unused here.
      Specified by:
      setTimeSlice in interface ViewImageUpdateInterface
      Parameters:
      tSlice - DOCUMENT ME!
    • updateImageExtents

      public boolean updateImageExtents()
      ViewImageUpdateInterface, unused here.
      Specified by:
      updateImageExtents in interface ViewImageUpdateInterface
      Returns:
      DOCUMENT ME!
    • updateImages

      public boolean updateImages()
      ViewImageUpdateInterface, unused here.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Returns:
      DOCUMENT ME!
    • updateImages

      public boolean updateImages(boolean flag)
      ViewImageUpdateInterface, unused here.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Parameters:
      flag - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • updateImages

      public boolean updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean flag, int interpMode)
      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:
      updateImages in interface ViewImageUpdateInterface
      Parameters:
      LUTa - the LUT associated with the independent texture
      LUTb - the LUT associated with the ModelImage
      flag - forces update (ignored here)
      interpMode - (ignored here)
      Returns:
      DOCUMENT ME!
    • updateSurfaceTextureImage

      public void updateSurfaceTextureImage(BitSet paintMask, javax.vecmath.Color4f kColor)
      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.