Class JDialogCoherenceEnhancingDiffusion

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

public class JDialogCoherenceEnhancingDiffusion extends JDialogScriptableBase implements AlgorithmInterface, ActionDiscovery, ScriptableActionInterface
Dialog to get user input, then call a specified diffusion algorithm. It should be noted that the algorithms are executed in their own thread.
See Also:
  • Field Details

    • serialVersionUID

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

      private JCheckBox checkBox25D
      DOCUMENT ME!
    • coherenceEnhancingDiffusionAlgo

      private AlgorithmCoherenceEnhancingDiffusion coherenceEnhancingDiffusionAlgo
      DOCUMENT ME!
    • derivativeScale

      private float derivativeScale
      DOCUMENT ME!
    • diffusitivityDenom

      private float diffusitivityDenom
      DOCUMENT ME!
    • do25D

      private boolean do25D
      DOCUMENT ME!
    • entireImage

      private boolean entireImage
      DOCUMENT ME!
    • gaussianScale

      private float gaussianScale
      DOCUMENT ME!
    • numIterations

      private int numIterations
      DOCUMENT ME!
    • radioEntireImage

      private JRadioButton radioEntireImage
      DOCUMENT ME!
    • radioVOIRegion

      private JRadioButton radioVOIRegion
      DOCUMENT ME!
    • resultImage

      private ModelImage resultImage
      DOCUMENT ME!
    • srcImage

      private ModelImage srcImage
      DOCUMENT ME!
    • textDerivative

      private JTextField textDerivative
      DOCUMENT ME!
    • textGaussian

      private JTextField textGaussian
      DOCUMENT ME!
    • textNumberIterations

      private JTextField textNumberIterations
      DOCUMENT ME!
    • textDiffusitivity

      private JTextField textDiffusitivity
      DOCUMENT ME!
  • Constructor Details

    • JDialogCoherenceEnhancingDiffusion

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

      public JDialogCoherenceEnhancingDiffusion(Frame frame, ModelImage im)
      Initialize the dialog.
      Parameters:
      frame - the parent frame
      im - the 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)
      DOCUMENT ME!
      Specified by:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algorithm - DOCUMENT ME!
    • getResultImage

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

      public void setDerivativeScale(float derivativeScale)
      Accessor that sets the derivativeScale.
      Parameters:
      derivativeScale - DOCUMENT ME!
    • setDiffusitivityDenom

      public void setDiffusitivityDenom(float diffusitivityDenom)
      Accessor that sets the diffusitivityDenom.
      Parameters:
      diffusitivityDenom - DOCUMENT ME!
    • setDo25D

      public void setDo25D(boolean do25D)
      Accessor that sets if slice by slice processing occurs.
      Parameters:
      do25D - DOCUMENT ME!
    • setGaussianScale

      public void setGaussianScale(float gaussianScale)
      Accessor that sets the gaussian scale.
      Parameters:
      gaussianScale - DOCUMENT ME!
    • setNumIterations

      public void setNumIterations(int numIterations)
      Accessor that sets the number of iterations.
      Parameters:
      numIterations - DOCUMENT ME!
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the mean 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.
    • buildParameterPanel

      private JPanel buildParameterPanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • init

      private void init()
      DOCUMENT ME!
    • setVariables

      private boolean setVariables()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • 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.
    • 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.