Class JDialogWatershed

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

public class JDialogWatershed extends JDialogScriptableBase implements AlgorithmInterface
Dialog to get user input, then call the algorithm. The user is able to control the degree of blurring in all dimensions and indicate if a correction factor be applied to the z-dimension to account for differing resolutions between the xy resolutions (intra-plane) and the z resolution (inter-plane). The algorithms are executed in their own thread.
Version:
0.1 Nov 17, 1998
Author:
Matthew J. McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

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

      private JButton buttonEnergyInput
      DOCUMENT ME!
    • choiceCheckBox

      private JCheckBox choiceCheckBox
      DOCUMENT ME!
    • gmDirectory

      private String gmDirectory
      DOCUMENT ME!
    • gmFileName

      private String gmFileName
      DOCUMENT ME!
    • gmImage

      private ModelImage gmImage
      DOCUMENT ME!
    • gmTextFile

      private JTextField gmTextFile
      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • labelCorrected

      private JLabel labelCorrected
      DOCUMENT ME!
    • labelGaussX

      private JLabel labelGaussX
      DOCUMENT ME!
    • labelGaussY

      private JLabel labelGaussY
      DOCUMENT ME!
    • labelGaussZ

      private JLabel labelGaussZ
      DOCUMENT ME!
    • normFactor

      private float normFactor
      DOCUMENT ME!
    • resolutionCheckbox

      private JCheckBox resolutionCheckbox
      difference between x,y resolutions (in plane) and z resolution (between planes).
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • scaleX

      private float scaleX
      DOCUMENT ME!
    • scaleY

      private float scaleY
      DOCUMENT ME!
    • scaleZ

      private float scaleZ
      DOCUMENT ME!
    • textGaussX

      private JTextField textGaussX
      DOCUMENT ME!
    • textGaussY

      private JTextField textGaussY
      DOCUMENT ME!
    • textGaussZ

      private JTextField textGaussZ
      DOCUMENT ME!
    • titles

      private String[] titles
      DOCUMENT ME!
    • userInterface

      private ViewUserInterface userInterface
      DOCUMENT ME!
    • watershedAlgo

      private AlgorithmWatershed watershedAlgo
      DOCUMENT ME!
  • Constructor Details

    • JDialogWatershed

      public JDialogWatershed()
      Empty constructor for scripting.
    • JDialogWatershed

      public JDialogWatershed(JFrame theParentFrame, ModelImage im)
      Creates new watershed dialog.
      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 algorithm when it has completed or failed to to complete, so that the dialog can display the result image and/or clean up.
      Specified by:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algorithm - Algorithm that caused the event.
    • callAlgorithm

      public void callAlgorithm()
      DOCUMENT ME!
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • focusLost

      public void focusLost(FocusEvent event)
      When the user clicks the mouse out of a text field, resets the neccessary variables.
      Specified by:
      focusLost in interface FocusListener
      Overrides:
      focusLost in class JDialogBase
      Parameters:
      event - Event that triggers this function
    • getResultImage

      public ModelImage getResultImage()
      Accessor that returns the image.
      Returns:
      The result image
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Changes value of corrected scale based on resolution checkbox; sets buttons to enabled or disabled based on choice checkbox.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      event - Event that cause the method to fire
    • doPostAlgorithmActions

      protected void doPostAlgorithmActions()
      Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table). Defaults to no action, override to actually have it do something.
      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
    • 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
    • findEnergyFile

      private void findEnergyFile()
      Tries to find the energy file that should have the name - sourceImageName_gm.xml and puts it into the text box and sets the use precalculated checkbox to true.
    • init

      private void init()
      Sets up GUI components and displays dialog.
    • setVariables

      private boolean setVariables()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!