Class JPanelDTIPreprocessing
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- gov.nih.mipav.view.renderer.WildMagic.DTI_FrameWork.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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
b0MatrixFileName
File name for the B0 to T2 transformation matrix (needed to populate the next panel in the DTIPipeline)private TransMatrix
b0toStructMatrix
The transformation matrix describing the transformation from registering B0 to T2 image.javax.swing.JLabel
blanklabel
(package private) javax.swing.JPanel
buttonPanel
private float
coarseRateX
private float
coarseRateY
private float
coarseRateZ
private javax.swing.JComboBox
comboBoxCostFunct
DOCUMENT ME!private javax.swing.JComboBox
comboBoxDOF
DOCUMENT ME!private javax.swing.JComboBox
comboBoxInterp
DOCUMENT ME!javax.swing.JCheckBox
correctGradTransCheckbox
private int
cost
DOCUMENT ME!private int
costT2
DOCUMENT ME!private int
DOF
DOCUMENT ME!private int
DOFT2
DOCUMENT ME!private boolean
doGraph
private boolean
doMultiThread
private boolean
doSubsample
private boolean
fastMode
private float
fineRateX
private float
fineRateY
private float
fineRateZ
private ModelImage
imageB0
The B0 image from the original 4D DWI image series, extracted from the DWI volume:private ModelImage
imageT2
The T2 image that the B0 image is registered to.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:private int
interp
DOCUMENT ME!private int
interpT2
DOCUMENT ME!private javax.swing.JLabel
labelCost
private javax.swing.JLabel
labelDOF
private javax.swing.JLabel
labelInternal
private javax.swing.JLabel
labelInterp
private javax.swing.JPanel
mainPanel
javax.swing.JComboBox
matrixComboBox
DOCUMENT ME!javax.swing.JTextField
matrixDirText
DOCUMENT ME!private int
maxIterations
private boolean
maxOfMinResol
private int
numMinima
private javax.swing.JButton
OKButton
private javax.swing.JButton
openDirButton
private java.lang.String
outputCommand
action command when the user presses the browse button to select the output directory:private javax.swing.JTextField
outputDir
output directory enables user to choose where to save files to.(package private) javax.swing.JCheckBox
performEPICheckbox
private DTIPipeline
pipeline
private javax.swing.JLabel
preProsLabel
private javax.swing.JTextField
preProsText
protected ViewJProgressBar
progressBar
Progress bar that will listen to a dialog's algorithm (and reflect current progress)javax.swing.JTextField
refImageNumText
user-input for the B0 sub-volume number in the 4D DWI imageprivate AlgorithmRegOAR3D
reg3
DOCUMENT ME!private AlgorithmRegOAR35D
reg35
DOCUMENT ME!(package private) int
registerTo
(package private) ModelImage
result35RegImage
private float
rotateBeginX
private float
rotateBeginY
private float
rotateBeginZ
private float
rotateEndX
private float
rotateEndY
private float
rotateEndZ
private static long
serialVersionUID
Use serialVersionUID for interoperability.private java.awt.Font
serif12
private java.awt.Font
serif12B
private javax.swing.JCheckBox
skipPreCheckbox
javax.swing.JPanel
structOptPanel
javax.swing.JCheckBox
transformB0Checkbox
javax.swing.JLabel
transformB0label
javax.swing.JCheckBox
transformB0MatCheckbox
private javax.swing.JCheckBox
transformDWICheckbox
DOCUMENT ME!javax.swing.JCheckBox
transformMatDWICheckbox
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description JPanelDTIPreprocessing(DTIPipeline pipeline)
-
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 changesprotected void
createProgressBar(java.lang.String title, java.lang.String msg, AlgorithmBase pListener)
Creates the progress bar (should be created within JDialog's callAlgorithm methodprivate 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 Preprocessingvoid
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
pipeline
private DTIPipeline pipeline
-
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
-
reg3
private AlgorithmRegOAR3D reg3
DOCUMENT ME!
-
reg35
private AlgorithmRegOAR35D reg35
DOCUMENT ME!
-
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
-
result35RegImage
ModelImage result35RegImage
-
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 interfacejava.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 interfaceAlgorithmInterface
- Parameters:
algorithm
- Algorithm that caused the event.
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent arg0)
- Specified by:
itemStateChanged
in interfacejava.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 titlepListener
- 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 titlemsg
- 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 resampledmatchB0
- 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.
-
-