Class JDialogTemporalBroxOpticalFlow

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

public class JDialogTemporalBroxOpticalFlow extends JDialogScriptableBase implements AlgorithmInterface, ItemListener, WindowListener
Dialog to get user input any two images optical flow estimation based on Brox et al. method (temporal version) are executed in their own thread.
See Also:
  • Field Details

    • broxAlgo

      private TemporalBroxOpticalFlow broxAlgo
    • userInterface

      ViewUserInterface userInterface
    • srcImage

      private ModelImage srcImage
    • destuImage

      private ModelImage destuImage
    • destvImage

      private ModelImage destvImage
    • destExtents

      private int[] destExtents
    • alpha

      private double alpha
    • gamma

      private double gamma
    • nscales

      private int nscales
    • zfactor

      private double zfactor
    • tol

      private double tol
    • initer

      private int initer
    • outiter

      private int outiter
    • verbose

      private boolean verbose
    • labelAlpha

      private JLabel labelAlpha
    • textAlpha

      private JTextField textAlpha
    • labelGamma

      private JLabel labelGamma
    • textGamma

      private JTextField textGamma
    • labelNscales

      private JLabel labelNscales
    • textNscales

      private JTextField textNscales
    • labelZfactor

      private JLabel labelZfactor
    • textZfactor

      private JTextField textZfactor
    • labelTol

      private JLabel labelTol
    • textTol

      private JTextField textTol
    • labelIniter

      private JLabel labelIniter
    • textIniter

      private JTextField textIniter
    • labelOutiter

      private JLabel labelOutiter
    • textOutiter

      private JTextField textOutiter
    • verboseCheckBox

      private JCheckBox verboseCheckBox
  • Constructor Details

    • JDialogTemporalBroxOpticalFlow

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

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

      public void setAlpha(double alpha)
    • setGamma

      public void setGamma(double gamma)
    • setNscales

      public void setNscales(int nscales)
    • setZfactor

      public void setZfactor(double zfactor)
    • setTol

      public void setTol(double tol)
    • setIniter

      public void setIniter(int initer)
    • setOutiter

      public void setOutiter(int outiter)
    • setVerbose

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