Class Volume3DTexture

java.lang.Object
mgui.interfaces.shapes.volume.Volume3DTexture
All Implemented Interfaces:
org.jogamp.java3d.ImageComponent3D.Updater

public class Volume3DTexture
extends java.lang.Object
implements org.jogamp.java3d.ImageComponent3D.Updater
Class to create and return Texture3D and TexCoordGeneration objects from a given set of grid data.
Author:
Andrew Reid
  • Field Details

    • TYPE_INTENSITY_GREY

      public static final int TYPE_INTENSITY_GREY
      See Also:
      Constant Field Values
    • TYPE_INTENSITY_GREY_ALPHA

      public static final int TYPE_INTENSITY_GREY_ALPHA
      See Also:
      Constant Field Values
    • TYPE_INTENSITY_CMAP

      public static final int TYPE_INTENSITY_CMAP
      See Also:
      Constant Field Values
    • TYPE_INTENSITY_CMAP_ALPHA

      public static final int TYPE_INTENSITY_CMAP_ALPHA
      See Also:
      Constant Field Values
    • TYPE_RGB

      public static final int TYPE_RGB
      See Also:
      Constant Field Values
    • TYPE_RGB_ALPHA

      public static final int TYPE_RGB_ALPHA
      See Also:
      Constant Field Values
    • texture

      protected org.jogamp.java3d.Texture3D texture
    • sDim

      protected int sDim
    • tDim

      protected int tDim
    • rDim

      protected int rDim
    • colorSpace

      protected int colorSpace
    • colourMap

      protected ColourMap colourMap
    • byRef

      protected boolean byRef
    • images

      protected java.awt.image.BufferedImage[] images
  • Constructor Details

    • Volume3DTexture

      public Volume3DTexture​(Volume3DInt volume)
    • Volume3DTexture

      public Volume3DTexture​(Volume3DInt volume, ColourMap cmap)
    • Volume3DTexture

      public Volume3DTexture​(int s, int t, int r)
  • Method Details

    • getByRefImages

      public java.awt.image.BufferedImage[] getByRefImages()
    • setFromVolume

      public boolean setFromVolume​(Volume3DInt volume)
      Set this volume from the specified grid.
      Parameters:
      grid -
    • setFromVolume

      public boolean setFromVolume​(Volume3DInt volume, boolean update)
      Set this volume from the specified grid.
      Parameters:
      grid -
      update - - Indicates that this is a by-reference update call
    • updateFromVolume

      public boolean updateFromVolume​(Volume3DInt volume)
      Set this volume from the specified grid.
      Parameters:
      grid -
    • updateFromVolume

      public boolean updateFromVolume​(Volume3DInt volume, boolean update)
      Updates this volume from the specified grid.
      Parameters:
      grid -
      update - - Indicates that this is a by-reference update call
    • setTexture

      protected void setTexture()
      Produces a stack of R-planar images from volume, based upon the current data column and its associated colour map.
      Parameters:
      volume -
    • resetTexture

      protected void resetTexture()
    • getFormat

      protected int getFormat()
    • resetImageComponent

      protected void resetImageComponent()
    • getColourSpace

      protected java.awt.color.ColorSpace getColourSpace()
    • loadImage

      public void loadImage​(int r0, int r1, java.net.URL image)
    • loadImage

      public void loadImage​(int r0, int r1, java.net.URL image, boolean setAlpha, double cutoff, double exp)
      Loads an image file at the given url into the texture for planes r0 through r1. If image does not match the dimensions s and t, it will be scaled to fit. If, for example: image.width < sDim, pixels will be inserted to fill the difference. If image.width > sDim, pixels will be removed to fit the image to this texture's dimensions.
      Parameters:
      r0 - Start r-plane into which to load the image
      r1 - End r-plane into which to load the image
      image - URL of the image file to load
      hasAlpha - Determines whether to add/set an alpha channel to an RGB image.
      cutoff - The value at which to cut alpha to zero, from 0 to 1 where 0 is completely transparent, and 1 is completely opaque.
      exp - Determines the degree of the equation with which alpha proceeds from the cutoff to zero. i.e., determines smoothness of cutoff. A zero or negative value of exp specifies no smoothing.
    • setCurrentMask

      public void setCurrentMask​(boolean[][][] mask)
      Sets the current mask for this texture; use null for no mask.
      Parameters:
      mask -
    • setCurrentColumn

      public void setCurrentColumn​(GridVertexDataColumn column)
      Sets the current data column for this texture.
      Parameters:
      mask -
    • setCurrentUpdateType

      public void setCurrentUpdateType​(Volume3DTexture.UpdateTextureType type)
      Specifies what type of update will be performed by updateData(org.jogamp.java3d.ImageComponent3D,int,int,int,int,int).
      Parameters:
      type -
    • setCurrentComposite

      public void setCurrentComposite​(Volume3DInt volume)
    • updateData

      public void updateData​(org.jogamp.java3d.ImageComponent3D imageComponent, int r_index, int x, int y, int s_size, int t_size)
      Specified by:
      updateData in interface org.jogamp.java3d.ImageComponent3D.Updater