Class JDialogSingleScaleHornSchunk

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

public class JDialogSingleScaleHornSchunk extends JDialogScriptableBase implements AlgorithmInterface, ItemListener, WindowListener
Dialog to get user input any two images optical flow estimation based on single 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
    • niter

      private int niter
    • alpha

      private double alpha
    • labelsrcImage2

      private JLabel labelsrcImage2
    • textsrcImage2

      private JTextField textsrcImage2
    • chooserButton

      private JButton chooserButton
    • removeButton

      private JButton removeButton
    • labelNiter

      private JLabel labelNiter
    • textNiter

      private JTextField textNiter
    • labelAlpha

      private JLabel labelAlpha
    • textAlpha

      private JTextField textAlpha
  • Constructor Details

    • JDialogSingleScaleHornSchunk

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

      public JDialogSingleScaleHornSchunk(Frame theParentFrame, ModelImage im)
      Creates a new JDialogSingleScaleHornSchunk 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
    • setNiter

      public void setNiter(int niter)
    • setAlpha

      public void setAlpha(double alpha)
    • 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.