Class JPanelDTIImportData
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gov.nih.mipav.view.renderer.WildMagic.DTI_FrameWork.JPanelDTIImportData
- All Implemented Interfaces:
AlgorithmInterface,ActionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
The copyright below only pertains to methods within JDialogImageInfo that relate to the Gradient Table Creator for Philips PAR/REC files V3/V4 that is displayed in the DTI tab. Portions of code that relate to this copyright are denoted with comments giving credit to software and authors.
Copyright (c) 2011, Bennett Landman
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JRadioButtonprivate double[][]DOCUMENT ME!private JRadioButtonprivate JRadioButtonprivate JButtonDOCUMENT ME!private JLabelDOCUMENT ME!private booleanprivate JButtonprivate Stringcurrent directory *private DTIParameters(package private) JRadioButtonRadio button to save gradBval text file in DTIStudio formatprivate JPanelprivate JPanelprivate JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!(package private) StringbValGrad test file name from userprivate FileInfoPARRECprivate JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!(package private) JRadioButtonRadio button to save gradBval text file in FSL formatprivate intint to determine which format user selects for gradBval test fileprivate double[][]DOCUMENT ME!private JRadioButtonprivate JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!private JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!private Stringprivate JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!private booleanprivate JCheckBoxDOCUMENT ME!private JCheckBoxDOCUMENT ME!private JCheckBoxDOCUMENT ME!private booleanprivate JButtonprivate JPanelDiffusion Tensor image.T2 image.(package private) JRadioButtonRadio button to save gradBval text file in mipavStandard formatprivate AlgorithmMosaicToSlicesprivate JCheckBoxDOCUMENT ME!private JCheckBoxDOCUMENT ME!private JCheckBoxDOCUMENT ME!private DTIParametersprivate intnumber of Volumes in DWI Imageprivate JButtonDOCUMENT ME!private JCheckBoxDOCUMENT ME!private ViewOpenFileUIprivate JButtonDOCUMENT ME!private JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!private JTextAreaTextArea of main dialogfor text outputprivate DTIParametersprivate Stringprivate Stringprivate double[]private intprivate Stringprivate Stringprivate double[]private Stringprivate JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!private JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!private JComboBoxDOCUMENT ME!private JLabelDOCUMENT ME!private DTIPipelineprivate double[][]DOCUMENT ME!private JButtonprivate JFileChooserchooser for save gradBval text dialogprivate Fontprivate doubleprivate doubleprivate doubleprivate StringDOCUMENT ME!private JTableprivate JPaneltable model for the srcimages.private JLabelDOCUMENT ME!private JPanelprivate JTextFieldDOCUMENT ME!private JTextFieldprivate JTextFieldDOCUMENT ME!private ViewUserInterfaceDOCUMENT ME!Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) When Apply button is pressed, applies changes to all three areas: image name, resolutions, and transformation matrix.voidalgorithmPerformed(AlgorithmBase algorithm) Called after an algorithm this listener is registered to exits (maybe successfully, maybe not).voidangulationCorrection(double[][] tablein) double[][]applyRotation(double[][] A, double[][] table) private JPanelprivate TitledBorderbuildTitledBorder(String title) voidprivate doublecos(double a) booleanThis method creates the B-Value/Gradient file for DTI Tabprivate voidstatic final double[][]getHigh()static final double[][]static final double[][]static final double[][]private voidstatic final double[][]static final double[][]booleanstatic final double[][]getLow()static final double[][]getLowOP()static final double[][]static final double[][]static final double[][]static final double[][]private voidprivate TitledBorderhighlightTitledBorder(String title) voidinit()initvoidvoiddouble[][]matrixMultiply(double[][] A, double[][] B) voidniftiParExtraction(File parFileName) private double[][]normalizeTable(double[][] table) private String[]DOCUMENT ME!voidbooleanreadBVGradBMatfile(String gradientFilePath) reads the bval/gradient file...dti studio format, BRUKER method, and fsl format are acceptedprivate StringreadLine(RandomAccessFile raFile, boolean[] foundEOF) Reads lines of the file until a nonnull String results or the end of the file is reached.private doublesin(double a) Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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 Details
-
m_kDWIImage
Diffusion Tensor image. -
m_kT2Image
T2 image. -
scrollPane
-
dtiparams
-
newDTIparams
-
parDTIParams
-
serif12
-
outputTextArea
TextArea of main dialogfor text output.* -
srcBvalGradTable
-
textDWIDataimage
-
invertedBox
DOCUMENT ME! -
fslButton
JRadioButton fslButtonRadio button to save gradBval text file in FSL format -
dtiStudioButton
JRadioButton dtiStudioButtonRadio button to save gradBval text file in DTIStudio format -
mipavStandardButton
JRadioButton mipavStandardButtonRadio button to save gradBval text file in mipavStandard format -
filebvalGradTxtName
String filebvalGradTxtNamebValGrad test file name from user -
numVolumes
private int numVolumesnumber of Volumes in DWI Image -
gradBvalText
private int gradBvalTextint to determine which format user selects for gradBval test file -
saveGradchooser
chooser for save gradBval text dialog -
srcTableModel
table model for the srcimages. -
isDWICellEditBox
DOCUMENT ME! -
negXCheckBox
DOCUMENT ME! -
negYCheckBox
DOCUMENT ME! -
negZCheckBox
DOCUMENT ME! -
openedImageCheckBox
DOCUMENT ME! -
openDWIButton
DOCUMENT ME! -
useT2CheckBox
DOCUMENT ME! -
t2FileLabel
DOCUMENT ME! -
bvalGradFileLabel
DOCUMENT ME! -
textT2image
DOCUMENT ME! -
textBvalGradFile
DOCUMENT ME! -
openT2Button
DOCUMENT ME! -
bvalGradAppButton
DOCUMENT ME! -
isJonesBox
DOCUMENT ME! -
isKirbyBox
DOCUMENT ME! -
fatshiftBox
DOCUMENT ME! -
gradResBox
DOCUMENT ME! -
gradOPBox
DOCUMENT ME! -
philRelBox
DOCUMENT ME! -
patientPosBox
DOCUMENT ME! -
patientOrientBox
DOCUMENT ME! -
foldOverBox
DOCUMENT ME! -
osBox
DOCUMENT ME! -
gradCreatetable
private double[][] gradCreatetableDOCUMENT ME! -
angCorrGT
private double[][] angCorrGTDOCUMENT ME! -
rev_angCorrGT
private double[][] rev_angCorrGTDOCUMENT ME! -
space
DOCUMENT ME! -
osLabel
DOCUMENT ME! -
invertedLabel
DOCUMENT ME! -
gradResLabel
DOCUMENT ME! -
gradOPLabel
DOCUMENT ME! -
fatShiftLabel
DOCUMENT ME! -
patientPosLabel
DOCUMENT ME! -
patientOrientLabel
DOCUMENT ME! -
foldOverLabel
DOCUMENT ME! -
philRelLabel
DOCUMENT ME! -
pipeline
-
ui
-
currDir
current directory * -
lastStackFlag
private boolean lastStackFlag -
srcPanel
-
openImageNames
-
frame
-
t2frame
-
browseDWIButton
-
activeDWIButton
-
DWIOpenPanel
-
t2OpenPanel
-
loadTable
-
DWIButtonPanel
-
openFile
-
loadBValGradFileButton
-
clearDWITableButton
-
saveBvalGradButton
-
sliceAng0
private double sliceAng0 -
sliceAng1
private double sliceAng1 -
sliceAng2
private double sliceAng2 -
gradResWOP
-
mosaicToSliceAlgo
-
parNversion
-
parNExamName
-
parNProtocolName
-
parNPatientPosition
-
parNfoldover
-
parNsliceAng
private double[] parNsliceAng -
parNoffCentre
private double[] parNoffCentre -
parNorient
private int parNorient -
isBmatFile
private boolean isBmatFile -
fileInfoPARREC
-
checkSiemens
private boolean checkSiemens -
gradientButton
-
BMatrixButton
-
-
Constructor Details
-
JPanelDTIImportData
-
-
Method Details
-
actionPerformed
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:
actionPerformedin interfaceActionListener- Parameters:
event- Event that triggers this function.
-
init
public void init()init -
getImageDTIParams
private void getImageDTIParams() -
buildTitledBorder
-
highlightTitledBorder
-
buildSaveGradBvalPanel
-
DWIJonesKirbyDialog
private void DWIJonesKirbyDialog() -
gradientTableCreator
private void gradientTableCreator() -
getLowOP
public static final double[][] getLowOP() -
getMediumOP
public static final double[][] getMediumOP() -
getLowOP2
public static final double[][] getLowOP2() -
getMediumOP2
public static final double[][] getMediumOP2() -
getHighOP_24prev
public static final double[][] getHighOP_24prev() -
getHighOP_rel25
public static final double[][] getHighOP_rel25() -
getHighOP_25post
public static final double[][] getHighOP_25post() -
getLow
public static final double[][] getLow() -
getMedium
public static final double[][] getMedium() -
getHigh
public static final double[][] getHigh() -
getJones30
public static final double[][] getJones30() -
getJones30VMS
public static final double[][] getJones30VMS() -
cos
private double cos(double a) -
sin
private double sin(double a) -
matrixMultiply
public double[][] matrixMultiply(double[][] A, double[][] B) -
applyRotation
public double[][] applyRotation(double[][] A, double[][] table) -
normalizeTable
private double[][] normalizeTable(double[][] table) -
angulationCorrection
public void angulationCorrection(double[][] tablein) -
loadDWIFile
public void loadDWIFile() -
niftiParExtraction
- Throws:
IOException
-
philipsDicomGradExtract
public void philipsDicomGradExtract() -
checkSiemens3d
public void checkSiemens3d() -
loadT2File
public void loadT2File() -
getLastStackFlag
public boolean getLastStackFlag() -
readBVGradBMatfile
reads the bval/gradient file...dti studio format, BRUKER method, and fsl format are accepted- Parameters:
gradientFilePath-- Returns:
-
parse
DOCUMENT ME!- Parameters:
inString- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
readLine
Reads lines of the file until a nonnull String results or the end of the file is reached.- Returns:
- the line read in
- Throws:
IOException- if there is an error reading the file
-
createBVGradBMatFileTXT
public boolean createBVGradBMatFileTXT()This method creates the B-Value/Gradient file for DTI Tab- Returns:
-
buildParVolMap
-
buildParSliceMap
-
algorithmPerformed
Description copied from interface:AlgorithmInterfaceCalled after an algorithm this listener is registered to exits (maybe successfully, maybe not). If the algorithm is run in a separate thread, this call will be made within that thread. If not, this call will be made from that same, shared thread.- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- the algorithm which has just completed
-