Class ViewJFramePaintVasculature

All Implemented Interfaces:
ViewImageUpdateInterface, ActionListener, ComponentListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class ViewJFramePaintVasculature extends ViewJFrameBase
Generates a MIP image from a 3D volume. When the user clicks on a pixel of the MIP, a region grow is performed starting at the point where the clicked intensity occurs.

Rotation of the volume to take different MIPs is something that might be useful to add (it's been partially added (see the MIP menu), but it is untested..).

Not tested with color images... probably won't work.

Right now, the MIP and the volume partially share the same LUT.

Author:
Evan McCreedy
See Also:
  • Field Details

    • serialVersionUID

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

      protected ViewJComponentEditImage componentImage
      Display of the MIP image.
    • fudgeFactor

      protected int fudgeFactor
      Frame adjustment to keep the frame from being just small enough for the ScrollPane to display the scroll bars. Windows seems to find an inset value needing a fudge factor of 3, but Mac OS 10 (X), doesn't, and needs a fudge factor of 7 to not require scroll bars. Either way, insets + fudge-factor must equal 7.
    • heightResFactor

      protected float heightResFactor
      Storage for correction parameters where datasets have non isotropic values.
    • imageBuffer

      protected float[] imageBuffer
      Buffer used to store image intensities the presently viewed slice of image.
    • logMagDisplay

      protected boolean logMagDisplay
      Flag indicating whether or not that the image should be displayed in Log scale. Used primarily for displaying the FFT of an image.
    • mipBuffer

      protected float[] mipBuffer
      Buffer to store the MIP image that results from the raytrace.
    • mipExtents

      protected int[] mipExtents
      The dimensions of the MIP image.
    • mipImage

      protected ModelImage mipImage
      MIP image generated from the volume.
    • mipZTable

      protected Hashtable<Integer,Float> mipZTable
      Table which holds the z coordinate on the 3D volume for a point (x,y) on the 2D MIP image.
    • paintDialog

      protected JDialogPaintVasculature paintDialog
      Dialog to facilitate vasculature painting.
    • parent

      protected ViewJFrameBase parent
      Parent frame of this frame.
    • pixBuffer

      protected int[] pixBuffer
      Integer buffer (4 bytes that stores the concatenated Alpha (1 byte), Red (1 byte), Green ( 1 byte ), Blue (1 byte ) data. The ARGB values are generated by using the mipImage intensities as a index into a LUT.
    • resols

      protected float[] resols
      Storage of the image voxel resolutions. One resolution value per dimension.
    • seedPoints

      protected VOI seedPoints
      VOI containing the possible seed points.
    • units

      protected int[] units
      Storage of the resolution units of measure. For example, mm, cm, inches ...
    • widthResFactor

      protected float widthResFactor
      Storage for correction parameters where datasets have non isotropic values.
    • xScreen

      protected int xScreen
      Width of the display screen.
    • yScreen

      protected int yScreen
      Height of the display screen.
    • zoom

      protected float zoom
      Defaults magnification of image to 1.
    • scrollPane

      private JScrollPane scrollPane
      The scrollPane where the image is displayed.
  • Constructor Details

    • ViewJFramePaintVasculature

      public ViewJFramePaintVasculature(ModelImage img, ModelLUT lut, Dimension loc, ViewJFrameBase frame)
      Constructs the MIP frame and pops up the region grow dialog.
      Parameters:
      img - volume to perform the MIP on
      lut - LUT of the volume
      loc - where to place the frame
      frame - the parent frame (which must have the component image containing img)
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Listen for events from the MIP frame GUI.
      Specified by:
      actionPerformed in interface ActionListener
      Specified by:
      actionPerformed in class ViewJFrameBase
      Parameters:
      event - event triggered by GUI
    • calcMIPBuffer

      public void calcMIPBuffer(int firstDim, int secondDim, int thirdDim)
      Generates a MIP image from the volume.
      Parameters:
      firstDim - the "x" dimension of the generated MIP
      secondDim - the slowest moving dimension -- the "y" dimension of the generated MIP
      thirdDim - the fastest moving dimension -- the one we are finding the maximum intensity of
    • close

      public void close()
      Closes window and disposes of frame and component.
      Overrides:
      close in class ViewJFrameBase
    • componentResized

      public void componentResized(ComponentEvent event)
      Resizes frame and all components.
      Specified by:
      componentResized in interface ComponentListener
      Overrides:
      componentResized in class ViewJFrameBase
      Parameters:
      event - event that triggered function
    • finalize

      public void finalize() throws Throwable
      Cleans memory.
      Overrides:
      finalize in class ViewJFrameBase
      Throws:
      Throwable - if something goes wrong in the parent constructor
    • findSeedPoints

      public void findSeedPoints(int val)
      Mark all points within the image which match a certain intensity with point VOIs. If points are too close to one another in the volume, only one is marked.
      Parameters:
      val - the intensity value to mark
    • getComponentImage

      public ViewJComponentEditImage getComponentImage()
      Returns the reference to the component image.
      Returns:
      component image
    • getControls

      public ViewControlsImage getControls()
      Placeholder.
      Specified by:
      getControls in class ViewJFrameBase
      Returns:
      null
    • getImageA

      public ModelImage getImageA()
      Returns the reference to mipImage.
      Specified by:
      getImageA in class ViewJFrameBase
      Returns:
      image
    • getImageB

      public ModelImage getImageB()
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Specified by:
      getImageB in class ViewJFrameBase
      Returns:
      the second image
    • getMIPZValue

      public float getMIPZValue(int index)
      Gets the Z value where a pixel in the MIP image occurred in the volume. Used to translate points on the MIP to points on the volume.
      Parameters:
      index - index into the mip buffer of the point to get ( index = x + y * xDimSize )
      Returns:
      z value of the point on the volume which was used for the MIP image point
    • getParentFrame

      public ViewJFrameBase getParentFrame()
      Get the parent frame of this MIP image frame.
      Returns:
      the parent frame (the main RFAST frame)
    • getRGBTA

      public ModelRGB getRGBTA()
      Gets the RGB LUT table for ARGB image A.
      Overrides:
      getRGBTA in class ViewJFrameBase
      Returns:
      RGBT the new RGB LUT to be applied to the image
    • getRGBTB

      public ModelRGB getRGBTB()
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Overrides:
      getRGBTB in class ViewJFrameBase
      Returns:
      the RGBTB data
    • getSeedPoints

      public VOI getSeedPoints()
      Return the points that have been marked on the MIP as possible seed points.
      Returns:
      a VOI containing the possible seed points
    • initFrame

      public void initFrame(Dimension loc) throws OutOfMemoryError
      Initializes the 2D MIP image frame.
      Parameters:
      loc - where the frame should be placed
      Throws:
      OutOfMemoryError - if there is not enough memory available to construct the MIP window
    • removeControls

      public void removeControls()
      Placeholder.
      Specified by:
      removeControls in class ViewJFrameBase
    • setActiveImage

      public void setActiveImage(int val)
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Specified by:
      setActiveImage in class ViewJFrameBase
      Parameters:
      val - the active image number
    • setAlphaBlend

      public void setAlphaBlend(int val)
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Specified by:
      setAlphaBlend in class ViewJFrameBase
      Parameters:
      val - alpha blending value
    • setControls

      public void setControls()
      Placeholder.
      Specified by:
      setControls in class ViewJFrameBase
    • setEnabled

      public void setEnabled(boolean flag)
      Controls whether or not the images/VOIs of the frame can be modified.
      Specified by:
      setEnabled in class ViewJFrameBase
      Parameters:
      flag - if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
    • setImageB

      public void setImageB(ModelImage imB)
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Specified by:
      setImageB in class ViewJFrameBase
      Parameters:
      imB - the second image
    • setLUTa

      public void setLUTa(ModelLUT LUT)
      Sets the LUT for image A.
      Overrides:
      setLUTa in class ViewJFrameBase
      Parameters:
      LUT - the LUT
    • setPaintBitmapSwitch

      public void setPaintBitmapSwitch(boolean val)
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Specified by:
      setPaintBitmapSwitch in class ViewJFrameBase
      Parameters:
      val - whether to show the paint mask
    • setRGBTA

      public void setRGBTA(ModelRGB RGBT)
      Sets the RGB LUT table for ARGB image A.
      Specified by:
      setRGBTA in class ViewJFrameBase
      Parameters:
      RGBT - the new RGB LUT to be applied to the image
    • setRGBTB

      public void setRGBTB(ModelRGB val)
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Specified by:
      setRGBTB in class ViewJFrameBase
      Parameters:
      val - the RGBTB data
    • setSlice

      public void setSlice(int val)
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Parameters:
      val - the slice
    • setTimeSlice

      public void setTimeSlice(int val)
      Deprecated.
      DOCUMENT ME!
      Placeholder required by ViewJFrameBase.
      Parameters:
      val - the time slice
    • setTitle

      public void setTitle()
      Sets the title of the frame with the image name of slice location.
      Specified by:
      setTitle in class ViewJFrameBase
    • updateFrame

      public void updateFrame(float sX, float sY)
      Updates the this frame's size the compnents sizes. If the magnified image fits into the frame that will fit into the screen then frame and image are sized appropriately. If the frame, to fit the image, exceeds the screen size the frame remains the same size and the image magnified and placed in the scroll pane.
      Parameters:
      sX - zoom in the x dimension
      sY - zoom in the y dimension
    • updateImageExtents

      public boolean updateImageExtents()
      This methods calls the componentImage's REPAINT method to redraw the screen. The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.
      Specified by:
      updateImageExtents in interface ViewImageUpdateInterface
      Specified by:
      updateImageExtents in class ViewJFrameBase
      Returns:
      whether the update was successful.
      See Also:
    • updateImages

      public boolean updateImages()
      This methods calls the componentImage's update method to redraw the screen - fastest of the three update methods.
      Returns:
      boolean confirming successful update
    • updateImages

      public boolean updateImages(boolean forceShow)
      This methods calls the componentImage's update method to redraw the screen. Without LUT changes.
      Parameters:
      forceShow - forces show to re import image and calc. java image
      Returns:
      boolean confirming successful update
    • updateImages

      public boolean updateImages(ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)
      This methods calls the componentImage's update method to redraw the screen.
      Parameters:
      _LUTa - LUT used to update imageA (and mipImage)
      _LUTb - LUT used to update imageB
      forceShow - forces show to re import image and calc. java image
      interpMode - image interpolation method (Nearest or Smooth)
      Returns:
      boolean confirming successful update
    • windowClosing

      public void windowClosing(WindowEvent event)
      Closes window and disposes of frame and component.
      Specified by:
      windowClosing in interface WindowListener
      Overrides:
      windowClosing in class ViewJFrameBase
      Parameters:
      event - Event that triggered function
    • distance

      protected static final double distance(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2)
      Calculates the 3D euclidian distance between two points.
      Parameters:
      pt1 - first point
      pt2 - second point
      Returns:
      returns the distance
    • initComponentImage

      private void initComponentImage()
      Construct the component image which contains the MIP image (should be called after calcMIPBuffer).