Class JDialogSM2

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

public class JDialogSM2 extends JDialogScriptableBase implements AlgorithmInterface, WindowListener, ActionDiscovery
Dialog to get user input for 3 parameter dynamic (contrast) enhanced MRI model or SM2 model
See Also:
  • Field Details

    • labelParamsToFit

      private JLabel labelParamsToFit
      Use serialVersionUID for interoperability.
    • buttonTissueFile

      private JButton buttonTissueFile
    • textTissueFile

      private JTextField textTissueFile
    • directoryTissue

      private String directoryTissue
    • fileNameTissue

      private String fileNameTissue
    • tissueImage

      private ModelImage tissueImage
    • labelVOI

      private JLabel labelVOI
    • buttonVOIFile

      private JButton buttonVOIFile
    • textVOIFile

      private JTextField textVOIFile
    • directoryVOI

      private String directoryVOI
    • fileNameVOI

      private String fileNameVOI
    • buttonVOIFile2

      private JButton buttonVOIFile2
    • textVOIFile2

      private JTextField textVOIFile2
    • directoryVOI2

      private String directoryVOI2
    • fileNameVOI2

      private String fileNameVOI2
    • buttonTimesFile

      private JButton buttonTimesFile
    • textTimesFile

      private JTextField textTimesFile
    • directoryTimes

      private String directoryTimes
    • fileNameTimes

      private String fileNameTimes
    • fileTimes

      private File fileTimes
    • numTimes

      private int numTimes
    • timeVals

      private double[] timeVals
    • VOIs

      private ViewVOIVector VOIs
    • sm2Algo

      private AlgorithmSM2 sm2Algo
      DOCUMENT ME!
    • image

      private ModelImage image
      DOCUMENT ME!
    • resultImage

      private ModelImage[] resultImage
    • labelMinConstr0

      private JLabel labelMinConstr0
    • textMinConstr0

      private JTextField textMinConstr0
    • labelMaxConstr0

      private JLabel labelMaxConstr0
    • textMaxConstr0

      private JTextField textMaxConstr0
    • labelInitial0

      private JLabel labelInitial0
    • textInitial0

      private JTextField textInitial0
    • labelMinConstr1

      private JLabel labelMinConstr1
    • textMinConstr1

      private JTextField textMinConstr1
    • labelMaxConstr1

      private JLabel labelMaxConstr1
    • labelInitial1

      private JLabel labelInitial1
    • textInitial1

      private JTextField textInitial1
    • textMaxConstr1

      private JTextField textMaxConstr1
    • labelMinConstr2

      private JLabel labelMinConstr2
    • textMinConstr2

      private JTextField textMinConstr2
    • labelMaxConstr2

      private JLabel labelMaxConstr2
    • textMaxConstr2

      private JTextField textMaxConstr2
    • labelInitial2

      private JLabel labelInitial2
    • textInitial2

      private JTextField textInitial2
    • min_constr

      private double[] min_constr
    • max_constr

      private double[] max_constr
    • initial

      private double[] initial
    • labelHematocrit

      private JLabel labelHematocrit
    • textHematocrit

      private JTextField textHematocrit
    • hematocrit

      private double hematocrit
    • fileVOI

      private FileVOI fileVOI
    • voi

      private VOI[] voi
    • fileVOI2

      private FileVOI fileVOI2
    • voi2

      private VOI[] voi2
    • br

      private BufferedReader br
    • VOIGroup

      private ButtonGroup VOIGroup
    • sagittalSinusButton

      private JRadioButton sagittalSinusButton
    • processRegionButton

      private JRadioButton processRegionButton
    • sagittalSinusIndex

      private int sagittalSinusIndex
    • processRegionIndex

      private int processRegionIndex
    • componentImage

      private ViewJComponentEditImage componentImage
    • UI

      private ViewUserInterface UI
      DOCUMENT ME!
  • Constructor Details

    • JDialogSM2

      public JDialogSM2(ModelImage image)
      Creates a new JDialogSM2 object.
      Parameters:
      image - DOCUMENT ME!
    • JDialogSM2

      public JDialogSM2(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.
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      This method is required if the AlgorithmPerformed interface is implemented. It is called by the algorithm 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.
    • 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.
    • itemStateChanged

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

      public void windowClosing(WindowEvent event)
      Disposes of error dialog, then frame. Sets cancelled to true.
      Specified by:
      windowClosing in interface WindowListener
      Overrides:
      windowClosing in class JDialogBase
      Parameters:
      event - DOCUMENT ME!
    • callAlgorithm

      protected void callAlgorithm()
      DOCUMENT ME!
      Specified by:
      callAlgorithm in class JDialogScriptableBase
    • 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.
    • getResultImage

      public ModelImage[] getResultImage()
      Accessor that returns the image.
      Returns:
      The result image.
    • 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
    • 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.