Class JDialogTransformBSpline

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

public class JDialogTransformBSpline extends JDialogScriptableBase implements AlgorithmInterface, ListSelectionListener, ActionDiscovery
DOCUMENT ME!
Version:
1.0 July 28, 2004
Author:
William Gandler TransformBSpline dialog This dialog takes a source image and uses information read in from a .nlt file to perform a nonlinear B-Spline transformation on the image. The dimensions of the transformed image, the degree of the B-Spline(ranging from 1 to 4), the number of control points, and the values of the control points are obtained from the .nlt file. For the .nlt file to be usable, the dimensions of the source image used in the .nlt file must be the same as the dimensions of the source image used in the algorithm.
See Also:
  • Field Details

    • serialVersionUID

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

      private AlgorithmTransformBSpline algoTrans
      DOCUMENT ME!
    • chooserButton

      private JButton chooserButton
      DOCUMENT ME!
    • controlMat

      private float[][] controlMat
      DOCUMENT ME!
    • controlMat25D

      private float[][][] controlMat25D
      DOCUMENT ME!
    • destExtents

      private int[] destExtents
      DOCUMENT ME!
    • destMinExtent

      private int destMinExtent
      DOCUMENT ME!
    • have25D

      private boolean have25D
      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • model

      private DefaultListModel model
      DOCUMENT ME!
    • nDims

      private int nDims
      DOCUMENT ME!
    • nltName

      private String nltName
      DOCUMENT ME!
    • numberSlices

      private int numberSlices
      DOCUMENT ME!
    • numControlPoints

      private int numControlPoints
      DOCUMENT ME!
    • removeButton

      private JButton removeButton
      DOCUMENT ME!
    • resolutions

      private float[] resolutions
      DOCUMENT ME!
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • splineDegree

      private int splineDegree
      DOCUMENT ME!
    • userInterface

      private ViewUserInterface userInterface
      DOCUMENT ME!
    • directory

      private String directory
    • nltFile

      private File nltFile
  • Constructor Details

    • JDialogTransformBSpline

      public JDialogTransformBSpline()
    • JDialogTransformBSpline

      public JDialogTransformBSpline(ModelImage im)
      Sets the appropriate variables. Does not actually create a dialog that is visible because no user input is necessary at present. This constructor is used by the script parser because it doesn't have the parent frame.
      Parameters:
      im - Source image.
    • JDialogTransformBSpline

      public JDialogTransformBSpline(Frame theParentFrame, ModelImage im)
      Sets the appropriate variables. Does not actually create a dialog that is visible because no user input is necessary at present.
      Parameters:
      theParentFrame - Parent frame.
      im - Source image.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Presently only the script function calls this method. When the script sends this dialog the action command, this method calls run.
      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.
    • 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()
      Calls the algorithm.
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • init

      private void init()
      Makes the GUI elements of the dialog.
    • open

      private boolean open()
      Open an image based on the suffix of the file. Read in the values of the parameters
      Returns:
      boolean indicasting success of file read
    • openNLT

      private boolean openNLT()
    • 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()).
      Specified by:
      createInputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the inputs of this algorithm.
    • createOutputParameters

      public ParameterTable createOutputParameters()
      Returns a table listing the output parameters of this algorithm (usually just labels used to obtain output image names later).
      Specified by:
      createOutputParameters in interface ActionDiscovery
      Returns:
      A parameter table listing the outputs of this algorithm.
    • getOutputImageName

      public String getOutputImageName(String imageParamName)
      Returns the name of an image output by this algorithm, the image returned depends on the parameter label given (which can be used to retrieve the image object from the image registry).
      Specified by:
      getOutputImageName in interface ActionDiscovery
      Parameters:
      imageParamName - The output image parameter label for which to get the image name.
      Returns:
      The image name of the requested output image parameter label.
    • isActionComplete

      public boolean isActionComplete()
      Returns whether the action has successfully completed its execution.
      Specified by:
      isActionComplete in interface ActionDiscovery
      Returns:
      True, if the action is complete. False, if the action failed or is still running.
    • getActionMetadata

      public ActionMetadata getActionMetadata()
      Return meta-information about this discoverable action for categorization and labeling purposes.
      Specified by:
      getActionMetadata in interface ActionDiscovery
      Returns:
      Metadata for this action.
    • setGUIFromParams

      protected void setGUIFromParams()
      Set up the dialog GUI based on the parameters before running the algorithm as part of a script.
      Specified by:
      setGUIFromParams in class JDialogScriptableBase
    • storeParamsFromGUI

      protected void storeParamsFromGUI() throws ParserException
      Store the parameters from the dialog to record the execution of this algorithm.
      Specified by:
      storeParamsFromGUI in class JDialogScriptableBase
      Throws:
      ParserException - If there is a problem creating one of the new parameters.