Class JDialogReorient

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

public class JDialogReorient extends JDialogScriptableBase implements AlgorithmInterface, ActionDiscovery
Dialog box for basic image processing tools
Version:
April 2006
Author:
Pilou Bazin
See Also:
  • Field Details

    • algoTrans

      private AlgorithmTransform algoTrans
    • image

      private ModelImage image
    • template

      private ModelImage template
    • resultImage

      private ModelImage resultImage
    • AXIAL_INDEX

      public static final int AXIAL_INDEX
      See Also:
    • CORONAL_INDEX

      public static final int CORONAL_INDEX
      See Also:
    • SAGITTAL_INDEX

      public static final int SAGITTAL_INDEX
      See Also:
    • USER_INDEX

      public static final int USER_INDEX
      See Also:
    • orientTypes

      private String[] orientTypes
    • newOrientTypes

      private String[] newOrientTypes
    • resolutionTypes

      private String[] resolutionTypes
    • resolutionIndex

      private int resolutionIndex
    • interpTypes

      private String[] interpTypes
    • interpType

      private String interpType
    • orients

      private String[] orients
    • fileInfo

      FileInfoBase fileInfo
    • fileInfoNIFTI

      FileInfoNIFTI fileInfoNIFTI
    • mainPanel

      private JPanel mainPanel
    • labelResType

      private JLabel labelResType
    • comboResType

      private JComboBox comboResType
    • labelTemplate

      private JLabel labelTemplate
    • comboTemplate

      private JComboBox comboTemplate
    • labelInterpType

      private JLabel labelInterpType
    • comboInterpType

      private JComboBox comboInterpType
    • presentOrientLabel2

      private JLabel presentOrientLabel2
    • presentOrientBoxX

      private JComboBox presentOrientBoxX
    • presentOrientBoxY

      private JComboBox presentOrientBoxY
    • presentOrientBoxZ

      private JComboBox presentOrientBoxZ
    • or

      private int[] or
    • newOrientBox

      private JComboBox newOrientBox
    • newOrientBoxX

      private JComboBox newOrientBoxX
    • newOrientBoxY

      private JComboBox newOrientBoxY
    • newOrientBoxZ

      private JComboBox newOrientBoxZ
    • newOr

      private int[] newOr
    • axisOrder

      private int[] axisOrder
    • axisFlip

      private boolean[] axisFlip
  • Constructor Details

    • JDialogReorient

      public JDialogReorient(Frame theParentFrame, ModelImage im)
      Creates dialog for plugin.
      Parameters:
      im - Source image.
      parent - Parent frame.
    • JDialogReorient

      public JDialogReorient(ModelImage im)
    • JDialogReorient

      public JDialogReorient()
      Empty constructor needed for dynamic instantiation.
  • Method Details

    • init

      private void init()
      Sets up the GUI (panels, buttons, etc) and displays it on the screen.
    • buildTemplateList

      private void buildTemplateList()
    • getResultImage

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

      public void setParameters()
      Accessor that sets the parameters
    • 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.
    • 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.
    • callAlgorithm

      protected void callAlgorithm()
      Once all the necessary variables are set, call the Gaussian Blur 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()
      Perform any actions required after the running of the algorithm is complete.
      Overrides:
      doPostAlgorithmActions in class JDialogScriptableBase
    • 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 e)
      Description copied from class: JDialogBase
      Unchanged.
      Specified by:
      itemStateChanged in interface ItemListener
      Overrides:
      itemStateChanged in class JDialogBase
      Parameters:
      e - ItemEvent
    • 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.
    • getNewOrientBox

      public JComboBox getNewOrientBox()
    • 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.
    • set_axial_orientation

      public void set_axial_orientation()
      For prostate and knees projects, setting the axail orientation. Auto processing pipeline, which runs from MIPAV plugin commandline or JDialog calling.
    • set_sagittal_orientation

      public void set_sagittal_orientation()
      For prostate and knees projects, setting the sagittal orientation. Auto processing pipeline, which runs from MIPAV plugin commandline or JDialog calling.
    • set_coronal_orientation

      public void set_coronal_orientation()
      For prostate and knees projects, setting the coronal orientation. Auto processing pipeline, which runs from MIPAV plugin commandline or JDialog calling.
    • doRun

      public void doRun()
      For prostate and knees projects, run the re-orientation algorithm to create three orthogonal images from either axial image (prostate) or saggittal image(knees). Auto processing pipeline, which runs from MIPAV plugin commandline or JDialog calling.
    • callAlgorithmRun

      protected void callAlgorithmRun()
      For prostate and knees projects, run the re-orientation algorithm to create three orthogonal images from either axial image (prostate) or saggittal image(knees). Auto processing pipeline, which runs from MIPAV plugin commandline or JDialog calling.