Class JDialogMultiScaleHornSchunk

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

public class JDialogMultiScaleHornSchunk extends JDialogScriptableBase implements AlgorithmInterface, ItemListener, WindowListener
Dialog to get user input any two images optical flow estimation based on multi scale Horn-Schunk are executed in their own thread.
See Also:
  • Field Details

    • hsAlgo

      private HornSchunk hsAlgo
    • userInterface

      ViewUserInterface userInterface
    • srcImage1

      private ModelImage srcImage1
    • srcImage2

      private ModelImage srcImage2
    • destuImage

      private ModelImage destuImage
    • destvImage

      private ModelImage destvImage
    • destExtents

      private int[] destExtents
    • alpha

      private double alpha
    • nscales

      private int nscales
    • zfactor

      private double zfactor
    • warps

      private int warps
    • tol

      private double tol
    • maxiter

      private int maxiter
    • verbose

      private boolean verbose
    • labelsrcImage2

      private JLabel labelsrcImage2
    • textsrcImage2

      private JTextField textsrcImage2
    • chooserButton

      private JButton chooserButton
    • removeButton

      private JButton removeButton
    • labelAlpha

      private JLabel labelAlpha
    • textAlpha

      private JTextField textAlpha
    • labelNscales

      private JLabel labelNscales
    • textNscales

      private JTextField textNscales
    • labelZfactor

      private JLabel labelZfactor
    • textZfactor

      private JTextField textZfactor
    • labelWarps

      private JLabel labelWarps
    • textWarps

      private JTextField textWarps
    • labelTol

      private JLabel labelTol
    • textTol

      private JTextField textTol
    • labelMaxiter

      private JLabel labelMaxiter
    • textMaxiter

      private JTextField textMaxiter
    • verboseCheckBox

      private JCheckBox verboseCheckBox
  • Constructor Details

    • JDialogMultiScaleHornSchunk

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

      public JDialogMultiScaleHornSchunk(Frame theParentFrame, ModelImage im)
      Creates a new JDialogMultiScaleHornSchunk object.
      Parameters:
      theParentFrame - parent frame
      im - source image
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      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.
    • init

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

      private FileFilter getFileFilter(JFileChooser chooser, int index)
      A private helper function to get the current used FileFilter from JFileChooser.
      Parameters:
      chooser - DOCUMENT ME!
      index - the index of the choosable file filters.
      Returns:
      the current used file filter.
    • open

      private ModelImage open()
      Open an image based on the suffix of the file.
      Returns:
      The image.
    • callAlgorithm

      protected void callAlgorithm()
      Description copied from class: JDialogScriptableBase
      Starts the algorithm. Already exists in most algorithm dialogs. Should be called during scripted execution and regular operation.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithm 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.
    • doPostAlgorithmActions

      protected void doPostAlgorithmActions()
      Store the result images in the script runner's image table now that the action execution is finished.
      Overrides:
      doPostAlgorithmActions in class JDialogScriptableBase
    • setAlpha

      public void setAlpha(double alpha)
    • setNscales

      public void setNscales(int nscales)
    • setZfactor

      public void setZfactor(double zfactor)
    • setWarps

      public void setWarps(int warps)
    • setTol

      public void setTol(double tol)
    • setMaxiter

      public void setMaxiter(int maxiter)
    • setVerbose

      public void setVerbose(boolean verbose)
    • 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.