Class JDialogQuantify

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

public class JDialogQuantify extends JDialogScriptableBase implements AlgorithmInterface
Dialog to get user input, then call the algorithm. It should be noted, that the algorithms are executed in their own thread.
Version:
0.1 Jan 17, 2001
Author:
Matthew J. McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • algoQuantify

      private AlgorithmQuantify algoQuantify
      DOCUMENT ME!
    • directory

      private String directory
      DOCUMENT ME!
    • fileName

      private String fileName
      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • maskImage

      private ModelImage maskImage
      DOCUMENT ME!
    • textFile

      private JTextField textFile
      DOCUMENT ME!
    • buttonFile

      private JButton buttonFile
    • comboBoxImage

      private JComboBox comboBoxImage
    • loadCheckBox

      private JCheckBox loadCheckBox
  • Constructor Details

    • JDialogQuantify

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

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

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

      public void setMaskImage(ModelImage image)
      Accessor to set the directory.
      Parameters:
      image - New directory.
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the quantify mask algorithm using the previously set file name.
      Specified by:
      callAlgorithm 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
    • 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.
    • compareDimensions

      private boolean compareDimensions(ModelImage im1, ModelImage im2)
      Compares the dimensionality of two images.
      Parameters:
      im1 - first image
      im2 - second image
      Returns:
      true if images have the same dimensionality else false
    • buildComboBoxImage

      private void buildComboBoxImage()
      Builds a list of images to operate on from the template image.
    • init

      private void init()
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
    • 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.