Class JDialogShowCosts

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

public class JDialogShowCosts extends JDialogScriptableBase
Calculate costs for various voxel similarity cost functions that are used in registration and output them to the data window. Algorithm is executed in its own thread.
See Also:
  • Field Details

    • serialVersionUID

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

      Is either a AlgorithmCostFunction or a AlgorithmCostFunctions2D depending on images
    • bin1

      private int bin1
      Number of bins for each image
    • bin1Text

      private JTextField bin1Text
      User input of bins
    • currentCostFunct

      private String currentCostFunct
      The current cost function
    • firstImage

      private ModelImage firstImage
      Active image when algorithm is called.
    • imageComboBox

      private JComboBox imageComboBox
      Image list for user to pick registered image
    • labelImage

      private JLabel labelImage
      The registered image
    • doCorrelationRatioSmoothed

      private JCheckBox doCorrelationRatioSmoothed
      Whether the available cost functions should be performed
    • doMutualInfoSmoothed

      private JCheckBox doMutualInfoSmoothed
      Whether the available cost functions should be performed
    • doNormMutualInfoSmoothed

      private JCheckBox doNormMutualInfoSmoothed
      Whether the available cost functions should be performed
    • doNormXCorr

      private JCheckBox doNormXCorr
      Whether the available cost functions should be performed
    • correlationRatioSmoothed

      private boolean correlationRatioSmoothed
    • mutualInfoSmoothed

      private boolean mutualInfoSmoothed
    • normMutualInfoSmoothed

      private boolean normMutualInfoSmoothed
    • normXCorr

      private boolean normXCorr
    • possibleIntValues1

      private double possibleIntValues1
      Initial guesses for bin values
    • secondImage

      private ModelImage secondImage
      The registered image as specified by user through gui
    • simpleImg1

      private ModelSimpleImage simpleImg1
      Holds extents, other info about firstImage and SecondImage
    • simpleImg2

      private ModelSimpleImage simpleImg2
      Holds extents, other info about firstImage and SecondImage
    • smoothSize

      private float smoothSize
      Optional smooth parameter for both cost functions
    • tMatrix

      private TransMatrix tMatrix
      Identity matrix for testing cost
    • UI

      private ViewUserInterface UI
      The MIPAV user interface
  • Constructor Details

    • JDialogShowCosts

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

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

      protected void callAlgorithm()
      Calls the algorithm with the set-up parameters.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      itemStateChanged.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      event - DOCUMENT ME!
    • setBin1

      public void setBin1(int bin1)
      Accessor that sets bin1.
      Parameters:
      bin1 - DOCUMENT ME!
    • setSecondImage

      public void setSecondImage(ModelImage secondImage)
      Accessor to set the secondImage.
      Parameters:
      secondImage - DOCUMENT ME!
    • buildComboBox

      private JComboBox buildComboBox(ModelImage image)
      Builds a list of images. Returns combobox. List must be all color or all black and white.
      Parameters:
      image - DOCUMENT ME!
      Returns:
      Newly created combo box.
    • callAlgorithm

      private void callAlgorithm(int costChoice)
      DOCUMENT ME!
      Parameters:
      costChoice - DOCUMENT ME!
    • init

      private void init()
      Initializes GUI components and displays dialog.
    • 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.
    • setCorrelationRatioSmoothed

      public void setCorrelationRatioSmoothed(boolean correlationRatioSmoothed)
    • setMutualInfoSmoothed

      public void setMutualInfoSmoothed(boolean mutualInfoSmoothed)
    • setNormMutualInfoSmoothed

      public void setNormMutualInfoSmoothed(boolean normMutualInfoSmoothed)
    • setNormXCorr

      public void setNormXCorr(boolean normXCorr)
    • createInputParameters

      public ParameterTable createInputParameters()
      Returns a table listing the input parameters of this algorithm (which should match up with the scripting parameters used in setGUIFromParams()).
      Returns:
      A parameter table listing the inputs of this algorithm.
    • 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.