Class JPanelBrainSurfaceFlattener_WM
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gov.nih.mipav.view.renderer.WildMagic.brainflattenerview_WM.JPanelBrainSurfaceFlattener_WM
- All Implemented Interfaces:
ViewImageUpdateInterface,ActionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class JPanelBrainSurfaceFlattener_WM
extends JPanel
implements ActionListener, ViewImageUpdateInterface
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JButtonCancel button is used on most dialogs.private booleanSet to true when a surface has been loadedprivate booleanCauses the surface LUT to be calculated for the first time.private intKeeps track of the user-interface position in the main panel.private JRadioButtonEnable/disable correspondence pickingprivate ButtonGroupButtonGroup for the plane/surface display selection.private JRadioButtonToggle displaying the plane on/offprivate JRadioButtonToggle displaying the sphere on/offprivate JPanelPanel container.private JCheckBoxToggle display of latitude/longitude lines on/off.private ModelLUTColor LUT based on Volume Dataprivate ModelImageVolume data for LUTprivate JTextFieldText box for entering the number of latitude lines.private JTextFieldText box for entering the number of longitude lines.private JFrameHistogramLUT Panel based on surface curvature.private ButtonGroupPicking button group -- switch between picking correspondence points and the puncture triangle.private JRadioButtonCorrespondence point picking.private JRadioButtonPuncture triangle picking.private WildMagic.LibGraphics.SceneGraph.TriMeshBrain Surface TriMeshprivate CorticalAnalysisRenderBrain Surface Renderer.private VolumeTriPlanarInterfaceParent user-interface frame.protected JPanelThe main control.protected JButtonOK button is used on most dialogs.private JScrollPaneThe scroll pane holding the panel content.private static final longUse serialVersionUID for interoperability.protected FontFonts, same asMipavUtil.font12andMipavUtil.font12B.protected FontFonts, same asMipavUtil.font12andMipavUtil.font12B.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_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionCreate the control-panel for the brainsurfaceFlattener interface: -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) protected JButtonBuilds the OK button.static TitledBorderbuildTitledBorder(String title) Builds a titled border with the given title, an etched border, and the proper font and color.private voidCreates a LUT for the surface, where the curvature values are used in the look-up table instead of the ModelImage values:WildMagic.LibGraphics.SceneGraph.NodedisplayCorticalAnalysis(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kCenter) voidMemory cleanup.protected voidfinalize()Return ModelImage A.Return ModelImage B.Return the main control panel.private voidinit()Initialize the user-interface, buttons and ActionCommands.voidresizePanel(int panelWidth, int frameHeight) Resizing the control panel.voidsetSlice(int slice) setSlice.voidsetTimeSlice(int tSlice) setTimeSlice.booleanThis methods calls the componentImage's REPAINT method to redraw the screen.booleanThis methods calls the componentImage's REPAINT method to redraw the screen.booleanupdateImages(boolean flag) This methods calls the componentImage's update method to redraw the screen.booleanupdateImages(ModelLUT LUTa, ModelLUT LUTb, boolean flag, int interpMode) This methods calls the componentImage's update method to redraw the screen.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, setVisible, unregisterKeyboardAction, updateMethods 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, validateTreeMethods 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 Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
mainPanel
The main control. -
serif12
Fonts, same asMipavUtil.font12andMipavUtil.font12B. -
serif12B
Fonts, same asMipavUtil.font12andMipavUtil.font12B. -
OKButton
OK button is used on most dialogs. Defining it in the base allows default actions if the user presses return and the button is in focus. -
cancelButton
Cancel button is used on most dialogs. Defining it in the base allows default actions if the user presses return and the button is in focus. -
m_bFileLoaded
private boolean m_bFileLoadedSet to true when a surface has been loaded -
m_bFirstSurface
private boolean m_bFirstSurfaceCauses the surface LUT to be calculated for the first time. -
m_iGridY
private int m_iGridYKeeps track of the user-interface position in the main panel. -
m_kDisablePick
Enable/disable correspondence picking -
m_kDisplayButtonGroup
ButtonGroup for the plane/surface display selection. -
m_kDisplayPlane
Toggle displaying the plane on/off -
m_kDisplaySphere
Toggle displaying the sphere on/off -
m_kLatLonLines
Toggle display of latitude/longitude lines on/off. -
m_kLUTa
Color LUT based on Volume Data -
m_kLUTImageA
Volume data for LUT -
m_kNumLatText
Text box for entering the number of latitude lines. -
m_kNumLonText
Text box for entering the number of longitude lines. -
m_kPanelBrainsurfaceFlattenerLUT
LUT Panel based on surface curvature. -
m_kPickButtonGroup
Picking button group -- switch between picking correspondence points and the puncture triangle. -
m_kPickCorrespondence
Correspondence point picking. -
m_kPickPuncture
Puncture triangle picking. -
m_kTriangleMesh
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kTriangleMeshBrain Surface TriMesh -
m_kView
Brain Surface Renderer. -
scroller
The scroll pane holding the panel content. Useful when the screen is small. -
m_kInsidePanel
Panel container. -
m_kVolumeViewer
Parent user-interface frame.
-
-
Constructor Details
-
JPanelBrainSurfaceFlattener_WM
public JPanelBrainSurfaceFlattener_WM(CorticalAnalysisRender kView, VolumeTriPlanarInterface kParent) Create the control-panel for the brainsurfaceFlattener interface:- Parameters:
kView- the engine behind the brainsurfaceFlattener and one of the parent frames affected by the interfacekParentFrame- the parent frame for the panel, contains the surfaceRenderer, where the brain model is displayed
-
-
Method Details
-
buildTitledBorder
Builds a titled border with the given title, an etched border, and the proper font and color. Changed to public static member so that it can be used for other JPanels not inherited from this base class.- Parameters:
title- Title of the border- Returns:
- The titled border.
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
displayCorticalAnalysis
public WildMagic.LibGraphics.SceneGraph.Node displayCorticalAnalysis(WildMagic.LibGraphics.SceneGraph.TriMesh kMesh, WildMagic.LibFoundation.Mathematics.Vector3f kCenter) - Parameters:
kMesh-- Returns:
- Scene-graph node containing the TriMesh lat/lon lines.
-
disposeLocal
public void disposeLocal()Memory cleanup. -
getImageA
Return ModelImage A.- Returns:
- ModelImage A.
-
getImageB
Return ModelImage B.- Returns:
- ModelImage B.
-
getMainPanel
Return the main control panel.- Returns:
- JPanel the main control panel
-
resizePanel
public void resizePanel(int panelWidth, int frameHeight) Resizing the control panel.- Parameters:
panelWidth- int widthframeHeight- int height
-
setSlice
public void setSlice(int slice) Description copied from interface:ViewImageUpdateInterfacesetSlice.- Specified by:
setSlicein interfaceViewImageUpdateInterface- Parameters:
slice- Current slice
-
setTimeSlice
public void setTimeSlice(int tSlice) Description copied from interface:ViewImageUpdateInterfacesetTimeSlice.- Specified by:
setTimeSlicein interfaceViewImageUpdateInterface- Parameters:
tSlice- Current time volume
-
updateImageExtents
public boolean updateImageExtents()Description copied from interface:ViewImageUpdateInterfaceThis 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:
updateImageExtentsin interfaceViewImageUpdateInterface- Returns:
- boolean confirming successful update
-
updateImages
public boolean updateImages()Description copied from interface:ViewImageUpdateInterfaceThis methods calls the componentImage's REPAINT method to redraw the screen. Without LUT changes or image changes- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Returns:
- boolean confirming successful update
-
updateImages
public boolean updateImages(boolean flag) Description copied from interface:ViewImageUpdateInterfaceThis methods calls the componentImage's update method to redraw the screen. Without LUT changes.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
flag- forces show to re import image and calc. java image- Returns:
- boolean confirming successful update
-
updateImages
Description copied from interface:ViewImageUpdateInterfaceThis methods calls the componentImage's update method to redraw the screen.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
LUTa- LUT used to update imageALUTb- LUT used to update imageBflag- forces show to re import image and calc. java imageinterpMode- image interpolation method (Nearest or Smooth)- Returns:
- boolean confirming a successful update
-
createLUTFromSurface
private void createLUTFromSurface()Creates a LUT for the surface, where the curvature values are used in the look-up table instead of the ModelImage values: -
init
private void init()Initialize the user-interface, buttons and ActionCommands. -
buildOKButton
Builds the OK button. Sets it internally as well return the just-built button.- Returns:
- OK button.
-
finalize
-