Class JPanelHistogram

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

    public class JPanelHistogram
    extends javax.swing.JPanel
    implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.ItemListener, java.awt.event.KeyListener, HistoLUTParent
    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
      private javax.swing.JCheckBox blueCheckBox
      checkbox for turning on / off the blue component of the color look-up table.
      private JDialogCT ctDialog  
      private int cursorIndex
      Active mouse cursor index of the imageA, B and GM image A, B.
      private javax.swing.JCheckBox greenCheckBox
      checkbox for turning on / off the green component of the color look-up table.
      protected ModelHistogram histogram
      red, green and blue histograms:
      protected ModelHistogram histogramB
      red, green and blue histograms:
      protected ModelHistogram histogramG
      red, green and blue histograms:
      protected ViewJPanelHistoLUT histoPanel
      histogram panel interface.
      protected ModelImage image
      input image
      private javax.swing.JTextField indexColorTextF
      displays the selected LUT color
      private javax.swing.JCheckBox interpCheckBox
      turns interpolation on/off
      private java.util.Hashtable<java.lang.Integer,​javax.swing.JLabel> labelsTable  
      private javax.swing.JCheckBox logCheckBox
      turns log display on/off
      protected ModelStorageBase LUT
      input LUT, either ModelLUT or ModelRGB
      private javax.swing.JSlider mouseSlider
      slider for small LUT changes
      private javax.swing.JLabel[] mouseSliderLabels  
      private javax.swing.JTextField nColorsTextF
      displays the number of colors in the LUT
      private javax.swing.JCheckBox oneBasedLUTCheckBoxImage
      sets the minimum LUT value to (1,1,1)
      private javax.swing.JComboBox outputBox
      enables the user to set the image output type or LUT-based image extration
      protected JFrameHistogram panelParent
      containing parent class.
      private float rangeX
      X range value of the imageA, B and GM imageA, B.
      private javax.swing.JCheckBox redCheckBox
      checkbox for turning on / off the red component of the color look-up table.
      protected int scaleRange  
      private static long serialVersionUID  
      private javax.swing.JTextField threshFillF
      displays the threshold fill-value
      private javax.swing.JTextField threshLowerF
      displays the threshold lower-value
      private javax.swing.JTextField threshUpperF
      displays the threshold upper-value
      protected javax.swing.JToolBar toolBarBottom
      bottom tool bar
      protected javax.swing.JToolBar toolBarThreshold
      threshold tool bar
      private javax.swing.JCheckBox updateCheckBox
      enables the user to set updating the display in real-time or only on mouse-release
      private javax.swing.JLabel voxelVolumeLabel
      volume threshold vaue
      protected boolean wholeImage
      true = apply algorithm to the whole image
      private javax.swing.JTextField xRangeText  
      private javax.swing.JTextField yRangeText  
      • 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 Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)  
      protected javax.swing.JPanel buildControlPanel​(ModelImage image, boolean addAdjustment)
      Builds the interface panel.
      private static javax.swing.JToolBar buildLUTSelectionList​(java.awt.event.ActionListener listener)
      Build the center part of the LUT toolbar.
      protected javax.swing.JPanel buildMousePanel​(double range)
      Builds the mouse panel.
      protected void buildPanel()
      Method that displays the histogram and LUT and other controls to manipulate the LUT.
      protected void buildSimplePanel()  
      protected javax.swing.JPanel buildSimpleToolBar​(ModelImage image)  
      protected javax.swing.JPanel buildToolBar​(ModelImage image)
      Builds the toolbars.
      protected ModelHistogram calcHistogram​(ModelImage image, boolean entireFlag, int offset)
      Calculates histogram for the image(s).
      void calcThreshold()
      Calculates the thresholded image based on the parameters of the threshold transfer function.
      void calculateThreshold()
      Calculates the volume (for 3D images) or area (for 2D images) of the image between the two values from the upper and lower bounds text areas.
      void calculateThreshold​(float lower, float upper)
      Calculates the volume or area of the image between the two values from the upper and lower bounds (inclusive).
      private void calculateThresholdArea​(float lower, float upper)
      Calculates the area of the image between the two values from the upper and lower bounds (inclusive).
      private void calculateThresholdVolume​(float lower, float upper)
      Calculates the volume of the image between the two values from the upper and lower bounds (inclusive).
      void clearVoxelLabel()
      Resets the threshold volume and area labels.
      void disposeLocal()
      Removes and deletes local memory.
      void dragPoint​(java.awt.event.MouseEvent mouseEvent)
      Handle the dragging of a transfer function point.
      private static java.util.Vector<java.lang.String> getCustomLUTList()
      Creates a Vector or LUT names representing different color look-up tables.
      float getLowerThreshold()  
      int getMode()  
      float getUpperThreshold()  
      boolean interpolateImage()  
      boolean isImageUpdate()
      Indicates if real-time update of the image should take place.
      protected static boolean isLUT1Based​(ModelStorageBase LUT)
      returns true if the first entry in the color look-up table is (1,1,1), false otherwise.
      void itemStateChanged​(java.awt.event.ItemEvent event)  
      void keyPressed​(java.awt.event.KeyEvent arg0)  
      void keyReleased​(java.awt.event.KeyEvent arg0)  
      void keyTyped​(java.awt.event.KeyEvent event)  
      private void makeLUT​(ModelLUT selectedLUT, int nColors)
      Updates the number of colors in the LUT and updates the displays.
      private void makeLUT​(ModelLUT selectedLUT, int nColors, boolean makeLUT)
      Updates the number of colors in the LUT and updates the displays.
      void resetHistoLUT()
      Resets the histogram and histogram panel.
      void setAllOff()
      Accessor to disable the all RGB color channels button if one of the lines has moved.
      void setBlueOn​(boolean isOn)
      Sets the blue checkbox on/off.
      void setGreenOn​(boolean isOn)
      Sets the green checkbox on/off.
      void setImage​(ModelImage newImage)  
      void setLUT​(ModelLUT newLUT)
      Replaces the LUT and builds a new LUT component.
      void setLUT​(ModelStorageBase newLUT)
      Sets the LUT and updates the histogram panel.
      void setNColors​(int value)
      Change the text field showing the number of colors.
      void setRangeText​(float x, float y, int _index)
      Set the range value of the text field.
      void setRedOn​(boolean isOn)
      Sets the red checkbox on/off.
      void stateChanged​(javax.swing.event.ChangeEvent event)  
      void updateComponentLUT()
      Redraw the componentLUT.
      void updateFrames​(boolean flag)
      Update all of the image frames that display the image this histo lut is for.
      void updateLUTPositionString​(java.lang.String str)
      Sets the position string in the LUT text field.
      void updateRealTime​(boolean updateRealTime)  
      void updateThresholdFields​(float lower, float upper)
      Method to update the threshold text fields when the lower or upper threshold 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • blueCheckBox

        private javax.swing.JCheckBox blueCheckBox
        checkbox for turning on / off the blue component of the color look-up table.
      • greenCheckBox

        private javax.swing.JCheckBox greenCheckBox
        checkbox for turning on / off the green component of the color look-up table.
      • histogram

        protected ModelHistogram histogram
        red, green and blue histograms:
      • histogramG

        protected ModelHistogram histogramG
        red, green and blue histograms:
      • histogramB

        protected ModelHistogram histogramB
        red, green and blue histograms:
      • indexColorTextF

        private javax.swing.JTextField indexColorTextF
        displays the selected LUT color
      • interpCheckBox

        private javax.swing.JCheckBox interpCheckBox
        turns interpolation on/off
      • logCheckBox

        private javax.swing.JCheckBox logCheckBox
        turns log display on/off
      • nColorsTextF

        private javax.swing.JTextField nColorsTextF
        displays the number of colors in the LUT
      • oneBasedLUTCheckBoxImage

        private javax.swing.JCheckBox oneBasedLUTCheckBoxImage
        sets the minimum LUT value to (1,1,1)
      • outputBox

        private javax.swing.JComboBox outputBox
        enables the user to set the image output type or LUT-based image extration
      • redCheckBox

        private javax.swing.JCheckBox redCheckBox
        checkbox for turning on / off the red component of the color look-up table.
      • threshFillF

        private javax.swing.JTextField threshFillF
        displays the threshold fill-value
      • threshLowerF

        private javax.swing.JTextField threshLowerF
        displays the threshold lower-value
      • threshUpperF

        private javax.swing.JTextField threshUpperF
        displays the threshold upper-value
      • toolBarBottom

        protected javax.swing.JToolBar toolBarBottom
        bottom tool bar
      • toolBarThreshold

        protected javax.swing.JToolBar toolBarThreshold
        threshold tool bar
      • updateCheckBox

        private javax.swing.JCheckBox updateCheckBox
        enables the user to set updating the display in real-time or only on mouse-release
      • voxelVolumeLabel

        private javax.swing.JLabel voxelVolumeLabel
        volume threshold vaue
      • panelParent

        protected JFrameHistogram panelParent
        containing parent class.
      • wholeImage

        protected boolean wholeImage
        true = apply algorithm to the whole image
      • cursorIndex

        private int cursorIndex
        Active mouse cursor index of the imageA, B and GM image A, B.
      • rangeX

        private float rangeX
        X range value of the imageA, B and GM imageA, B.
      • mouseSlider

        private javax.swing.JSlider mouseSlider
        slider for small LUT changes
      • xRangeText

        private javax.swing.JTextField xRangeText
      • yRangeText

        private javax.swing.JTextField yRangeText
      • scaleRange

        protected int scaleRange
      • mouseSliderLabels

        private javax.swing.JLabel[] mouseSliderLabels
      • labelsTable

        private java.util.Hashtable<java.lang.Integer,​javax.swing.JLabel> labelsTable
    • Constructor Detail

      • JPanelHistogram

        public JPanelHistogram​(JFrameHistogram _panelParent,
                               ModelImage _image,
                               ModelStorageBase _LUT,
                               boolean _wholeImage)
        Creates the JPanelHistogram, with the JFrameHistogram as the containing class.
        Parameters:
        _panelParent - parent class.
        _image - input image.
        _LUT - input LUT (ModelLUT or ModelRGB).
        _wholeImage - , when true apply the LUT to the entire image, when false apply to VOI regions only.
      • JPanelHistogram

        public JPanelHistogram​(ModelImage _image,
                               ModelStorageBase _LUT,
                               boolean _wholeImage)
        Creates the JPanelHistogram.
        Parameters:
        _image - input image.
        _LUT - input LUT (ModelLUT or ModelRGB).
        _wholeImage - , when true apply the LUT to the entire image, when false apply to VOI regions only.
      • JPanelHistogram

        public JPanelHistogram​(JFrameHistogram _panelParent,
                               ModelImage _image,
                               ModelStorageBase _LUT,
                               boolean _wholeImage,
                               boolean _simpleLUT)
        Creates the JPanelHistogram, with the JFrameHistogram as the containing class.
        Parameters:
        _panelParent - parent class.
        _image - input image.
        _LUT - input LUT (ModelLUT or ModelRGB).
        _wholeImage - , when true apply the LUT to the entire image, when false apply to VOI regions only.
    • Method Detail

      • buildLUTSelectionList

        private static final javax.swing.JToolBar buildLUTSelectionList​(java.awt.event.ActionListener listener)
        Build the center part of the LUT toolbar.
        Parameters:
        listener - The listener to attach to the created LUT selection combo box.
        Returns:
        the top part of the LUT toolbar
      • getCustomLUTList

        private static final java.util.Vector<java.lang.String> getCustomLUTList()
        Creates a Vector or LUT names representing different color look-up tables.
        Returns:
        a Vector or LUT names representing different color look-up tables.
      • isLUT1Based

        protected static final boolean isLUT1Based​(ModelStorageBase LUT)
        returns true if the first entry in the color look-up table is (1,1,1), false otherwise.
        Parameters:
        LUT - the LUT to query, either a ModelLUT or ModelRGB
        Returns:
        true if the first entry in the color look-up table is (1,1,1), false otherwise.
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • calcThreshold

        public void calcThreshold()
        Calculates the thresholded image based on the parameters of the threshold transfer function. Image A is thresholded if the selected panel is for imageA and likewise for image B.
      • calculateThreshold

        public void calculateThreshold()
        Calculates the volume (for 3D images) or area (for 2D images) of the image between the two values from the upper and lower bounds text areas.
      • calculateThreshold

        public void calculateThreshold​(float lower,
                                       float upper)
        Calculates the volume or area of the image between the two values from the upper and lower bounds (inclusive).
        Parameters:
        lower - Lower bound of the threshold (inclusive).
        upper - Upper bound of the threshold (inclusive).
      • clearVoxelLabel

        public void clearVoxelLabel()
        Resets the threshold volume and area labels.
      • disposeLocal

        public void disposeLocal()
        Removes and deletes local memory.
      • dragPoint

        public void dragPoint​(java.awt.event.MouseEvent mouseEvent)
        Description copied from interface: HistoLUTParent
        Handle the dragging of a transfer function point.
        Specified by:
        dragPoint in interface HistoLUTParent
        Parameters:
        mouseEvent - the point dragging event
      • getLowerThreshold

        public float getLowerThreshold()
        Returns:
        the lower threshold value.
      • getMode

        public int getMode()
        Returns:
        he HIstoLUTComponent mode.
      • getUpperThreshold

        public float getUpperThreshold()
        Returns:
        the upper threshold value.
      • interpolateImage

        public boolean interpolateImage()
        Returns:
        if the image interpolation checkbox is selected.
      • isImageUpdate

        public boolean isImageUpdate()
        Description copied from interface: HistoLUTParent
        Indicates if real-time update of the image should take place.
        Specified by:
        isImageUpdate in interface HistoLUTParent
        Returns:
        if the update in real-time checkbox is selected.
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent event)
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent arg0)
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent arg0)
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent event)
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
      • resetHistoLUT

        public void resetHistoLUT()
        Resets the histogram and histogram panel.
      • setAllOff

        public void setAllOff()
        Description copied from interface: HistoLUTParent
        Accessor to disable the all RGB color channels button if one of the lines has moved.
        Specified by:
        setAllOff in interface HistoLUTParent
      • setBlueOn

        public void setBlueOn​(boolean isOn)
        Sets the blue checkbox on/off.
        Parameters:
        isOn -
      • setGreenOn

        public void setGreenOn​(boolean isOn)
        Sets the green checkbox on/off.
        Parameters:
        isOn -
      • setLUT

        public void setLUT​(ModelLUT newLUT)
        Description copied from interface: HistoLUTParent
        Replaces the LUT and builds a new LUT component.
        Specified by:
        setLUT in interface HistoLUTParent
        Parameters:
        newLUT - New LUT
      • setImage

        public void setImage​(ModelImage newImage)
      • setLUT

        public void setLUT​(ModelStorageBase newLUT)
        Sets the LUT and updates the histogram panel.
        Parameters:
        newLUT -
      • setNColors

        public void setNColors​(int value)
        Change the text field showing the number of colors.
        Parameters:
        value - the number of colors
      • setRangeText

        public void setRangeText​(float x,
                                 float y,
                                 int _index)
        Description copied from interface: HistoLUTParent
        Set the range value of the text field.
        Specified by:
        setRangeText in interface HistoLUTParent
        Parameters:
        x - the x threshold range value
        y - the y threshold range value
        _index - the cursor index
      • setRedOn

        public void setRedOn​(boolean isOn)
        Sets the red checkbox on/off.
        Parameters:
        isOn -
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent event)
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
      • updateFrames

        public void updateFrames​(boolean flag)
        Description copied from interface: HistoLUTParent
        Update all of the image frames that display the image this histo lut is for.
        Specified by:
        updateFrames in interface HistoLUTParent
        Parameters:
        flag - this boolean indicates if the frame that displays the image should re-export the image and apply new LUT
        See Also:
        ModelImage.notifyImageDisplayListeners()
      • updateLUTPositionString

        public void updateLUTPositionString​(java.lang.String str)
        Description copied from interface: HistoLUTParent
        Sets the position string in the LUT text field.
        Specified by:
        updateLUTPositionString in interface HistoLUTParent
        Parameters:
        str - the position string
      • updateRealTime

        public void updateRealTime​(boolean updateRealTime)
        Parameters:
        updateRealTime -
      • updateThresholdFields

        public void updateThresholdFields​(float lower,
                                          float upper)
        Description copied from interface: HistoLUTParent
        Method to update the threshold text fields when the lower or upper threshold changes.
        Specified by:
        updateThresholdFields in interface HistoLUTParent
        Parameters:
        lower - the lower threshold value
        upper - the upper threshold value
      • buildControlPanel

        protected javax.swing.JPanel buildControlPanel​(ModelImage image,
                                                       boolean addAdjustment)
        Builds the interface panel.
        Parameters:
        image -
        addAdjustment -
        Returns:
      • buildMousePanel

        protected javax.swing.JPanel buildMousePanel​(double range)
        Builds the mouse panel.
        Parameters:
        range -
        Returns:
      • buildPanel

        protected void buildPanel()
        Method that displays the histogram and LUT and other controls to manipulate the LUT. Panel for image A.
        Parameters:
        image - Model of image
        LUT - Model of LUT
        entireFlag - Flag indicating if histogram should be made of entire image.
      • buildSimplePanel

        protected void buildSimplePanel()
      • buildToolBar

        protected javax.swing.JPanel buildToolBar​(ModelImage image)
        Builds the toolbars.
        Parameters:
        image -
        Returns:
      • buildSimpleToolBar

        protected javax.swing.JPanel buildSimpleToolBar​(ModelImage image)
      • calcHistogram

        protected ModelHistogram calcHistogram​(ModelImage image,
                                               boolean entireFlag,
                                               int offset)
        Calculates histogram for the image(s).
        Parameters:
        imageAorB - flag to indicate if histogram is to be calculated for imageA or imageB.
        entireFlag - if true calculate histogram for the entire image. if false uses areas defined by VOI regions.
        progressFlag - passed to calculateHistogram algorithm. If false progress bar is not displayed
      • calculateThresholdArea

        private void calculateThresholdArea​(float lower,
                                            float upper)
        Calculates the area of the image between the two values from the upper and lower bounds (inclusive).
        Parameters:
        lower - Lower bound of the threshold (inclusive).
        upper - Upper bound of the threshold (inclusive).
      • calculateThresholdVolume

        private void calculateThresholdVolume​(float lower,
                                              float upper)
        Calculates the volume of the image between the two values from the upper and lower bounds (inclusive).
        Parameters:
        lower - Lower bound of the threshold (inclusive).
        upper - Upper bound of the threshold (inclusive).
      • makeLUT

        private void makeLUT​(ModelLUT selectedLUT,
                             int nColors)
        Updates the number of colors in the LUT and updates the displays.
        Parameters:
        selectedLUT -
        nColors -
      • makeLUT

        private void makeLUT​(ModelLUT selectedLUT,
                             int nColors,
                             boolean makeLUT)
        Updates the number of colors in the LUT and updates the displays.
        Parameters:
        selectedLUT -
        nColors -
        makeLUT -