Class ViewJFramePaintVasculature

  • All Implemented Interfaces:
    ViewImageUpdateInterface, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.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:
    ViewJFrameImage, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Listen for events from the MIP frame GUI.
      void calcMIPBuffer​(int firstDim, int secondDim, int thirdDim)
      Generates a MIP image from the volume.
      void close()
      Closes window and disposes of frame and component.
      void componentResized​(java.awt.event.ComponentEvent event)
      Resizes frame and all components.
      protected static double distance​(WildMagic.LibFoundation.Mathematics.Vector3f pt1, WildMagic.LibFoundation.Mathematics.Vector3f pt2)
      Calculates the 3D euclidian distance between two points.
      void finalize()
      Cleans memory.
      void findSeedPoints​(int val)
      Mark all points within the image which match a certain intensity with point VOIs.
      ViewJComponentEditImage getComponentImage()
      Returns the reference to the component image.
      ViewControlsImage getControls()
      Placeholder.
      ModelImage getImageA()
      Returns the reference to mipImage.
      ModelImage getImageB()
      Deprecated.
      DOCUMENT ME!
      float getMIPZValue​(int index)
      Gets the Z value where a pixel in the MIP image occurred in the volume.
      ViewJFrameBase getParentFrame()
      Get the parent frame of this MIP image frame.
      ModelRGB getRGBTA()
      Gets the RGB LUT table for ARGB image A.
      ModelRGB getRGBTB()
      Deprecated.
      DOCUMENT ME!
      VOI getSeedPoints()
      Return the points that have been marked on the MIP as possible seed points.
      private void initComponentImage()
      Construct the component image which contains the MIP image (should be called after calcMIPBuffer).
      void initFrame​(java.awt.Dimension loc)
      Initializes the 2D MIP image frame.
      void removeControls()
      Placeholder.
      void setActiveImage​(int val)
      Deprecated.
      DOCUMENT ME!
      void setAlphaBlend​(int val)
      Deprecated.
      DOCUMENT ME!
      void setControls()
      Placeholder.
      void setEnabled​(boolean flag)
      Controls whether or not the images/VOIs of the frame can be modified.
      void setImageB​(ModelImage imB)
      Deprecated.
      DOCUMENT ME!
      void setLUTa​(ModelLUT LUT)
      Sets the LUT for image A.
      void setPaintBitmapSwitch​(boolean val)
      Deprecated.
      DOCUMENT ME!
      void setRGBTA​(ModelRGB RGBT)
      Sets the RGB LUT table for ARGB image A.
      void setRGBTB​(ModelRGB val)
      Deprecated.
      DOCUMENT ME!
      void setSlice​(int val)
      Deprecated.
      DOCUMENT ME!
      void setTimeSlice​(int val)
      Deprecated.
      DOCUMENT ME!
      void setTitle()
      Sets the title of the frame with the image name of slice location.
      void updateFrame​(float sX, float sY)
      Updates the this frame's size the compnents sizes.
      boolean updateImageExtents()
      This methods calls the componentImage's REPAINT method to redraw the screen.
      boolean updateImages()
      This methods calls the componentImage's update method to redraw the screen - fastest of the three update methods.
      boolean updateImages​(boolean forceShow)
      This methods calls the componentImage's update method to redraw the screen.
      boolean updateImages​(ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)
      This methods calls the componentImage's update method to redraw the screen.
      void windowClosing​(java.awt.event.WindowEvent event)
      Closes window and disposes of frame and component.
      • Methods inherited from class javax.swing.JFrame

        addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • 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 java.util.Hashtable<java.lang.Integer,​java.lang.Float> mipZTable
        Table which holds the z coordinate on the 3D volume for a point (x,y) on the 2D MIP image.
      • 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 javax.swing.JScrollPane scrollPane
        The scrollPane where the image is displayed.
    • Constructor Detail

      • ViewJFramePaintVasculature

        public ViewJFramePaintVasculature​(ModelImage img,
                                          ModelLUT lut,
                                          java.awt.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 Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Listen for events from the MIP frame GUI.
        Specified by:
        actionPerformed in interface java.awt.event.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​(java.awt.event.ComponentEvent event)
        Resizes frame and all components.
        Specified by:
        componentResized in interface java.awt.event.ComponentListener
        Overrides:
        componentResized in class ViewJFrameBase
        Parameters:
        event - event that triggered function
      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Cleans memory.
        Overrides:
        finalize in class ViewJFrameBase
        Throws:
        java.lang.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
      • 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​(java.awt.Dimension loc)
                       throws java.lang.OutOfMemoryError
        Initializes the 2D MIP image frame.
        Parameters:
        loc - where the frame should be placed
        Throws:
        java.lang.OutOfMemoryError - if there is not enough memory available to construct the MIP window
      • 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
      • 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
      • 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​(java.awt.event.WindowEvent event)
        Closes window and disposes of frame and component.
        Specified by:
        windowClosing in interface java.awt.event.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).