Class 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
      • 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.swing.JSlider blendSlider
      Opacity slider of texture 3D volume opacity changes.
      static int BLUE
      Component tag indicator.
      static int COMP_A
      Component tag indicator.
      static int COMP_B
      Component tag indicator.
      static int COMP_GM_A
      Component tag indicator.
      static int COMP_GM_B
      Component tag indicator.
      protected ViewJComponentVolOpacityBase componentOpacityA
      Reference to component opacity control A.
      protected ViewJComponentVolOpacityBase componentOpacityB
      Reference to component opacity control B.
      protected ViewJComponentVolOpacityBase componentOpacityGM_A
      Reference to component opacity control A GM Rescale.
      protected ViewJComponentVolOpacityBase componentOpacityGM_B
      Reference to component opacity control B GM Rescale.
      protected javax.swing.JCheckBox GMCheckBox
      Gradient Magnitude Check box of the grey scale image.
      protected ModelImage gradMagRescale_A
      Model image of the gradient magnitude of image A rescaled to have value in the range [0:255].
      protected ModelImage gradMagRescale_B
      Model image of the gradient magnitude of image B rescaled to have value in the range [0:255].
      static int GREEN
      Component tag indicator.
      private ModelHistogram histogramA
      Histogram reference for image A.
      private ModelHistogram histogramB
      Histogram reference for image B.
      private ModelHistogram histogramGM_A
      Histogram reference for imageA GM.
      private ModelHistogram histogramGM_B
      Histogram reference for imageB GM.
      protected ModelImage imageA
      Model image A.
      protected ModelImage imageB
      Model image B.
      private boolean isActiveImage  
      private boolean isChanging  
      protected java.util.Hashtable<java.lang.Integer,​javax.swing.JLabel> labelsTable
      Historgram dialog slider labels of the imageA, B and GM imageA, B.
      protected java.util.Hashtable<java.lang.Integer,​javax.swing.JLabel> labelsTableB
      Historgram dialog slider labels of the imageA, B and GM imageA, B.
      protected java.util.Hashtable<java.lang.Integer,​javax.swing.JLabel> labelsTableGM_A
      Historgram dialog slider labels of the imageA, B and GM imageA, 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.
      protected javax.swing.JPanel mainPanel
      The main control.
      protected float middleLabelValueA
      DOCUMENT ME!
      protected float middleLabelValueB
      DOCUMENT ME!
      protected float middleLabelValueGM_A
      DOCUMENT ME!
      protected float middleLabelValueGM_B
      DOCUMENT ME!
      protected javax.swing.JSlider mouseSlider
      DOCUMENT ME!
      protected javax.swing.JSlider mouseSliderB
      DOCUMENT ME!
      protected javax.swing.JSlider mouseSliderGM_A
      DOCUMENT ME!
      protected javax.swing.JSlider mouseSliderGM_B
      DOCUMENT ME!
      protected static java.lang.String OPACITY_COMPONENT_TAB_A
      DOCUMENT ME!
      protected static java.lang.String OPACITY_COMPONENT_TAB_A_GM
      DOCUMENT ME!
      protected static java.lang.String OPACITY_COMPONENT_TAB_B
      DOCUMENT ME!
      protected static java.lang.String OPACITY_COMPONENT_TAB_B_GM
      DOCUMENT ME!
      protected javax.swing.JLabel[] opacitySliderLabelsA
      The labels below the opacity slider.
      protected javax.swing.JLabel[] opacitySliderLabelsB
      The labels below the opacity slider.
      protected javax.swing.JLabel[] opacitySliderLabelsGM_A
      DOCUMENT ME!
      protected javax.swing.JLabel[] opacitySliderLabelsGM_B
      DOCUMENT ME!
      protected javax.swing.JPanel panelOpacityA
      Panels that hold the the control components (opacity maps).
      protected javax.swing.JPanel panelOpacityB
      DOCUMENT ME!
      protected javax.swing.JPanel panelOpacityGM_A
      DOCUMENT ME!
      protected javax.swing.JPanel panelOpacityGM_B
      DOCUMENT ME!
      protected javax.swing.JTextField rangeText
      X range text field in the imageA, B histogram dialog.
      protected javax.swing.JTextField rangeTextB
      X range text field in the imageA, B histogram dialog.
      protected javax.swing.JTextField rangeTextGM_A
      X range text field in the Gradient Magnitude imageA, B histogram dialog.
      protected javax.swing.JTextField rangeTextGM_B
      X range text field in the Gradient Magnitude imageA, B histogram dialog.
      static int RED
      Component tag indicator.
      protected float scaleRangeA
      Scale range value according to the image min and max.
      protected float scaleRangeB
      Scale range value according to the image min and max.
      protected float scaleRangeGM_A
      Scale range value according to the image min and max.
      protected float scaleRangeGM_B
      Scale range value according to the image min and max.
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      protected javax.swing.JTabbedPane tabbedPane
      Tabbed pane that contains the list of opacity functions.
      protected javax.swing.JTextField xRangeTextA
      X range text field in the imageA, B and GM image A, B histogram dialog.
      protected javax.swing.JTextField xRangeTextB
      X range text field in the imageA, B and GM image A, B histogram dialog.
      protected javax.swing.JTextField xRangeTextGM_A
      X range text field in the imageA, B and GM image A, B histogram dialog.
      protected javax.swing.JTextField xRangeTextGM_B
      X range text field in the imageA, B and GM image A, B histogram dialog.
      protected javax.swing.JTextField yRangeTextA
      Y range text field in the imageA, B and GM image A, B histogram dialog.
      protected javax.swing.JTextField yRangeTextB
      Y range text field in the imageA, B and GM image A, B histogram dialog.
      protected javax.swing.JTextField yRangeTextGM_A
      Y range text field in the imageA, B and GM image A, B histogram dialog.
      protected javax.swing.JTextField yRangeTextGM_B
      Y 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
      • Fields inherited from class java.awt.Component

        accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • 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 and sets the variables.
      void addGM()
      Add the gradient magnitude histogram to the opacity control panel.
      protected javax.swing.JPanel buildBlendPanel()
      Build the blend slider control panel.
      private void buildPanelA()
      Method that displays the histogram and controls to manipulate the opacity.
      private void buildPanelB()
      Method that displays the histogram and controls to manipulate the opacity.
      private void buildPanelGM_A()
      Method that displays the histogram and controls to manipulate the opacity.
      private void buildPanelGM_B()
      Method that displays the histogram and controls to manipulate the opacity.
      private ModelHistogram calcHistogram​(ModelImage image, int dim, int channel)
      Calculates histogram for the imageA, B.
      void disposeLocal()
      Clear memory and garbage collection.
      protected void finalize()
      Calls dispose.
      int getAlphaBlendSliderValue()
      This function returns the value of the blending slider.
      ViewJComponentVolOpacityBase getCompA()
      Return the opacity histrogram component of the imageA.
      ViewJComponentVolOpacityBase getCompA_GM()
      Return the opacity histrogram component of the Gradient Magnitude imageA.
      ViewJComponentVolOpacityBase getCompB()
      Return the opacity histrogram component of the imageB.
      ViewJComponentVolOpacityBase getCompB_GM()
      Return the opacity histrogram component of the Gradient Magnitude imageB.
      ModelImage getGradMagA()
      Get the gradient magnitude imageA.
      ModelImage getGradMagB()
      Get the gradient magnitude imageB.
      ModelImage getImageA()
      Accessor that returns the imageA.
      ModelImage getImageB()
      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.JPanel getMainPanel()
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
      ViewJComponentVolOpacityBase getSelectedComponent()
      Return the selected tabbbed pane component.
      ViewJComponentVolOpacityBase getSelectedComponent​(int _whichComp)
      Return the active image component.
      int getSelectedTabIndex()
      Returns the index of the selected panel in the tabbed pane.
      javax.swing.JTabbedPane getTabbedPane()
      Accessor to the tabbed pane.
      protected void initBlendSliderLabels()
      Initialize the blend slider labels.
      private void initialize​(boolean simpleDisplay)
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
      boolean isChanging()  
      boolean isGradientMagnitudeOpacityEnabled()
      Return whether or not the opacity mapping based on gradient magnitude is enabled.
      void itemStateChanged​(java.awt.event.ItemEvent event)
      Sets the flags for the checkboxes.
      private boolean loadGM()
      Calculates histogram for the gradient magnitude imageA, B.
      protected boolean loadGMImage​(java.lang.String dName, java.lang.String fName, boolean isImageA)
      Loads the gradient magnitude image instead of recalculating the image.
      void mouseClicked​(java.awt.event.MouseEvent event)
      Not used method.
      void mouseEntered​(java.awt.event.MouseEvent event)
      Not used method.
      void mouseExited​(java.awt.event.MouseEvent event)
      Not used method.
      void mousePressed​(java.awt.event.MouseEvent event)
      Not used method.
      void mouseReleased​(java.awt.event.MouseEvent event)
      Mouse release event.
      void removeGM()
      Add the gradient magnitude hitogram to the opacity control panel.
      void resizePanel​(int panelWidth, int frameHeight)
      Resize the control panel when mouse drag expanding or minimizing the frame.
      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.
      void setAlphaBlendSliderValue​(int iValue)
      Sets the blendSlider value.
      void setGradientMagnitudeOpacityEnabled​(boolean value)
      Return whether or not the opacity mapping based on gradient magnitude is enabled.
      void setImages​(ModelImage _imgA, ModelImage _imgB, ModelImage _imageAGM, ModelImage _imageBGM, boolean _simpleDisplay)  
      void setSelectedTabIndex​(int i)
      Sets the tabbed pane selected panel based on the input index.
      void stateChanged​(javax.swing.event.ChangeEvent event)
      ChangeListener for opacity slider changes.
      void update​(boolean isChanging)  
      void updateSlider​(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
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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.
      • 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
      • blendSlider

        protected javax.swing.JSlider blendSlider
        Opacity slider of texture 3D volume opacity changes.
      • 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.
    • 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:
        actionPerformed in interface java.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:
        itemStateChanged in interface java.awt.event.ItemListener
        Parameters:
        event - event that triggered this function
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent event)
        Not used method.
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
        Parameters:
        event - MouseEvent
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent event)
        Not used method.
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        Parameters:
        event - MouseEvent
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent event)
        Not used method.
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
        Parameters:
        event - MouseEvent
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent event)
        Not used method.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Parameters:
        event - MouseEvent
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent event)
        Mouse release event.
        Specified by:
        mouseReleased in interface java.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 - width
        frameHeight - 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:
        setAdjustersEnabled in interface ViewJComponentVolOpacityListener
        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:
        stateChanged in interface javax.swing.event.ChangeListener
        Parameters:
        event - The change event.
      • buildBlendPanel

        protected javax.swing.JPanel buildBlendPanel()
        Build the blend slider control panel.
        Returns:
        blendPanel built blend panel.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Calls dispose.
        Overrides:
        finalize in class java.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.
      • 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.