Class JPanelDTIPreprocessing

  • All Implemented Interfaces:
    AlgorithmInterface, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

    public class JPanelDTIPreprocessing
    extends javax.swing.JPanel
    implements AlgorithmInterface, java.awt.event.ActionListener, java.awt.event.ItemListener
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JPanel

        javax.swing.JPanel.AccessibleJPanel
      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)  
      void algorithmPerformed​(AlgorithmBase algorithm)
      This method is required if the AlgorithmPerformed interface is implemented.
      private ModelImage B0extraction​(ModelImage image4D, int refVolumeNum)
      Extracts the reference sub-volume from the input 4D image.
      void buildLoadPanel​(java.awt.event.ActionListener listener, javax.swing.JPanel mainPanel, javax.swing.JLabel label, javax.swing.JTextField imageName, java.lang.String tooltip, java.lang.String actionCommand)  
      private javax.swing.JButton buildOARButton()  
      private javax.swing.border.TitledBorder buildTitledBorder​(java.lang.String title)  
      protected void callReg35Algorithm​(ModelImage dwiImage)
      Calls the algorithm with the set-up parameters.
      protected void callT2Algorithm​(ModelImage refT2Image, ModelImage matchB0Image)
      Calls the algorithm with the set-up parameters.
      protected void createProgressBar​(java.lang.String title, AlgorithmBase pListener)
      Creates the progress bar that will listen to an algorithm's progress changes
      protected void createProgressBar​(java.lang.String title, java.lang.String msg, AlgorithmBase pListener)
      Creates the progress bar (should be created within JDialog's callAlgorithm method
      private void init()
      Initializes the GUI components and displays the dialog.
      void itemStateChanged​(java.awt.event.ItemEvent arg0)  
      private ModelImage resampleT2​(ModelImage oldT2, ModelImage matchB0)
      Resamples the input ModelImage to match the extents and resolutions of the second ModelImage.
      void saveTransformMatrix​(java.lang.String fileName, TransMatrix[] matrix)
      This method creates the Trans Matrices Array file for DTI Preprocessing
      void setOutputDirectory​(java.lang.String directory)
      Sets the default output directory for the images generated by this panel.
      private boolean setVariablesForOAR35D()
      Sets the variables needed to call the registration algorithm based on the values entered in the dialog.
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • imageB0

        private ModelImage imageB0
        The B0 image from the original 4D DWI image series, extracted from the DWI volume:
      • imageT2

        private ModelImage imageT2
        The T2 image that the B0 image is registered to. This may be the original T2 if it matched the extents/resultions of the other image Or it is the resampled T2 image
      • imageUpdatedDWI

        private ModelImage imageUpdatedDWI
        After the B0 image is registered to the T2 image the B0 sub-volume is replaced in the original DWI image, creating a new 4D DWI image:
      • b0toStructMatrix

        private TransMatrix b0toStructMatrix
        The transformation matrix describing the transformation from registering B0 to T2 image. If that step in the process is skipped, this defaults to the identity matrix:
      • b0MatrixFileName

        private java.lang.String b0MatrixFileName
        File name for the B0 to T2 transformation matrix (needed to populate the next panel in the DTIPipeline)
      • serif12

        private java.awt.Font serif12
      • serif12B

        private java.awt.Font serif12B
      • refImageNumText

        public javax.swing.JTextField refImageNumText
        user-input for the B0 sub-volume number in the 4D DWI image
      • comboBoxDOF

        private javax.swing.JComboBox comboBoxDOF
        DOCUMENT ME!
      • progressBar

        protected ViewJProgressBar progressBar
        Progress bar that will listen to a dialog's algorithm (and reflect current progress)
      • comboBoxInterp

        private javax.swing.JComboBox comboBoxInterp
        DOCUMENT ME!
      • comboBoxCostFunct

        private javax.swing.JComboBox comboBoxCostFunct
        DOCUMENT ME!
      • transformDWICheckbox

        private javax.swing.JCheckBox transformDWICheckbox
        DOCUMENT ME!
      • matrixComboBox

        public javax.swing.JComboBox matrixComboBox
        DOCUMENT ME!
      • matrixDirText

        public javax.swing.JTextField matrixDirText
        DOCUMENT ME!
      • OKButton

        private javax.swing.JButton OKButton
      • mainPanel

        private javax.swing.JPanel mainPanel
      • cost

        private int cost
        DOCUMENT ME!
      • interp

        private int interp
        DOCUMENT ME!
      • DOF

        private int DOF
        DOCUMENT ME!
      • costT2

        private int costT2
        DOCUMENT ME!
      • interpT2

        private int interpT2
        DOCUMENT ME!
      • DOFT2

        private int DOFT2
        DOCUMENT ME!
      • rotateBeginX

        private float rotateBeginX
      • rotateEndX

        private float rotateEndX
      • coarseRateX

        private float coarseRateX
      • fineRateX

        private float fineRateX
      • rotateBeginY

        private float rotateBeginY
      • rotateEndY

        private float rotateEndY
      • coarseRateY

        private float coarseRateY
      • fineRateY

        private float fineRateY
      • rotateBeginZ

        private float rotateBeginZ
      • rotateEndZ

        private float rotateEndZ
      • coarseRateZ

        private float coarseRateZ
      • fineRateZ

        private float fineRateZ
      • maxOfMinResol

        private boolean maxOfMinResol
      • doSubsample

        private boolean doSubsample
      • doMultiThread

        private boolean doMultiThread
      • fastMode

        private boolean fastMode
      • doGraph

        private boolean doGraph
      • maxIterations

        private int maxIterations
      • numMinima

        private int numMinima
      • registerTo

        int registerTo
      • transformMatDWICheckbox

        public javax.swing.JCheckBox transformMatDWICheckbox
      • transformB0label

        public javax.swing.JLabel transformB0label
      • transformB0MatCheckbox

        public javax.swing.JCheckBox transformB0MatCheckbox
      • transformB0Checkbox

        public javax.swing.JCheckBox transformB0Checkbox
      • blanklabel

        public javax.swing.JLabel blanklabel
      • skipPreCheckbox

        private javax.swing.JCheckBox skipPreCheckbox
      • correctGradTransCheckbox

        public javax.swing.JCheckBox correctGradTransCheckbox
      • labelDOF

        private javax.swing.JLabel labelDOF
      • labelCost

        private javax.swing.JLabel labelCost
      • labelInternal

        private javax.swing.JLabel labelInternal
      • labelInterp

        private javax.swing.JLabel labelInterp
      • structOptPanel

        public javax.swing.JPanel structOptPanel
      • outputDir

        private javax.swing.JTextField outputDir
        output directory enables user to choose where to save files to.
      • outputCommand

        private java.lang.String outputCommand
        action command when the user presses the browse button to select the output directory:
      • buttonPanel

        javax.swing.JPanel buttonPanel
      • performEPICheckbox

        javax.swing.JCheckBox performEPICheckbox
      • preProsText

        private javax.swing.JTextField preProsText
      • preProsLabel

        private javax.swing.JLabel preProsLabel
      • openDirButton

        private javax.swing.JButton openDirButton
    • Constructor Detail

      • JPanelDTIPreprocessing

        public JPanelDTIPreprocessing​(DTIPipeline pipeline)
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • 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 complete.
        Specified by:
        algorithmPerformed in interface AlgorithmInterface
        Parameters:
        algorithm - Algorithm that caused the event.
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent arg0)
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
      • saveTransformMatrix

        public void saveTransformMatrix​(java.lang.String fileName,
                                        TransMatrix[] matrix)
        This method creates the Trans Matrices Array file for DTI Preprocessing
      • setOutputDirectory

        public void setOutputDirectory​(java.lang.String directory)
        Sets the default output directory for the images generated by this panel.
        Parameters:
        directory -
      • callReg35Algorithm

        protected void callReg35Algorithm​(ModelImage dwiImage)
        Calls the algorithm with the set-up parameters.
      • callT2Algorithm

        protected void callT2Algorithm​(ModelImage refT2Image,
                                       ModelImage matchB0Image)
        Calls the algorithm with the set-up parameters.
      • createProgressBar

        protected void createProgressBar​(java.lang.String title,
                                         AlgorithmBase pListener)
        Creates the progress bar that will listen to an algorithm's progress changes
        Parameters:
        title - progress bar's title
        pListener - algorithmbase that will notify progress updates to the pBar
      • createProgressBar

        protected void createProgressBar​(java.lang.String title,
                                         java.lang.String msg,
                                         AlgorithmBase pListener)
        Creates the progress bar (should be created within JDialog's callAlgorithm method
        Parameters:
        title - progress bar's title
        msg - the message to display on the progress bar (initial setting)
        pListener - the algorithm that will register the progress bar as a listener
      • B0extraction

        private ModelImage B0extraction​(ModelImage image4D,
                                        int refVolumeNum)
        Extracts the reference sub-volume from the input 4D image.
        Parameters:
        image4D - 4D image to extract the sub-volume from.
        refVolumeNum - the reference sub-volume number.
        Returns:
        a new ModelImage containing the extracted sub-volume.
      • buildOARButton

        private javax.swing.JButton buildOARButton()
      • buildTitledBorder

        private javax.swing.border.TitledBorder buildTitledBorder​(java.lang.String title)
      • buildLoadPanel

        public void buildLoadPanel​(java.awt.event.ActionListener listener,
                                   javax.swing.JPanel mainPanel,
                                   javax.swing.JLabel label,
                                   javax.swing.JTextField imageName,
                                   java.lang.String tooltip,
                                   java.lang.String actionCommand)
      • init

        private void init()
        Initializes the GUI components and displays the dialog.
      • resampleT2

        private ModelImage resampleT2​(ModelImage oldT2,
                                      ModelImage matchB0)
        Resamples the input ModelImage to match the extents and resolutions of the second ModelImage.
        Parameters:
        oldT2 - input image that will be resampled
        matchB0 - the image to match
        Returns:
        resampled version of the first input image.
      • setVariablesForOAR35D

        private boolean setVariablesForOAR35D()
        Sets the variables needed to call the registration algorithm based on the values entered in the dialog.
        Returns:
        true if the variables are properly set, false otherwise.