Class JPanelVirtualEndoscopySetup

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

    public class JPanelVirtualEndoscopySetup
    extends JPanelRendererJ3D
    Control panel to set up the virtual endoscopy volume view. This panel loads the mask image and surface file. It also adjusts the endoscopy view parameters.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  JPanelVirtualEndoscopySetup.DrawingPanel
      Wrapper in order to hold the control panel layout in the JScrollPane.
      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • 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 Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Closes dialog box when the OK button is pressed, sets up the variables needed for running the algorithm, and calls the algorithm.
      void dispose​(boolean flag)
      Dispose memory.
      javax.swing.JPanel getMainPanel()
      Return the main control panel.
      private void init()
      Initializes the GUI components and displays the control panel.
      private void loadingImage()
      Method to load the mask image.
      private void loadingSurface()
      Mask to load the surface image.
      (package private) void m_kCheckBoxShowCurvatures_actionPerformed​(java.awt.event.ActionEvent e)
      Show the psesudo color.
      (package private) void m_kContinueUpdate_actionPerformed​(java.awt.event.ActionEvent e)
      Continue update the surface render and the plane render.
      void resizePanel​(int panelWidth, int frameHeight)
      Resize the control panel with ViewJFrameVolumeView's frame width and height.
      protected void setBranchInfo​(int iBranch, boolean bPathMoveForward)
      Update the display to show the current branch and path direction (forward or reverse) for moving along the length of the path.
      void setColor​(java.awt.Color _color)
      When the surface panel change the surface color, endoscopy view changes the color accordingly.
      protected void setPathDistance​(float fDist, float fTotalDist)
      Update the display to show the current distance along the length of the path.
      protected void setPathPosition​(javax.vecmath.Point3f kPosition)
      Update the display to show the coordinates of the current position along the path.
      protected void setStepGazeDist​(float fStepDist, float fGazeDist)
      Update the display to show the current gaze distance for looking ahead down the path.
      private boolean setVariables()
      Sets up the variables needed for the algorithm from the GUI components.
      protected void setViewDirection​(javax.vecmath.Vector3f kVector)
      Update the display to show the current base viewing direction at the current point along the path.
      protected void setViewOrientation​(javax.vecmath.Matrix3f kMatrix)
      Update the display to show the current viewing orientation which is always relative to the base viewing direction.
      protected boolean testParameterMin​(java.lang.String str, double minValue)
      Tests that the entered parameter is larger than the specified value.
      void updateOrientation​(FlyPathBehavior kFlyPathBehavior)
      Update the appropriate controls based on the current settings of the orientation-based information in the FlyPathBehavior instance.
      void updatePosition​(FlyPathBehavior kFlyPathBehavior)
      Update the appropriate controls based on the current settings of the position-based information in the FlyPathBehavior instance.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
      • Methods 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, validateTree
      • Methods 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, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

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

        focusGained, focusLost
      • Methods inherited from interface java.awt.event.ItemListener

        itemStateChanged
      • Methods inherited from interface java.awt.event.KeyListener

        keyPressed, keyReleased, keyTyped
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • contentBox

        private javax.swing.Box contentBox
        Box layout for control panel.
      • continueUpdate

        private boolean continueUpdate
        Flag indicates to continue update the surface render and plane render or not.
      • endoscopyImage

        private ModelImage endoscopyImage
        Loaded endoscopy image file.
      • fileName

        private java.lang.String fileName
        File name and directory.
      • directory

        private java.lang.String directory
        File name and directory.
      • flythruButtonLoadImage

        private javax.swing.JButton flythruButtonLoadImage
        DOCUMENT ME!
      • flythruLabelFileName

        private javax.swing.JLabel flythruLabelFileName
        DOCUMENT ME!
      • kDialogSmooth

        private JDialogSmoothMesh kDialogSmooth
        Surface smooth control panel reference.
      • kFile

        private java.io.File kFile
        File to open the mask suface.
      • kPanelButton

        private javax.swing.JPanel kPanelButton
        Button panel.
      • m_bShowMeanCurvatures

        private boolean m_bShowMeanCurvatures
        Flag indicates to show pseudo color or not.
      • m_kButtonLoadSurface

        private javax.swing.JButton m_kButtonLoadSurface
        DOCUMENT ME!
      • m_kCheckBoxShowCurvatures

        private javax.swing.JCheckBox m_kCheckBoxShowCurvatures
        DOCUMENT ME!
      • m_kComboSegmentSurfaceBranchSamplesReductionFactor

        private javax.swing.JComboBox m_kComboSegmentSurfaceBranchSamplesReductionFactor
        Surface sample reduction factor.
      • m_kContinueUpdate

        private javax.swing.JCheckBox m_kContinueUpdate
        DOCUMENT ME!
      • m_kDecimalFormat

        private final java.text.DecimalFormat m_kDecimalFormat
        Used to create text representations of numbers.
      • m_kLabelBranch

        private javax.swing.JLabel m_kLabelBranch
        DOCUMENT ME!
      • m_kLabelDirection

        private javax.swing.JLabel m_kLabelDirection
        DOCUMENT ME!
      • m_kLabelDistance

        private javax.swing.JLabel m_kLabelDistance
        DOCUMENT ME!
      • m_kLabelFileName

        private javax.swing.JLabel m_kLabelFileName
        Automatically inserted by JBuilder Designer.
      • m_kLabelOrientation

        private javax.swing.JLabel m_kLabelOrientation
        DOCUMENT ME!
      • m_kLabelPosition

        private javax.swing.JLabel m_kLabelPosition
        DOCUMENT ME!
      • m_kLabelStepGaze

        private javax.swing.JLabel m_kLabelStepGaze
        DOCUMENT ME!
      • m_kMeanCurvaturesLUT

        private ModelLUT m_kMeanCurvaturesLUT
        kMean curvature LUT. Pseudo color look up table.
      • m_kTextBranch

        private javax.swing.JTextField m_kTextBranch
        DOCUMENT ME!
      • m_kTextDirection

        private javax.swing.JTextField m_kTextDirection
        DOCUMENT ME!
      • m_kTextDistance

        private javax.swing.JTextField m_kTextDistance
        DOCUMENT ME!
      • m_kTextMaxNumBranches

        private javax.swing.JTextField m_kTextMaxNumBranches
        maximum number of branches created for the endoscopy view.
      • m_kTextMinBranchLength

        private javax.swing.JTextField m_kTextMinBranchLength
        minimum branch length.
      • m_kTextOrientation

        private javax.swing.JTextField m_kTextOrientation
        DOCUMENT ME!
      • m_kTextPercentBSplineNumControlPoints

        private javax.swing.JTextField m_kTextPercentBSplineNumControlPoints
        BSpline control points fraction of branch samples.
      • m_kTextPosition

        private javax.swing.JTextField m_kTextPosition
        DOCUMENT ME!
      • m_kTextStepGaze

        private javax.swing.JTextField m_kTextStepGaze
        DOCUMENT ME!
      • m_kTriangleMesh

        private ModelTriangleMesh m_kTriangleMesh
        Keep a copy of the loaded triangle mesh and any other properties associated with the surface.
      • m_kView

        private final FlythruRender m_kView
        Applet that is associated with the controls in this frame.
      • parentFrame

        private ViewJFrameVolumeView parentFrame
        Keep a reference to the ViewJFrameVolumeView.
      • scroller

        private javax.swing.JScrollPane scroller
        Scroll pane.
      • surfaceDir

        private java.lang.String surfaceDir
        Loaded mask surface image directory.
      • updateButton

        private javax.swing.JButton updateButton
        continue update button.
    • Constructor Detail

      • JPanelVirtualEndoscopySetup

        public JPanelVirtualEndoscopySetup​(FlythruRender _kView)
        Used primarily for the script to store variables and run the algorithm. No actual dialog will appear but the set up info and result image will be stored here. This method is not used for now.
        Parameters:
        _kView - parent frame reference.
      • JPanelVirtualEndoscopySetup

        public JPanelVirtualEndoscopySetup​(FlythruRender _kView,
                                           ViewJFrameVolumeView _parentFrame)
        Creates endoscopy registration control panel.
        Parameters:
        _kView - FlythruRender refrence.
        _parentFrame - ViewJFrameVolumeView parent frame reference.
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Closes dialog box when the OK button is pressed, sets up the variables needed for running the algorithm, and calls the algorithm.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Specified by:
        actionPerformed in class JPanelRendererBase
        Parameters:
        event - Event that triggers function
      • dispose

        public void dispose​(boolean flag)
        Dispose memory.
        Parameters:
        flag - dispose super or not.
      • getMainPanel

        public javax.swing.JPanel getMainPanel()
        Return the main control panel.
        Specified by:
        getMainPanel in class JPanelRendererBase
        Returns:
        JPanel the main control panel
      • resizePanel

        public void resizePanel​(int panelWidth,
                                int frameHeight)
        Resize the control panel with ViewJFrameVolumeView's frame width and height.
        Overrides:
        resizePanel in class JPanelRendererBase
        Parameters:
        panelWidth - control panel width
        frameHeight - control panel height
      • setColor

        public void setColor​(java.awt.Color _color)
        When the surface panel change the surface color, endoscopy view changes the color accordingly.
        Parameters:
        _color - Color
      • updateOrientation

        public void updateOrientation​(FlyPathBehavior kFlyPathBehavior)
        Update the appropriate controls based on the current settings of the orientation-based information in the FlyPathBehavior instance.
        Parameters:
        kFlyPathBehavior - FlyPathBehavior Instance which contains the current state of orientation along the branches.
      • updatePosition

        public void updatePosition​(FlyPathBehavior kFlyPathBehavior)
        Update the appropriate controls based on the current settings of the position-based information in the FlyPathBehavior instance.
        Parameters:
        kFlyPathBehavior - FlyPathBehavior Instance which contains the current state of position along the branches.
      • setBranchInfo

        protected void setBranchInfo​(int iBranch,
                                     boolean bPathMoveForward)
        Update the display to show the current branch and path direction (forward or reverse) for moving along the length of the path.
        Parameters:
        iBranch - index which identifies the branch currently on
        bPathMoveForward - flag set if moving forward, as opposed to in reverse, along the length of the path.
      • setPathDistance

        protected void setPathDistance​(float fDist,
                                       float fTotalDist)
        Update the display to show the current distance along the length of the path.
        Parameters:
        fDist - distance along the path from the start
        fTotalDist - total distance along the path from start to end
      • setPathPosition

        protected void setPathPosition​(javax.vecmath.Point3f kPosition)
        Update the display to show the coordinates of the current position along the path.
        Parameters:
        kPosition - 3D coordinates of current position
      • setStepGazeDist

        protected void setStepGazeDist​(float fStepDist,
                                       float fGazeDist)
        Update the display to show the current gaze distance for looking ahead down the path.
        Parameters:
        fStepDist - magnitude is the distance increment along the path for moving; sign is the direction of moving along the path from one end to the other or vice versa.
        fGazeDist - distance ahead for looking down the path.
      • setViewDirection

        protected void setViewDirection​(javax.vecmath.Vector3f kVector)
        Update the display to show the current base viewing direction at the current point along the path.
        Parameters:
        kVector - normalized direciton vector
      • setViewOrientation

        protected void setViewOrientation​(javax.vecmath.Matrix3f kMatrix)
        Update the display to show the current viewing orientation which is always relative to the base viewing direction.
        Parameters:
        kMatrix - 3x3 matrix containing orientation transform
      • testParameterMin

        protected boolean testParameterMin​(java.lang.String str,
                                           double minValue)
        Tests that the entered parameter is larger than the specified value.
        Parameters:
        str - The value entered by the user.
        minValue - The minimum value this variable may be set to.
        Returns:
        true if parameters passed range test, false if failed.
      • m_kCheckBoxShowCurvatures_actionPerformed

        void m_kCheckBoxShowCurvatures_actionPerformed​(java.awt.event.ActionEvent e)
        Show the psesudo color.
        Parameters:
        e - ActionEvent
      • m_kContinueUpdate_actionPerformed

        void m_kContinueUpdate_actionPerformed​(java.awt.event.ActionEvent e)
        Continue update the surface render and the plane render.
        Parameters:
        e - ActionEvent
      • init

        private void init()
        Initializes the GUI components and displays the control panel.
      • loadingImage

        private void loadingImage()
        Method to load the mask image.
      • loadingSurface

        private void loadingSurface()
        Mask to load the surface image.
      • setVariables

        private boolean setVariables()
        Sets up the variables needed for the algorithm from the GUI components.
        Returns:
        Flag indicating if the setup was successful.