Class JDialogIndependentComponents

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

public class JDialogIndependentComponents extends JDialogScriptableBase implements AlgorithmInterface, ListSelectionListener
Dialog to get user input, then call the algorithm.
See Also:
  • Field Details

    • aicAlgo

      DOCUMENT ME!
    • changeRemoveIndex

      private boolean changeRemoveIndex
      DOCUMENT ME!
    • chooserButton

      private JButton chooserButton
      DOCUMENT ME!
    • colorPanel

      private JPanelColorChannels colorPanel
      DOCUMENT ME!
    • destExtents

      private int[] destExtents
      DOCUMENT ME!
    • endTol

      private double endTol
      DOCUMENT ME!
    • deflationaryOrthogonalization

      private JRadioButton deflationaryOrthogonalization
      DOCUMENT ME!
    • maximumLikelihoodEstimation

      private JRadioButton maximumLikelihoodEstimation
      DOCUMENT ME!
    • symmetricOrthogonalization

      private JRadioButton symmetricOrthogonalization
      DOCUMENT ME!
    • imageList

      private JList imageList
      DOCUMENT ME!
    • imagePanel

      private JPanel imagePanel
      DOCUMENT ME!
    • nonlinearFunctionGroup

      private ButtonGroup nonlinearFunctionGroup
      DOCUMENT ME!
    • nonlinearFunctionPanel

      private JPanel nonlinearFunctionPanel
      DOCUMENT ME!
    • nonlinearFunction

      private int nonlinearFunction
    • tanhButton

      private JRadioButton tanhButton
    • labela1

      private JLabel labela1
    • texta1

      private JTextField texta1
    • a1

      private double a1
    • expButton

      private JRadioButton expButton
    • cubicButton

      private JRadioButton cubicButton
    • labelEndTol

      private JLabel labelEndTol
      DOCUMENT ME!
    • labelMaxIter

      private JLabel labelMaxIter
      DOCUMENT ME!
    • labelICNumber

      private JLabel labelICNumber
      DOCUMENT ME!
    • maxIter

      private int maxIter
      DOCUMENT ME!
    • model

      private DefaultListModel model
      DOCUMENT ME!
    • icNumber

      private int icNumber
      Number of independent components
    • paramPanel

      private JPanel paramPanel
      DOCUMENT ME!
    • removeButton

      private JButton removeButton
      DOCUMENT ME!
    • removeIndex

      private int removeIndex
      DOCUMENT ME!
    • resultImage

      private ModelImage[] resultImage
      DOCUMENT ME!
    • icAlgorithm

      private int icAlgorithm
      DOCUMENT ME!
    • icAlgorithmGroup

      private ButtonGroup icAlgorithmGroup
      DOCUMENT ME!
    • icAlgorithmPanel

      private JPanel icAlgorithmPanel
      DOCUMENT ME!
    • srcImage

      private ModelImage[] srcImage
      DOCUMENT ME!
    • srcNumber

      private int srcNumber
      DOCUMENT ME!
    • tempImage

      private ModelImage[] tempImage
      DOCUMENT ME!
    • textEndTol

      private JTextField textEndTol
      DOCUMENT ME!
    • textMaxIter

      private JTextField textMaxIter
      DOCUMENT ME!
    • textICNumber

      private JTextField textICNumber
      DOCUMENT ME!
    • userInterface

      private ViewUserInterface userInterface
      DOCUMENT ME!
  • Constructor Details

    • JDialogIndependentComponents

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

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

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

      public void setEndTol(double scale)
      Accessor that sets the end tol.
      Parameters:
      scale - Value to set end tol to.
    • setMaxIter

      public void setMaxIter(int max)
      Accessor that sets the max iterations.
      Parameters:
      max - The max iterations
    • setICNumber

      public void setICNumber(int icNumber)
      Accessor that sets the number of independent components.
      Parameters:
      classes - The number of independent components.
    • setICAlgorithm

      public void setICAlgorithm(int icAlgorithm)
      Accessor that sets the icAlgorithm type (SYMMETRIC_ORTHOGONALIZATION, DEFLATIONARY_ORTHOGONALIZATION, or MAXIMUM_LIKELIHOOD_ESTIMATION).
      Parameters:
      icAlgorithm - The independent component algorithm.
    • setNonlinearFunction

      public void setNonlinearFunction(int nonlinearFunction)
      Accessor that sets the nonlinear function type(tanh(a1*y), y*exp(-y*y/2), or y*y*y)
      Parameters:
      nonlinearFunction -
    • seta1

      public void seta1(double a1)
      Accessor that sets parameter a1 for tanh function
      Parameters:
      a1 -
    • setSourceImage

      public void setSourceImage(ModelImage[] images)
      Accessor that sets the array of source images.
      Parameters:
      images - new source images.
    • valueChanged

      public void valueChanged(ListSelectionEvent evt)
      Sets the remove index based on the selected index in the list.
      Specified by:
      valueChanged in interface ListSelectionListener
      Parameters:
      evt - Event that caused this method to fire.
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the Fuzzy C Means algorithm based on what type of image this is and whether or not there is a separate destination image.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • doPostAlgorithmActions

      protected void doPostAlgorithmActions()
      Store the result image 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
    • 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.
    • checkImage

      private boolean checkImage(ModelImage testImage)
      Checks the color and dimensionality of the new image vs. the original source image. All new images should have the same color modality as the source and be of the same dimensions.
      Parameters:
      testImage - DOCUMENT ME!
      Returns:
      Flag indicating if the image checks out.
    • 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.
    • init

      private void init()
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
    • open

      private ModelImage open()
      Open an image based on the suffix of the file.
      Returns:
      The image.
    • 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.