Package gov.nih.mipav.view
Class JPanelVolumeOpacity
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- gov.nih.mipav.view.JPanelVolumeOpacity
-
- All Implemented Interfaces:
ViewJComponentVolOpacityListener,java.awt.event.ActionListener,java.awt.event.ItemListener,java.awt.event.MouseListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible,javax.swing.event.ChangeListener
public class JPanelVolumeOpacity extends javax.swing.JPanel implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.ItemListener, java.awt.event.MouseListener, ViewJComponentVolOpacityListener
Simple panel containing the volume renderer opacity controls.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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 protected javax.swing.JSliderblendSliderOpacity slider of texture 3D volume opacity changes.static intBLUEComponent tag indicator.static intCOMP_AComponent tag indicator.static intCOMP_BComponent tag indicator.static intCOMP_GM_AComponent tag indicator.static intCOMP_GM_BComponent tag indicator.protected ViewJComponentVolOpacityBasecomponentOpacityAReference to component opacity control A.protected ViewJComponentVolOpacityBasecomponentOpacityBReference to component opacity control B.protected ViewJComponentVolOpacityBasecomponentOpacityGM_AReference to component opacity control A GM Rescale.protected ViewJComponentVolOpacityBasecomponentOpacityGM_BReference to component opacity control B GM Rescale.protected javax.swing.JCheckBoxGMCheckBoxGradient Magnitude Check box of the grey scale image.protected ModelImagegradMagRescale_AModel image of the gradient magnitude of image A rescaled to have value in the range [0:255].protected ModelImagegradMagRescale_BModel image of the gradient magnitude of image B rescaled to have value in the range [0:255].static intGREENComponent tag indicator.private ModelHistogramhistogramAHistogram reference for image A.private ModelHistogramhistogramBHistogram reference for image B.private ModelHistogramhistogramGM_AHistogram reference for imageA GM.private ModelHistogramhistogramGM_BHistogram reference for imageB GM.protected ModelImageimageAModel image A.protected ModelImageimageBModel image B.private booleanisActiveImageprivate booleanisChangingprotected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>labelsTableHistorgram dialog slider labels of the imageA, B and GM imageA, B.protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>labelsTableBHistorgram dialog slider labels of the imageA, B and GM imageA, B.protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>labelsTableGM_AHistorgram dialog slider labels of the imageA, B and GM imageA, B.protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>labelsTableGM_BHistorgram dialog slider labels of the imageA, B and GM imageA, B.protected javax.swing.JPanelmainPanelThe main control.protected floatmiddleLabelValueADOCUMENT ME!protected floatmiddleLabelValueBDOCUMENT ME!protected floatmiddleLabelValueGM_ADOCUMENT ME!protected floatmiddleLabelValueGM_BDOCUMENT ME!protected javax.swing.JSlidermouseSliderDOCUMENT ME!protected javax.swing.JSlidermouseSliderBDOCUMENT ME!protected javax.swing.JSlidermouseSliderGM_ADOCUMENT ME!protected javax.swing.JSlidermouseSliderGM_BDOCUMENT ME!protected static java.lang.StringOPACITY_COMPONENT_TAB_ADOCUMENT ME!protected static java.lang.StringOPACITY_COMPONENT_TAB_A_GMDOCUMENT ME!protected static java.lang.StringOPACITY_COMPONENT_TAB_BDOCUMENT ME!protected static java.lang.StringOPACITY_COMPONENT_TAB_B_GMDOCUMENT ME!protected javax.swing.JLabel[]opacitySliderLabelsAThe labels below the opacity slider.protected javax.swing.JLabel[]opacitySliderLabelsBThe labels below the opacity slider.protected javax.swing.JLabel[]opacitySliderLabelsGM_ADOCUMENT ME!protected javax.swing.JLabel[]opacitySliderLabelsGM_BDOCUMENT ME!protected javax.swing.JPanelpanelOpacityAPanels that hold the the control components (opacity maps).protected javax.swing.JPanelpanelOpacityBDOCUMENT ME!protected javax.swing.JPanelpanelOpacityGM_ADOCUMENT ME!protected javax.swing.JPanelpanelOpacityGM_BDOCUMENT ME!protected javax.swing.JTextFieldrangeTextX range text field in the imageA, B histogram dialog.protected javax.swing.JTextFieldrangeTextBX range text field in the imageA, B histogram dialog.protected javax.swing.JTextFieldrangeTextGM_AX range text field in the Gradient Magnitude imageA, B histogram dialog.protected javax.swing.JTextFieldrangeTextGM_BX range text field in the Gradient Magnitude imageA, B histogram dialog.static intREDComponent tag indicator.protected floatscaleRangeAScale range value according to the image min and max.protected floatscaleRangeBScale range value according to the image min and max.protected floatscaleRangeGM_AScale range value according to the image min and max.protected floatscaleRangeGM_BScale range value according to the image min and max.private static longserialVersionUIDUse serialVersionUID for interoperability.protected javax.swing.JTabbedPanetabbedPaneTabbed pane that contains the list of opacity functions.protected javax.swing.JTextFieldxRangeTextAX range text field in the imageA, B and GM image A, B histogram dialog.protected javax.swing.JTextFieldxRangeTextBX range text field in the imageA, B and GM image A, B histogram dialog.protected javax.swing.JTextFieldxRangeTextGM_AX range text field in the imageA, B and GM image A, B histogram dialog.protected javax.swing.JTextFieldxRangeTextGM_BX range text field in the imageA, B and GM image A, B histogram dialog.protected javax.swing.JTextFieldyRangeTextAY range text field in the imageA, B and GM image A, B histogram dialog.protected javax.swing.JTextFieldyRangeTextBY range text field in the imageA, B and GM image A, B histogram dialog.protected javax.swing.JTextFieldyRangeTextGM_AY range text field in the imageA, B and GM image A, B histogram dialog.protected javax.swing.JTextFieldyRangeTextGM_BY range text field in the imageA, B and GM image A, B histogram dialog.-
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 JPanelVolumeOpacity(ModelImage _imgA, ModelImage _imgB)Creates new dialog for converting type of image.JPanelVolumeOpacity(ModelImage _imgA, ModelImage _imgB, ModelImage _imageAGM, ModelImage _imageBGM)Creates new dialog for converting type of image.JPanelVolumeOpacity(ModelImage _imgA, ModelImage _imgB, ModelImage _imageAGM, ModelImage _imageBGM, boolean _simpleDisplay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent event)Closes dialog box when the OK button is pressed and sets the variables.voidaddGM()Add the gradient magnitude histogram to the opacity control panel.protected javax.swing.JPanelbuildBlendPanel()Build the blend slider control panel.private voidbuildPanelA()Method that displays the histogram and controls to manipulate the opacity.private voidbuildPanelB()Method that displays the histogram and controls to manipulate the opacity.private voidbuildPanelGM_A()Method that displays the histogram and controls to manipulate the opacity.private voidbuildPanelGM_B()Method that displays the histogram and controls to manipulate the opacity.private ModelHistogramcalcHistogram(ModelImage image, int dim, int channel)Calculates histogram for the imageA, B.voiddisposeLocal()Clear memory and garbage collection.protected voidfinalize()Calls dispose.intgetAlphaBlendSliderValue()This function returns the value of the blending slider.ViewJComponentVolOpacityBasegetCompA()Return the opacity histrogram component of the imageA.ViewJComponentVolOpacityBasegetCompA_GM()Return the opacity histrogram component of the Gradient Magnitude imageA.ViewJComponentVolOpacityBasegetCompB()Return the opacity histrogram component of the imageB.ViewJComponentVolOpacityBasegetCompB_GM()Return the opacity histrogram component of the Gradient Magnitude imageB.ModelImagegetGradMagA()Get the gradient magnitude imageA.ModelImagegetGradMagB()Get the gradient magnitude imageB.ModelImagegetImageA()Accessor that returns the imageA.ModelImagegetImageB()Accessor that returns the image.protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>getLabelTableA()Build the hash table for the imageA opacity slider.protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>getLabelTableB()Build the hash table for the imageB opacity slider.protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>getLabelTableGM_A()Build the hash table for the imageA GM opacity slider.protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel>getLabelTableGM_B()Build the hash table for the imageA GM opacity slider.javax.swing.JPanelgetMainPanel()Sets up the GUI (panels, buttons, etc) and displays it on the screen.ViewJComponentVolOpacityBasegetSelectedComponent()Return the selected tabbbed pane component.ViewJComponentVolOpacityBasegetSelectedComponent(int _whichComp)Return the active image component.intgetSelectedTabIndex()Returns the index of the selected panel in the tabbed pane.javax.swing.JTabbedPanegetTabbedPane()Accessor to the tabbed pane.protected voidinitBlendSliderLabels()Initialize the blend slider labels.private voidinitialize(boolean simpleDisplay)Sets up the GUI (panels, buttons, etc) and displays it on the screen.booleanisChanging()booleanisGradientMagnitudeOpacityEnabled()Return whether or not the opacity mapping based on gradient magnitude is enabled.voiditemStateChanged(java.awt.event.ItemEvent event)Sets the flags for the checkboxes.private booleanloadGM()Calculates histogram for the gradient magnitude imageA, B.protected booleanloadGMImage(java.lang.String dName, java.lang.String fName, boolean isImageA)Loads the gradient magnitude image instead of recalculating the image.voidmouseClicked(java.awt.event.MouseEvent event)Not used method.voidmouseEntered(java.awt.event.MouseEvent event)Not used method.voidmouseExited(java.awt.event.MouseEvent event)Not used method.voidmousePressed(java.awt.event.MouseEvent event)Not used method.voidmouseReleased(java.awt.event.MouseEvent event)Mouse release event.voidremoveGM()Add the gradient magnitude hitogram to the opacity control panel.voidresizePanel(int panelWidth, int frameHeight)Resize the control panel when mouse drag expanding or minimizing the frame.voidsetAdjustersEnabled(boolean enabled)This method will enable or disable the opacity panel's slider component and input text fields, based on the value of the boolean parameter passed into it.voidsetAlphaBlendSliderValue(int iValue)Sets the blendSlider value.voidsetGradientMagnitudeOpacityEnabled(boolean value)Return whether or not the opacity mapping based on gradient magnitude is enabled.voidsetImages(ModelImage _imgA, ModelImage _imgB, ModelImage _imageAGM, ModelImage _imageBGM, boolean _simpleDisplay)voidsetSelectedTabIndex(int i)Sets the tabbed pane selected panel based on the input index.voidstateChanged(javax.swing.event.ChangeEvent event)ChangeListener for opacity slider changes.voidupdate(boolean isChanging)voidupdateSlider(ViewJComponentVolOpacityBase childComponent)Adjust the opacity slider for the minor opacity changes.-
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, setVisible, 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
-
histogramA
private ModelHistogram histogramA
Histogram reference for image A.
-
histogramB
private ModelHistogram histogramB
Histogram reference for image B.
-
histogramGM_A
private ModelHistogram histogramGM_A
Histogram reference for imageA GM.
-
histogramGM_B
private ModelHistogram histogramGM_B
Histogram reference for imageB GM.
-
isActiveImage
private boolean isActiveImage
-
mainPanel
protected javax.swing.JPanel mainPanel
The main control.
-
COMP_A
public static final int COMP_A
Component tag indicator.- See Also:
- Constant Field Values
-
COMP_B
public static final int COMP_B
Component tag indicator.- See Also:
- Constant Field Values
-
COMP_GM_A
public static final int COMP_GM_A
Component tag indicator.- See Also:
- Constant Field Values
-
COMP_GM_B
public static final int COMP_GM_B
Component tag indicator.- See Also:
- Constant Field Values
-
OPACITY_COMPONENT_TAB_A
protected static final java.lang.String OPACITY_COMPONENT_TAB_A
DOCUMENT ME!- See Also:
- Constant Field Values
-
OPACITY_COMPONENT_TAB_B
protected static final java.lang.String OPACITY_COMPONENT_TAB_B
DOCUMENT ME!- See Also:
- Constant Field Values
-
OPACITY_COMPONENT_TAB_A_GM
protected static final java.lang.String OPACITY_COMPONENT_TAB_A_GM
DOCUMENT ME!- See Also:
- Constant Field Values
-
OPACITY_COMPONENT_TAB_B_GM
protected static final java.lang.String OPACITY_COMPONENT_TAB_B_GM
DOCUMENT ME!- See Also:
- Constant Field Values
-
RED
public static final int RED
Component tag indicator.- See Also:
- Constant Field Values
-
GREEN
public static final int GREEN
Component tag indicator.- See Also:
- Constant Field Values
-
BLUE
public static final int BLUE
Component tag indicator.- See Also:
- Constant Field Values
-
blendSlider
protected javax.swing.JSlider blendSlider
Opacity slider of texture 3D volume opacity changes.
-
componentOpacityA
protected ViewJComponentVolOpacityBase componentOpacityA
Reference to component opacity control A.
-
componentOpacityB
protected ViewJComponentVolOpacityBase componentOpacityB
Reference to component opacity control B.
-
componentOpacityGM_A
protected ViewJComponentVolOpacityBase componentOpacityGM_A
Reference to component opacity control A GM Rescale.
-
componentOpacityGM_B
protected ViewJComponentVolOpacityBase componentOpacityGM_B
Reference to component opacity control B GM Rescale.
-
GMCheckBox
protected javax.swing.JCheckBox GMCheckBox
Gradient Magnitude Check box of the grey scale image.
-
gradMagRescale_A
protected ModelImage gradMagRescale_A
Model image of the gradient magnitude of image A rescaled to have value in the range [0:255].
-
gradMagRescale_B
protected ModelImage gradMagRescale_B
Model image of the gradient magnitude of image B rescaled to have value in the range [0:255].
-
imageA
protected ModelImage imageA
Model image A.
-
imageB
protected ModelImage imageB
Model image B.
-
labelsTable
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> labelsTable
Historgram dialog slider labels of the imageA, B and GM imageA, B.
-
labelsTableB
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> labelsTableB
Historgram dialog slider labels of the imageA, B and GM imageA, B.
-
labelsTableGM_A
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> labelsTableGM_A
Historgram dialog slider labels of the imageA, B and GM imageA, B.
-
labelsTableGM_B
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> labelsTableGM_B
Historgram dialog slider labels of the imageA, B and GM imageA, B.
-
middleLabelValueA
protected float middleLabelValueA
DOCUMENT ME!
-
middleLabelValueB
protected float middleLabelValueB
DOCUMENT ME!
-
middleLabelValueGM_A
protected float middleLabelValueGM_A
DOCUMENT ME!
-
middleLabelValueGM_B
protected float middleLabelValueGM_B
DOCUMENT ME!
-
mouseSlider
protected javax.swing.JSlider mouseSlider
DOCUMENT ME!
-
mouseSliderB
protected javax.swing.JSlider mouseSliderB
DOCUMENT ME!
-
mouseSliderGM_A
protected javax.swing.JSlider mouseSliderGM_A
DOCUMENT ME!
-
mouseSliderGM_B
protected javax.swing.JSlider mouseSliderGM_B
DOCUMENT ME!
-
opacitySliderLabelsA
protected javax.swing.JLabel[] opacitySliderLabelsA
The labels below the opacity slider.
-
opacitySliderLabelsB
protected javax.swing.JLabel[] opacitySliderLabelsB
The labels below the opacity slider.
-
opacitySliderLabelsGM_A
protected javax.swing.JLabel[] opacitySliderLabelsGM_A
DOCUMENT ME!
-
opacitySliderLabelsGM_B
protected javax.swing.JLabel[] opacitySliderLabelsGM_B
DOCUMENT ME!
-
panelOpacityA
protected javax.swing.JPanel panelOpacityA
Panels that hold the the control components (opacity maps).
-
panelOpacityB
protected javax.swing.JPanel panelOpacityB
DOCUMENT ME!
-
panelOpacityGM_A
protected javax.swing.JPanel panelOpacityGM_A
DOCUMENT ME!
-
panelOpacityGM_B
protected javax.swing.JPanel panelOpacityGM_B
DOCUMENT ME!
-
rangeText
protected javax.swing.JTextField rangeText
X range text field in the imageA, B histogram dialog.
-
rangeTextB
protected javax.swing.JTextField rangeTextB
X range text field in the imageA, B histogram dialog.
-
rangeTextGM_A
protected javax.swing.JTextField rangeTextGM_A
X range text field in the Gradient Magnitude imageA, B histogram dialog.
-
rangeTextGM_B
protected javax.swing.JTextField rangeTextGM_B
X range text field in the Gradient Magnitude imageA, B histogram dialog.
-
scaleRangeA
protected float scaleRangeA
Scale range value according to the image min and max.
-
scaleRangeB
protected float scaleRangeB
Scale range value according to the image min and max.
-
scaleRangeGM_A
protected float scaleRangeGM_A
Scale range value according to the image min and max.
-
scaleRangeGM_B
protected float scaleRangeGM_B
Scale range value according to the image min and max.
-
tabbedPane
protected javax.swing.JTabbedPane tabbedPane
Tabbed pane that contains the list of opacity functions.
-
xRangeTextA
protected javax.swing.JTextField xRangeTextA
X range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
xRangeTextB
protected javax.swing.JTextField xRangeTextB
X range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
xRangeTextGM_A
protected javax.swing.JTextField xRangeTextGM_A
X range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
xRangeTextGM_B
protected javax.swing.JTextField xRangeTextGM_B
X range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
yRangeTextA
protected javax.swing.JTextField yRangeTextA
Y range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
yRangeTextB
protected javax.swing.JTextField yRangeTextB
Y range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
yRangeTextGM_A
protected javax.swing.JTextField yRangeTextGM_A
Y range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
yRangeTextGM_B
protected javax.swing.JTextField yRangeTextGM_B
Y range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
-
isChanging
private boolean isChanging
-
-
Constructor Detail
-
JPanelVolumeOpacity
public JPanelVolumeOpacity(ModelImage _imgA, ModelImage _imgB)
Creates new dialog for converting type of image.- Parameters:
_imgA- Source imageA._imgB- Source imageB.
-
JPanelVolumeOpacity
public JPanelVolumeOpacity(ModelImage _imgA, ModelImage _imgB, ModelImage _imageAGM, ModelImage _imageBGM)
Creates new dialog for converting type of image.- Parameters:
_imgA- Source imageA._imgB- Source imageB.
-
JPanelVolumeOpacity
public JPanelVolumeOpacity(ModelImage _imgA, ModelImage _imgB, ModelImage _imageAGM, ModelImage _imageBGM, boolean _simpleDisplay)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Closes dialog box when the OK button is pressed and sets the variables.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
event- Event that triggers this function
-
addGM
public void addGM()
Add the gradient magnitude histogram to the opacity control panel.
-
disposeLocal
public void disposeLocal()
Clear memory and garbage collection.
-
getAlphaBlendSliderValue
public int getAlphaBlendSliderValue()
This function returns the value of the blending slider.- Returns:
- int the value of the slider, or a default of 50 (the median value) if the slider has not been initialized
-
getCompA
public ViewJComponentVolOpacityBase getCompA()
Return the opacity histrogram component of the imageA.- Returns:
- componentOpacityA opacity component A.
-
getCompA_GM
public ViewJComponentVolOpacityBase getCompA_GM()
Return the opacity histrogram component of the Gradient Magnitude imageA.- Returns:
- componentOpacityGM_A gradient magnitude component A.
-
getCompB
public ViewJComponentVolOpacityBase getCompB()
Return the opacity histrogram component of the imageB.- Returns:
- componentOpacityB opacity component B.
-
getCompB_GM
public ViewJComponentVolOpacityBase getCompB_GM()
Return the opacity histrogram component of the Gradient Magnitude imageB.- Returns:
- componentOpacityGM_B gradient magnitude component B.
-
getGradMagA
public ModelImage getGradMagA()
Get the gradient magnitude imageA.- Returns:
- ModelImage GM imageA
-
getGradMagB
public ModelImage getGradMagB()
Get the gradient magnitude imageB.- Returns:
- ModelImage GM imageB
-
getImageA
public ModelImage getImageA()
Accessor that returns the imageA.- Returns:
- image
-
getImageB
public ModelImage getImageB()
Accessor that returns the image.- Returns:
- image
-
getMainPanel
public javax.swing.JPanel getMainPanel()
Sets up the GUI (panels, buttons, etc) and displays it on the screen. Change the layout of the volume opacity change diagram.- Returns:
- DOCUMENT ME!
-
getSelectedComponent
public ViewJComponentVolOpacityBase getSelectedComponent()
Return the selected tabbbed pane component. Should be overridden in JPanelVolOpacity and JPanelVolOpacityRGB- Returns:
- ViewJComponentHLUTBase the opacity component.
-
getSelectedComponent
public ViewJComponentVolOpacityBase getSelectedComponent(int _whichComp)
Return the active image component.- Parameters:
_whichComp- true = imageA, false = imageB- Returns:
- componentOpacity A or B.
-
getSelectedTabIndex
public int getSelectedTabIndex()
Returns the index of the selected panel in the tabbed pane.- Returns:
-
getTabbedPane
public javax.swing.JTabbedPane getTabbedPane()
Accessor to the tabbed pane.- Returns:
- JTabbedPane
-
isChanging
public boolean isChanging()
-
isGradientMagnitudeOpacityEnabled
public boolean isGradientMagnitudeOpacityEnabled()
Return whether or not the opacity mapping based on gradient magnitude is enabled.- Returns:
- boolean True if using gradient magnitude-based opacity mapping.
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent event)
Sets the flags for the checkboxes.- Specified by:
itemStateChangedin interfacejava.awt.event.ItemListener- Parameters:
event- event that triggered this function
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent event)
Not used method.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener- Parameters:
event- MouseEvent
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent event)
Not used method.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener- Parameters:
event- MouseEvent
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent event)
Not used method.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener- Parameters:
event- MouseEvent
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent event)
Not used method.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener- Parameters:
event- MouseEvent
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent event)
Mouse release event.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener- Parameters:
event- MouseEvent
-
removeGM
public void removeGM()
Add the gradient magnitude hitogram to the opacity control panel.
-
resizePanel
public void resizePanel(int panelWidth, int frameHeight)Resize the control panel when mouse drag expanding or minimizing the frame.- Parameters:
panelWidth- widthframeHeight- height
-
setAdjustersEnabled
public void setAdjustersEnabled(boolean enabled)
This method will enable or disable the opacity panel's slider component and input text fields, based on the value of the boolean parameter passed into it.- Specified by:
setAdjustersEnabledin interfaceViewJComponentVolOpacityListener- Parameters:
enabled- boolean whether the adjusters should be enabled or disabled
-
setAlphaBlendSliderValue
public void setAlphaBlendSliderValue(int iValue)
Sets the blendSlider value.- Parameters:
iValue- new slider value.
-
setGradientMagnitudeOpacityEnabled
public void setGradientMagnitudeOpacityEnabled(boolean value)
Return whether or not the opacity mapping based on gradient magnitude is enabled.
-
setSelectedTabIndex
public void setSelectedTabIndex(int i)
Sets the tabbed pane selected panel based on the input index.- Parameters:
i-
-
stateChanged
public void stateChanged(javax.swing.event.ChangeEvent event)
ChangeListener for opacity slider changes.- Specified by:
stateChangedin interfacejavax.swing.event.ChangeListener- Parameters:
event- The change event.
-
update
public void update(boolean isChanging)
- Specified by:
updatein interfaceViewJComponentVolOpacityListener
-
updateSlider
public void updateSlider(ViewJComponentVolOpacityBase childComponent)
Adjust the opacity slider for the minor opacity changes.- Specified by:
updateSliderin interfaceViewJComponentVolOpacityListener- Parameters:
childComponent- ViewJComponentVolOpacityBase reference
-
buildBlendPanel
protected javax.swing.JPanel buildBlendPanel()
Build the blend slider control panel.- Returns:
- blendPanel built blend panel.
-
finalize
protected void finalize() throws java.lang.ThrowableCalls dispose.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- DOCUMENT ME!
-
getLabelTableA
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> getLabelTableA()
Build the hash table for the imageA opacity slider.- Returns:
- labels built label hash table.
-
getLabelTableB
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> getLabelTableB()
Build the hash table for the imageB opacity slider.- Returns:
- labels built label hash table.
-
getLabelTableGM_A
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> getLabelTableGM_A()
Build the hash table for the imageA GM opacity slider.- Returns:
- labels built label hash table.
-
getLabelTableGM_B
protected java.util.Hashtable<java.lang.Integer,javax.swing.JLabel> getLabelTableGM_B()
Build the hash table for the imageA GM opacity slider.- Returns:
- labels built label hash table.
-
initBlendSliderLabels
protected void initBlendSliderLabels()
Initialize the blend slider labels.
-
loadGMImage
protected boolean loadGMImage(java.lang.String dName, java.lang.String fName, boolean isImageA)Loads the gradient magnitude image instead of recalculating the image.- Parameters:
dName- String User specified directory name.fName- String GM image file name.isImageA- boolean Indicates GM imageA or GM imageB- Returns:
- boolean Indicates loading GM image successful or not.
-
buildPanelA
private void buildPanelA()
Method that displays the histogram and controls to manipulate the opacity. Panel for image A.
-
buildPanelB
private void buildPanelB()
Method that displays the histogram and controls to manipulate the opacity. Panel for image B. Reset the layout.
-
buildPanelGM_A
private void buildPanelGM_A()
Method that displays the histogram and controls to manipulate the opacity. Panel for image GM_A.
-
buildPanelGM_B
private void buildPanelGM_B()
Method that displays the histogram and controls to manipulate the opacity. Panel for image GM_B.
-
calcHistogram
private ModelHistogram calcHistogram(ModelImage image, int dim, int channel)
Calculates histogram for the imageA, B.
-
setImages
public void setImages(ModelImage _imgA, ModelImage _imgB, ModelImage _imageAGM, ModelImage _imageBGM, boolean _simpleDisplay)
-
initialize
private void initialize(boolean simpleDisplay)
Sets up the GUI (panels, buttons, etc) and displays it on the screen. Change the layout of the volume opacity change diagram.
-
loadGM
private boolean loadGM()
Calculates histogram for the gradient magnitude imageA, B.
-
-