Class JPanelVirtualEndoscopySetup_WM
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- gov.nih.mipav.view.renderer.JPanelRendererBase
-
- gov.nih.mipav.view.renderer.WildMagic.flythroughview.JPanelVirtualEndoscopySetup_WM
-
- 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_WM extends JPanelRendererBase
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_WM.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
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.Box
contentBox
Box layout for control panel.private boolean
continueUpdate
Flag indicates to continue update the surface render and plane render or not.private java.lang.String
directory
File name and directory.private ModelImage
endoscopyImage
Loaded endoscopy image file.private java.lang.String
fileName
File name and directory.private javax.swing.JButton
flythruButtonLoadImage
Load image button.private javax.swing.JLabel
flythruLabelFileName
Image file name label.private javax.swing.JPanel
kPanelButton
Button panel.private boolean
m_bShowMeanCurvatures
Flag indicates to show pseudo color or not.private javax.swing.JCheckBox
m_kCheckBoxShowCurvatures
Show curvature colors check box.private javax.swing.JComboBox
m_kComboSegmentSurfaceBranchSamplesReductionFactor
Surface sample reduction factor.private javax.swing.JCheckBox
m_kContinueUpdate
Continuous update check box.private java.text.DecimalFormat
m_kDecimalFormat
Used to create text representations of numbers.private javax.swing.JLabel
m_kLabelBranch
Branch label.private javax.swing.JLabel
m_kLabelDirection
View direction label.private javax.swing.JLabel
m_kLabelDistance
Path distance label.private javax.swing.JLabel
m_kLabelFileName
Automatically inserted by JBuilder Designer.private javax.swing.JLabel
m_kLabelOrientation
Orientation label.private javax.swing.JLabel
m_kLabelPosition
Current path position label.private javax.swing.JLabel
m_kLabelStepGaze
Step gaze label.private FlyThroughRender.SetupOptions
m_kOptions
Image option panel.private javax.swing.JTextField
m_kTextBranch
Current branch text box.private javax.swing.JTextField
m_kTextDirection
View direction text box.private javax.swing.JTextField
m_kTextDistance
Distance along path text box.private javax.swing.JTextField
m_kTextMaxNumBranches
maximum number of branches created for the endoscopy view.private javax.swing.JTextField
m_kTextMinBranchLength
minimum branch length.private javax.swing.JTextField
m_kTextOrientation
Orientation text box.private javax.swing.JTextField
m_kTextPercentBSplineNumControlPoints
BSpline control points fraction of branch samples.private javax.swing.JTextField
m_kTextPosition
Position text box.private javax.swing.JTextField
m_kTextStepGaze
Step gaze text box.private FlyThroughRender
m_kView
Renderer for displaying the scene-graph.private javax.swing.JScrollPane
scroller
Scroll pane.private JPanelVirtualEndoscopySetup_WM.DrawingPanel
scrollPanel
Scroll panel that holding all the control components.private static long
serialVersionUID
Use serialVersionUID for interoperability.private javax.swing.JButton
updateButton
continue update button.-
Fields inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
applyButton, cancelButton, cancelFlag, closeButton, helpButton, isActiveImage, mainPanel, NEW, OKButton, REPLACE, runInSeparateThread, serif12, serif12B
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description JPanelVirtualEndoscopySetup_WM(FlyThroughRender _kView)
Creates endoscopy registration control panel.
-
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.boolean
getContinuousUpdate()
Return whether to update the Volume Tri-Planar view continuously as the fly path changes.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.(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.protected void
setPathDistance(float fDist, float fTotalDist)
Update the display to show the current distance along the length of the path.protected void
setPathPosition(WildMagic.LibFoundation.Mathematics.Vector3f 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(WildMagic.LibFoundation.Mathematics.Vector3f kVector)
Update the display to show the current base viewing direction at the current point along the path.protected void
setViewOrientation(WildMagic.LibFoundation.Mathematics.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(WildMagic.LibFoundation.Mathematics.Matrix3f kOrientation)
Update the appropriate controls based on the current settings of the orientation-based information in the FlyPathBehavior instance.void
updatePosition(FlyPathBehavior_WM kFlyPathBehavior)
Update the appropriate controls based on the current settings of the position-based information in the FlyPathBehavior instance.-
Methods inherited from class gov.nih.mipav.view.renderer.JPanelRendererBase
buildApplyButton, buildCancelButton, buildCloseButton, buildHelpButton, buildOKButton, buildTitledBorder, disposeLocal, finalize, focusGained, focusLost, isCancelled, itemStateChanged, keyPressed, keyReleased, keyTyped, makeString, setLeftHandSystem, setVisible, setVisibleStandard, setWCSystem, testParameter
-
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
-
-
-
-
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
Load image button.
-
flythruLabelFileName
private javax.swing.JLabel flythruLabelFileName
Image file name label.
-
kPanelButton
private javax.swing.JPanel kPanelButton
Button panel.
-
m_bShowMeanCurvatures
private boolean m_bShowMeanCurvatures
Flag indicates to show pseudo color or not.
-
m_kCheckBoxShowCurvatures
private javax.swing.JCheckBox m_kCheckBoxShowCurvatures
Show curvature colors check box.
-
m_kComboSegmentSurfaceBranchSamplesReductionFactor
private javax.swing.JComboBox m_kComboSegmentSurfaceBranchSamplesReductionFactor
Surface sample reduction factor.
-
m_kContinueUpdate
private javax.swing.JCheckBox m_kContinueUpdate
Continuous update check box.
-
m_kDecimalFormat
private final java.text.DecimalFormat m_kDecimalFormat
Used to create text representations of numbers.
-
m_kLabelBranch
private javax.swing.JLabel m_kLabelBranch
Branch label.
-
m_kLabelDirection
private javax.swing.JLabel m_kLabelDirection
View direction label.
-
m_kLabelDistance
private javax.swing.JLabel m_kLabelDistance
Path distance label.
-
m_kLabelFileName
private javax.swing.JLabel m_kLabelFileName
Automatically inserted by JBuilder Designer.
-
m_kLabelOrientation
private javax.swing.JLabel m_kLabelOrientation
Orientation label.
-
m_kLabelPosition
private javax.swing.JLabel m_kLabelPosition
Current path position label.
-
m_kLabelStepGaze
private javax.swing.JLabel m_kLabelStepGaze
Step gaze label.
-
m_kOptions
private FlyThroughRender.SetupOptions m_kOptions
Image option panel.
-
m_kTextBranch
private javax.swing.JTextField m_kTextBranch
Current branch text box.
-
m_kTextDirection
private javax.swing.JTextField m_kTextDirection
View direction text box.
-
m_kTextDistance
private javax.swing.JTextField m_kTextDistance
Distance along path text box.
-
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
Orientation text box.
-
m_kTextPercentBSplineNumControlPoints
private javax.swing.JTextField m_kTextPercentBSplineNumControlPoints
BSpline control points fraction of branch samples.
-
m_kTextPosition
private javax.swing.JTextField m_kTextPosition
Position text box.
-
m_kTextStepGaze
private javax.swing.JTextField m_kTextStepGaze
Step gaze text box.
-
m_kView
private final FlyThroughRender m_kView
Renderer for displaying the scene-graph.
-
scroller
private javax.swing.JScrollPane scroller
Scroll pane.
-
scrollPanel
private JPanelVirtualEndoscopySetup_WM.DrawingPanel scrollPanel
Scroll panel that holding all the control components.
-
updateButton
private javax.swing.JButton updateButton
continue update button.
-
-
Constructor Detail
-
JPanelVirtualEndoscopySetup_WM
public JPanelVirtualEndoscopySetup_WM(FlyThroughRender _kView)
Creates endoscopy registration control panel.- Parameters:
_kView
- FlythruRender refrence.
-
-
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 interfacejava.awt.event.ActionListener
- Specified by:
actionPerformed
in classJPanelRendererBase
- Parameters:
event
- Event that triggers function
-
dispose
public void dispose(boolean flag)
Dispose memory.- Parameters:
flag
- dispose super or not.
-
getContinuousUpdate
public boolean getContinuousUpdate()
Return whether to update the Volume Tri-Planar view continuously as the fly path changes.- Returns:
- true when updating the Volume Tri-Planar view continuously as the fly path changes.
-
getMainPanel
public javax.swing.JPanel getMainPanel()
Return the main control panel.- Specified by:
getMainPanel
in classJPanelRendererBase
- 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 classJPanelRendererBase
- Parameters:
panelWidth
- control panel widthframeHeight
- control panel height
-
updateOrientation
public void updateOrientation(WildMagic.LibFoundation.Mathematics.Matrix3f kOrientation)
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_WM 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.
-
init
private void init()
Initializes the GUI components and displays the control panel.
-
loadingImage
private void loadingImage()
Method to load the mask 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.
-
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 onbPathMoveForward
- 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 startfTotalDist
- total distance along the path from start to end
-
setPathPosition
protected void setPathPosition(WildMagic.LibFoundation.Mathematics.Vector3f 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(WildMagic.LibFoundation.Mathematics.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(WildMagic.LibFoundation.Mathematics.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
-
-