Class JDialogSpatialBroxOpticalFlow

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

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

    • broxAlgo

      private SpatialBroxOpticalFlow broxAlgo
    • 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
    • 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
    • labelsrcImage2

      private JLabel labelsrcImage2
    • textsrcImage2

      private JTextField textsrcImage2
    • chooserButton

      private JButton chooserButton
    • removeButton

      private JButton removeButton
    • 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

    • JDialogSpatialBroxOpticalFlow

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

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