Class JDialogMeanShiftSegmentation

All Implemented Interfaces:
AlgorithmInterface, ScriptableActionInterface, DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogMeanShiftSegmentation extends JDialogScriptableBase implements AlgorithmInterface
See Also:
  • Field Details

    • displayLoc

      private int displayLoc
    • image

      private ModelImage image
    • userInterface

      private ViewUserInterface userInterface
    • msAlgo

    • resultImage

      private ModelImage resultImage
    • titles

      private String[] titles
    • spatialKernelType

      private AlgorithmMeanShiftSegmentation.kernelType spatialKernelType
    • rangeKernelType

    • spatialBandwidth

      private float spatialBandwidth
    • rangeBandwidth

      private float rangeBandwidth
    • minRegion

      private int minRegion
    • speedUpLevel

    • measureTime

      private boolean measureTime
    • speedThreshold

      private double speedThreshold
    • weightMap

      private double[] weightMap
    • weightMapDefined

      private boolean weightMapDefined
    • spatialGroup

      private ButtonGroup spatialGroup
    • spatialUniformButton

      private JRadioButton spatialUniformButton
    • spatialGaussianButton

      private JRadioButton spatialGaussianButton
    • rangeGroup

      private ButtonGroup rangeGroup
    • rangeUniformButton

      private JRadioButton rangeUniformButton
    • rangeGaussianButton

      private JRadioButton rangeGaussianButton
    • spatialText

      private JTextField spatialText
    • rangeText

      private JTextField rangeText
    • minRegionText

      private JTextField minRegionText
    • speedUpGroup

      private ButtonGroup speedUpGroup
    • noSpeedUpButton

      private JRadioButton noSpeedUpButton
    • mediumSpeedUpButton

      private JRadioButton mediumSpeedUpButton
    • highSpeedUpButton

      private JRadioButton highSpeedUpButton
    • speedThresholdLabel

      private JLabel speedThresholdLabel
    • speedThresholdText

      private JTextField speedThresholdText
    • measureTimeCheckBox

      private JCheckBox measureTimeCheckBox
    • isSpatialUniform

      private boolean isSpatialUniform
    • isRangeUniform

      private boolean isRangeUniform
    • speedInt

      private int speedInt
    • newImage

      private JRadioButton newImage
    • replaceImage

      private JRadioButton replaceImage
    • createFilteredImage

      private boolean createFilteredImage
    • filteredImage

      private ModelImage filteredImage
    • filterCheckBox

      private JCheckBox filterCheckBox
    • createBoundariesImage

      private boolean createBoundariesImage
    • boundariesImage

      private ModelImage boundariesImage
    • boundariesCheckBox

      private JCheckBox boundariesCheckBox
  • Constructor Details

    • JDialogMeanShiftSegmentation

      public JDialogMeanShiftSegmentation()
      Empty constructor needed for dynamic instantiation (used during scripting).
    • JDialogMeanShiftSegmentation

      public JDialogMeanShiftSegmentation(Frame theParentFrame, ModelImage im)
      Creates new dialog for entering parameters for mean shift segmentation.
      Parameters:
      theParentFrame - Parent frame
      im - Source image
  • Method Details

    • init

      private void init()
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      actionPerformed - Closes dialog box when the OK button is pressed and calls the algorithm.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - event that triggers function
    • setVariables

      private boolean setVariables()
      Use the GUI results to set up the variables needed to run the algorithm.
      Returns:
      true if parameters set successfully, false otherwise.
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithms when it has completed or failed to to complete, so that the dialog can be display the result image and/or clean up.
      Specified by:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algorithm - Algorithm that caused the event.
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the Mean Shift Segmentation algorithm based on what type of image this is and whether or not there is a separate destination image.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • setDisplayLocNew

      public void setDisplayLocNew()
      Accessor that sets the display loc variable to new, so that a new image is created once the algorithm completes.
    • setDisplayLocReplace

      public void setDisplayLocReplace()
      Accessor that sets the display loc variable to replace, so the current image is replaced once the algorithm completes.
    • setGUIFromParams

      protected void setGUIFromParams()
      Set the dialog GUI using the script parameters while running this algorithm as part of a script.
      Specified by:
      setGUIFromParams in class JDialogScriptableBase
    • storeParamsFromGUI

      protected void storeParamsFromGUI() throws ParserException
      Record the parameters just used to run this algorithm in a script.
      Specified by:
      storeParamsFromGUI in class JDialogScriptableBase
      Throws:
      ParserException - If there is a problem creating/recording the new parameters.