Class JDialogTVL1FLOW

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

public class JDialogTVL1FLOW extends JDialogScriptableBase implements AlgorithmInterface, ItemListener, WindowListener
Dialog to get user input any two images optical flow estimation based on total variation and the L1 norm are executed in their own thread.
See Also:
  • Field Details

    • TVL1Algo

      private TVL1FLOW TVL1Algo
    • userInterface

      ViewUserInterface userInterface
    • srcImage1

      private ModelImage srcImage1
    • srcImage2

      private ModelImage srcImage2
    • destuImage

      private ModelImage destuImage
    • destvImage

      private ModelImage destvImage
    • destExtents

      private int[] destExtents
    • tau

      private double tau
    • lambda

      private double lambda
    • theta

      private double theta
    • nscales

      private int nscales
    • zfactor

      private double zfactor
    • nwarps

      private int nwarps
    • epsilon

      private double epsilon
    • verbose

      private boolean verbose
    • labelsrcImage2

      private JLabel labelsrcImage2
    • textsrcImage2

      private JTextField textsrcImage2
    • chooserButton

      private JButton chooserButton
    • removeButton

      private JButton removeButton
    • labelTau

      private JLabel labelTau
    • textTau

      private JTextField textTau
    • labelLambda

      private JLabel labelLambda
    • textLambda

      private JTextField textLambda
    • labelTheta

      private JLabel labelTheta
    • textTheta

      private JTextField textTheta
    • labelNscales

      private JLabel labelNscales
    • textNscales

      private JTextField textNscales
    • labelZfactor

      private JLabel labelZfactor
    • textZfactor

      private JTextField textZfactor
    • labelNwarps

      private JLabel labelNwarps
    • textNwarps

      private JTextField textNwarps
    • labelEpsilon

      private JLabel labelEpsilon
    • textEpsilon

      private JTextField textEpsilon
    • verboseCheckBox

      private JCheckBox verboseCheckBox
  • Constructor Details

    • JDialogTVL1FLOW

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

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

      public void setTau(double tau)
    • setLambda

      public void setLambda(double lambda)
    • setTheta

      public void setTheta(double theta)
    • setNscales

      public void setNscales(int nscales)
    • setZfactor

      public void setZfactor(double zfactor)
    • setNwarps

      public void setNwarps(int nwarps)
    • setEpsilon

      public void setEpsilon(double epsilon)
    • 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.