Class JDialogImageInfo

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

public class JDialogImageInfo extends JDialogBase implements ActionListener, AlgorithmInterface
The image attribute input dialog, which consists of six tabbled panes allowing the user to edit image name, resolutions, orientations, dataset origin, history, and transformation matrix.
Version:
0.1 Nov 23, 1999
Author:
Matthew J. McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

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

      private JTextField[] acpcACFields
      DOCUMENT ME!
    • acpcDimFields

      private JTextField[] acpcDimFields
      DOCUMENT ME!
    • acpcMaxFields

      private JTextField[] acpcMaxFields
      DOCUMENT ME!
    • acpcMinFields

      private JTextField[] acpcMinFields
      TLRC Specific info.
    • acpcPCFields

      private JTextField[] acpcPCFields
      DOCUMENT ME!
    • acpcResField

      private JTextField acpcResField
      DOCUMENT ME!
    • addReplaceMatrix

      private JButton addReplaceMatrix
      Add as New/Replace button (depending on selected matrix type).
    • applyButton

      private JButton applyButton
      DOCUMENT ME!
    • bigEnd

      private JRadioButton bigEnd
      Radio button to denote image is big endian.
    • buttonPanel

      private JPanel buttonPanel
      DOCUMENT ME!
    • changeTypeAlgo

      private AlgorithmChangeType changeTypeAlgo
      DOCUMENT ME!!
    • comboBoxUnitOfMeasure1

      private JComboBox comboBoxUnitOfMeasure1
      DOCUMENT ME!
    • comboBoxUnitOfMeasure3

      private JComboBox comboBoxUnitOfMeasure3
      DOCUMENT ME!
    • comboBoxUnitOfMeasure4

      private JComboBox comboBoxUnitOfMeasure4
      DOCUMENT ME!
    • comboBoxUnitOfMeasure5

      private JComboBox comboBoxUnitOfMeasure5
      DOCUMENT ME!
    • DIM

      private int DIM
      DOCUMENT ME!
    • endianess

      private boolean endianess
      Indicates the endianess of the image.
    • fileTransMatrix

      private TransMatrix fileTransMatrix
      DOCUMENT ME!
    • font12B

      private final Font font12B
      DOCUMENT ME!
    • image

      private final ModelImage image
      DOCUMENT ME!
    • isTLRCBox

      private JCheckBox isTLRCBox
      DOCUMENT ME!
    • leftHandSystem

      private boolean leftHandSystem
      If true change matrix to the left-hand coordinate system.
    • linkedImageButton

      private JButton linkedImageButton
      DOCUMENT ME!
    • linkedImageField

      private JTextField linkedImageField
      DOCUMENT ME!
    • littleEnd

      private JRadioButton littleEnd
      Radio button to denote image is little endian.
    • loadButton

      private JButton loadButton
      DOCUMENT ME!
    • matrix

      private double[][] matrix
      DOCUMENT ME!
    • matrixBox

      private JComboBox matrixBox
      Box to hold the matrices parsed from the MatrixHolder.
    • matrixFile

      private String matrixFile
      DOCUMENT ME!
    • measure1

      private int measure1
      DOCUMENT ME!
    • measure3

      private int measure3
      DOCUMENT ME!
    • measure4

      private int measure4
      DOCUMENT ME!
    • measure5

      private int measure5
      DOCUMENT ME!
    • modality

      private int modality
      DOCUMENT ME!
    • modalityBox

      private JComboBox modalityBox
      DOCUMENT ME!
    • modalityStr

      private String[] modalityStr
      DOCUMENT ME!
    • nameText

      private JTextField nameText
      DOCUMENT ME!
    • newImageName

      private String newImageName
      DOCUMENT ME!
    • orient

      private int orient
      DOCUMENT ME!
    • orientationBox1

      private JComboBox orientationBox1
      DOCUMENT ME!
    • orientationBox2

      private JComboBox orientationBox2
      DOCUMENT ME!
    • orientationBox3

      private JComboBox orientationBox3
      DOCUMENT ME!
    • orientAxis

      private final int[] orientAxis
      DOCUMENT ME!
    • orientBox

      private JComboBox orientBox
      DOCUMENT ME!
    • orientFields

      private JTextField[] orientFields
      DOCUMENT ME!
    • origACFields

      private JTextField[] origACFields
      ACPC Specific info.
    • origDimFields

      private JTextField[] origDimFields
      DOCUMENT ME!
    • origOriginFields

      private JTextField[] origOriginFields
    • origin

      private float[] origin
      DOCUMENT ME!
    • origPCFields

      private JTextField[] origPCFields
      DOCUMENT ME!
    • origResFields

      private JTextField[] origResFields
      DOCUMENT ME!
    • resampleImage

      private final ModelImage resampleImage
      DOCUMENT ME!
    • resIndex

      private int resIndex
      DOCUMENT ME!
    • resolutionBox

      private JCheckBox resolutionBox
      DOCUMENT ME!
    • resolutions

      private float[] resolutions
      DOCUMENT ME!
    • saveButton

      private JButton saveButton
      DOCUMENT ME!
    • sliceThickness

      private float sliceThickness
      DOCUMENT ME!
    • tabbedPane

      private JTabbedPane tabbedPane
      DOCUMENT ME!
    • textMatrix

      private JTextField[][] textMatrix
      DOCUMENT ME!
    • textRes1

      private JTextField textRes1
      DOCUMENT ME!
    • textRes2

      private JTextField textRes2
      DOCUMENT ME!
    • textRes3

      private JTextField textRes3
      DOCUMENT ME!
    • textRes4

      private JTextField textRes4
      DOCUMENT ME!
    • textRes5

      private JTextField textRes5
      DOCUMENT ME!
    • textSt1

      private JTextField textSt1
      DOCUMENT ME!
    • textSt2

      private JTextField textSt2
      DOCUMENT ME!
    • textSt3

      private JTextField textSt3
      DOCUMENT ME!
    • textSt4

      private JTextField textSt4
      DOCUMENT ME!
    • textSliceThickness

      private JTextField textSliceThickness
      DOCUMENT ME!
    • titles

      private String[] titles
      DOCUMENT ME!
    • tlrcACFields

      private JTextField[] tlrcACFields
      DOCUMENT ME!
    • tlrcDimFields

      private JTextField[] tlrcDimFields
      DOCUMENT ME!
    • tlrcPCFields

      private JTextField[] tlrcPCFields
      DOCUMENT ME!
    • tlrcResFields

      private JTextField[] tlrcResFields
      DOCUMENT ME!
    • transformIDBox

      private JComboBox transformIDBox
      DOCUMENT ME!
    • userInterface

      private final ViewUserInterface userInterface
      DOCUMENT ME!
    • wcSystem

      private boolean wcSystem
      If true change matrix to the world coordinate system.
    • resizeOnClose

      private boolean resizeOnClose
  • Constructor Details

    • JDialogImageInfo

      public JDialogImageInfo(Frame theParentFrame, ModelImage im, int zSlice, int tSlice)
      Builds the image attribute input dialog, with three tabbled panes allowing the user to edit image name, orientation, resolutions, and transformation matrix.
      Parameters:
      theParentFrame - Parent frame of dialog.
      im - Image whose attributes the user is editing.
      zSlice - DOCUMENT ME!
      tSlice - DOCUMENT ME!
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      When Apply button is pressed, applies changes to all three areas: image name, resolutions, and transformation matrix. When OK button is pressed, applies changes and closes dialog box. When Cancel button is pressed, closes dialog without making any additional changes.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - Event that triggers this function.
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      DOCUMENT ME!
      Specified by:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algorithm - DOCUMENT ME!
    • itemStateChanged

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

      public String matrixFileMenu()
      Allows the user to select matrix file.
      Returns:
      fileName
    • populateTalairachTab

      public void populateTalairachTab()
      Looks at TalairachTransformInfo saved in ModelImage and populates the talairach scrollpane with the appropriate data.
    • readTransformMatrixFile

      public void readTransformMatrixFile(String fileName)
      Reads a matrix from a file.
      Parameters:
      fileName - name of the matrix file.
    • setLeftHandSystem

      public void setLeftHandSystem(boolean leftHandSys)
      Sets the left-hand coordinate flag. If true, change matrix to the left-hand coordinate system.
      Overrides:
      setLeftHandSystem in class JDialogBase
      Parameters:
      leftHandSys - true for left-handed
    • setMatrix

      public void setMatrix(TransMatrix newMatrix)
      update matrix and text matrix
      Parameters:
      newMatrix - matrix to copy
    • setResolutionTag

      public void setResolutionTag()
      Set the resolution tag in front view.
    • setSlice

      public void setSlice(int z, int t)
      Update the title bar and resolution information.
      Parameters:
      z - int z-dim
      t - int t-dim
    • setWCSystem

      public void setWCSystem(boolean wcSys)
      Sets the world coordinate flag. If true, change matrix to the world coordinate system.
      Overrides:
      setWCSystem in class JDialogBase
      Parameters:
      wcSys - DOCUMENT ME!
    • buildComboBox

      private JPanel buildComboBox()
      Builds the ComboBox panel editing units of measure.
      Returns:
      The combo box panel.
    • buildGeneralPanel

      private JPanel buildGeneralPanel()
      Builds the "edit image name" panel.
      Returns:
      The panel on which the user can edit the name of the image.
    • buildMatrixPanel

      private JPanel buildMatrixPanel()
      Builds the panel usd in the tabbed pane "transform" as appropriate for the number of dimensions of the image.
      Returns:
      The newly created matrix panel.
    • buildOrientPanel

      private JPanel buildOrientPanel()
      Builds the "orientation edit" panel.
      Returns:
      The panel on which the user can edit the name of the image.
    • buildResolutionPanel

      private JPanel buildResolutionPanel()
      Builds the panels which is edited in the tabbed pane "resolutions".
      Returns:
      The resolutions panel.
    • buildStartLocationsPanel

      private JPanel buildStartLocationsPanel()
      Builds the panels which is edited in the tabbed pane "Dataset Origin".
      Returns:
      The Dataset Origin panel.
    • buildTalairachPanel

      private JScrollPane buildTalairachPanel()
      Builds the Talairach Transform scrollpane with all talairach related data.
      Returns:
      JScrollPane talairach scrollpane
    • init

      private void init(String addTitle)
      Initializes the dialog box and adds the components.
      Parameters:
      addTitle - DOCUMENT ME!
    • reorientCoordSystem

      private TransMatrix reorientCoordSystem(TransMatrix rkMatrix)
      Re-orient the matrix to world and left-hand coordinate systems if required.
      Parameters:
      rkMatrix - the matrix to be converted
      Returns:
      result
      See Also:
    • setComboBox

      private void setComboBox(JComboBox cBox)
      Sets combo box choices that match resolution units listed in FileInfoBase and in the same order.
      Parameters:
      cBox - Combo box to setup to display the units.
    • setVariables

      private boolean setVariables()
      Sets the variables appropriately from the GUI.
      Returns:
      Flag indicating successful set.
    • updateEndianess

      private void updateEndianess()
      Updates the image endianess.
    • updateImageModality

      private void updateImageModality()
      Updates the image modality.
    • updateImageOrientation

      private void updateImageOrientation()
      Updates the image orientation.
    • updateMatrixBox

      private void updateMatrixBox(boolean refreshFields)
      Refreshes the matrix combo box with the list of available matrices within the image.
      Parameters:
      refreshFields - whether or not to refresh the matrix fields (not done in init() bc of order of operations)
    • updateMatrixFields

      private void updateMatrixFields(TransMatrix newMatrix)
      Updates the matrix fields (transform ID, jtextfields).
      Parameters:
      newMatrix - new matrix to use in the update
    • updateMatrixInfo

      private void updateMatrixInfo()
      Updates the image with the new Matrix information (for matrix replacement).
    • updateOriginInfo

      private void updateOriginInfo()
      Updates the origin. Each image has a fileinfo where the origin are stored. Note that the start location for the Z (3rd) dimension change with the change is the slice. The origin is in the upper left corner and we are using the right hand rule. + x -> left to right; + y -> top to bottom and + z -> into screen.
    • updateResolInfo

      private void updateResolInfo()
      Gives the image new resolutions.
    • initResFactor

      protected static float[] initResFactor(float[] imgResols, int[] imgUnits)
      Get the resolution correction needed for non-isotropic images.
      Parameters:
      imgResols - the image resolution
      imgUnits - the image units of measure
      Returns:
      the resolution correction factor in the x (the first element) and y (the second element) dimensions
    • updateTalairachInfo

      private void updateTalairachInfo()
      updates the talairach transform info.
    • updateTransformInfo

      private void updateTransformInfo(TransMatrix tMat)
      Applies the values in the JTabbedPane "Transform" to the transform matrix in the image. Note that there are no visual changes made to the image itself.
      Parameters:
      tMat - DOCUMENT ME!
    • updateXMLLinkedFile

      private void updateXMLLinkedFile()
      method to update the xml file infos with a new linked image path.