Class JDialogInsertVolume

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

public class JDialogInsertVolume extends JDialogScriptableBase implements AlgorithmInterface
See Also:
  • Field Details

    • serialVersionUID

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

      public static final int AVERAGE_VOLUME
      Average volume type - the inserted volume is set equal to the mean of the 2 surrounding volumes.
      See Also:
    • BLANK_VOLUME

      public static final int BLANK_VOLUME
      Blank volume type - the inserted volume is blank.
      See Also:
    • INSERTED_IMAGE_VOLUME

      public static final int INSERTED_IMAGE_VOLUME
      Original volume type - a 2D image is inserted.
      See Also:
    • insertedImgButton

      private JRadioButton insertedImgButton
      DOCUMENT ME!
    • average

      private JRadioButton average
      DOCUMENT ME!
    • blank

      private JRadioButton blank
      DOCUMENT ME!
    • comboBoxImage

      private JComboBox comboBoxImage
      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • insertedImage

      private ModelImage insertedImage
      DOCUMENT ME!
    • insertVolume

      private int insertVolume
      DOCUMENT ME!
    • insertVolumeAlgo

      private AlgorithmInsertVolume insertVolumeAlgo
      DOCUMENT ME!
    • nVolumes

      private int nVolumes
      DOCUMENT ME!
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • volumeType

      private int volumeType
      DOCUMENT ME!
    • textVolume

      private JTextField textVolume
      DOCUMENT ME!
    • titles

      private String[] titles
      DOCUMENT ME!
    • userInterface

      private ViewUserInterface userInterface
      DOCUMENT ME!
  • Constructor Details

    • JDialogInsertVolume

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

      public JDialogInsertVolume(Frame theParentFrame, ModelImage im)
      Creates new dialog for inserting a volume.
      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
    • setInsertedImage

      public void setInsertedImage(ModelImage insertedImage)
      Accessor to specify the 2D image used as an inserted volume for ORGINAL_VOLUME.
      Parameters:
      insertedImage - DOCUMENT ME!
    • setInsertVolumeNumber

      public void setInsertVolumeNumber(int num)
      Accessor which lets you change where to insert the volume.
      Parameters:
      num - volume number before which the new volume is to be inserted
    • setVolumeType

      public void setVolumeType(int type)
      Accessor which lets you change the type of volume to be inserted.
      Parameters:
      type - the type of volume to be inserted (either AVERAGE_VOLUME or BLANK_Volume)
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the Insert Volume 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
    • buildComboBox

      private JComboBox buildComboBox()
      Builds a list of images to register to 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.
    • setGUIFromParams

      protected void setGUIFromParams()
      Description copied from class: JDialogScriptableBase
      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
      Description copied from class: JDialogScriptableBase
      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.