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.Stringb0MatrixFileNameFile name for the B0 to T2 transformation matrix (needed to populate the next panel in the DTIPipeline)private TransMatrixb0toStructMatrixThe transformation matrix describing the transformation from registering B0 to T2 image.javax.swing.JLabelblanklabel(package private) javax.swing.JPanelbuttonPanelprivate floatcoarseRateXprivate floatcoarseRateYprivate floatcoarseRateZprivate javax.swing.JComboBoxcomboBoxCostFunctDOCUMENT ME!private javax.swing.JComboBoxcomboBoxDOFDOCUMENT ME!private javax.swing.JComboBoxcomboBoxInterpDOCUMENT ME!javax.swing.JCheckBoxcorrectGradTransCheckboxprivate intcostDOCUMENT ME!private intcostT2DOCUMENT ME!private intDOFDOCUMENT ME!private intDOFT2DOCUMENT ME!private booleandoGraphprivate booleandoMultiThreadprivate booleandoSubsampleprivate booleanfastModeprivate floatfineRateXprivate floatfineRateYprivate floatfineRateZprivate ModelImageimageB0The B0 image from the original 4D DWI image series, extracted from the DWI volume:private ModelImageimageT2The T2 image that the B0 image is registered to.private ModelImageimageUpdatedDWIAfter 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 intinterpDOCUMENT ME!private intinterpT2DOCUMENT ME!private javax.swing.JLabellabelCostprivate javax.swing.JLabellabelDOFprivate javax.swing.JLabellabelInternalprivate javax.swing.JLabellabelInterpprivate javax.swing.JPanelmainPaneljavax.swing.JComboBoxmatrixComboBoxDOCUMENT ME!javax.swing.JTextFieldmatrixDirTextDOCUMENT ME!private intmaxIterationsprivate booleanmaxOfMinResolprivate intnumMinimaprivate javax.swing.JButtonOKButtonprivate javax.swing.JButtonopenDirButtonprivate java.lang.StringoutputCommandaction command when the user presses the browse button to select the output directory:private javax.swing.JTextFieldoutputDiroutput directory enables user to choose where to save files to.(package private) javax.swing.JCheckBoxperformEPICheckboxprivate DTIPipelinepipelineprivate javax.swing.JLabelpreProsLabelprivate javax.swing.JTextFieldpreProsTextprotected ViewJProgressBarprogressBarProgress bar that will listen to a dialog's algorithm (and reflect current progress)javax.swing.JTextFieldrefImageNumTextuser-input for the B0 sub-volume number in the 4D DWI imageprivate AlgorithmRegOAR3Dreg3DOCUMENT ME!private AlgorithmRegOAR35Dreg35DOCUMENT ME!(package private) intregisterTo(package private) ModelImageresult35RegImageprivate floatrotateBeginXprivate floatrotateBeginYprivate floatrotateBeginZprivate floatrotateEndXprivate floatrotateEndYprivate floatrotateEndZprivate static longserialVersionUIDUse serialVersionUID for interoperability.private java.awt.Fontserif12private java.awt.Fontserif12Bprivate javax.swing.JCheckBoxskipPreCheckboxjavax.swing.JPanelstructOptPaneljavax.swing.JCheckBoxtransformB0Checkboxjavax.swing.JLabeltransformB0labeljavax.swing.JCheckBoxtransformB0MatCheckboxprivate javax.swing.JCheckBoxtransformDWICheckboxDOCUMENT ME!javax.swing.JCheckBoxtransformMatDWICheckbox-
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 voidactionPerformed(java.awt.event.ActionEvent event)voidalgorithmPerformed(AlgorithmBase algorithm)This method is required if the AlgorithmPerformed interface is implemented.private ModelImageB0extraction(ModelImage image4D, int refVolumeNum)Extracts the reference sub-volume from the input 4D image.voidbuildLoadPanel(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.JButtonbuildOARButton()private javax.swing.border.TitledBorderbuildTitledBorder(java.lang.String title)protected voidcallReg35Algorithm(ModelImage dwiImage)Calls the algorithm with the set-up parameters.protected voidcallT2Algorithm(ModelImage refT2Image, ModelImage matchB0Image)Calls the algorithm with the set-up parameters.protected voidcreateProgressBar(java.lang.String title, AlgorithmBase pListener)Creates the progress bar that will listen to an algorithm's progress changesprotected voidcreateProgressBar(java.lang.String title, java.lang.String msg, AlgorithmBase pListener)Creates the progress bar (should be created within JDialog's callAlgorithm methodprivate voidinit()Initializes the GUI components and displays the dialog.voiditemStateChanged(java.awt.event.ItemEvent arg0)private ModelImageresampleT2(ModelImage oldT2, ModelImage matchB0)Resamples the input ModelImage to match the extents and resolutions of the second ModelImage.voidsaveTransformMatrix(java.lang.String fileName, TransMatrix[] matrix)This method creates the Trans Matrices Array file for DTI PreprocessingvoidsetOutputDirectory(java.lang.String directory)Sets the default output directory for the images generated by this panel.private booleansetVariablesForOAR35D()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:
actionPerformedin 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:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- Algorithm that caused the event.
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent arg0)
- Specified by:
itemStateChangedin 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:
trueif the variables are properly set,falseotherwise.
-
-