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

public class JPanelDTIImportData extends JPanel implements AlgorithmInterface, ActionListener

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:
  • Field Details

    • m_kDWIImage

      public ModelImage m_kDWIImage
      Diffusion Tensor image.
    • m_kT2Image

      public ModelImage m_kT2Image
      T2 image.
    • scrollPane

      public JScrollPane scrollPane
    • dtiparams

      private DTIParameters dtiparams
    • newDTIparams

      private DTIParameters newDTIparams
    • parDTIParams

      private DTIParameters parDTIParams
    • serif12

      private Font serif12
    • outputTextArea

      private JTextArea outputTextArea
      TextArea of main dialogfor text output.*
    • srcBvalGradTable

      private JTable srcBvalGradTable
    • textDWIDataimage

      private JTextField textDWIDataimage
    • invertedBox

      private JComboBox invertedBox
      DOCUMENT ME!
    • fslButton

      JRadioButton fslButton
      Radio button to save gradBval text file in FSL format
    • dtiStudioButton

      JRadioButton dtiStudioButton
      Radio button to save gradBval text file in DTIStudio format
    • mipavStandardButton

      JRadioButton mipavStandardButton
      Radio button to save gradBval text file in mipavStandard format
    • filebvalGradTxtName

      String filebvalGradTxtName
      bValGrad test file name from user
    • numVolumes

      private int numVolumes
      number of Volumes in DWI Image
    • gradBvalText

      private int gradBvalText
      int to determine which format user selects for gradBval test file
    • saveGradchooser

      private JFileChooser saveGradchooser
      chooser for save gradBval text dialog
    • srcTableModel

      public DefaultTableModel srcTableModel
      table model for the srcimages.
    • isDWICellEditBox

      private JCheckBox isDWICellEditBox
      DOCUMENT ME!
    • negXCheckBox

      private JCheckBox negXCheckBox
      DOCUMENT ME!
    • negYCheckBox

      private JCheckBox negYCheckBox
      DOCUMENT ME!
    • negZCheckBox

      private JCheckBox negZCheckBox
      DOCUMENT ME!
    • openedImageCheckBox

      private JCheckBox openedImageCheckBox
      DOCUMENT ME!
    • openDWIButton

      private JButton openDWIButton
      DOCUMENT ME!
    • useT2CheckBox

      public JCheckBox useT2CheckBox
      DOCUMENT ME!
    • t2FileLabel

      private JLabel t2FileLabel
      DOCUMENT ME!
    • bvalGradFileLabel

      private JLabel bvalGradFileLabel
      DOCUMENT ME!
    • textT2image

      private JTextField textT2image
      DOCUMENT ME!
    • textBvalGradFile

      private JTextField textBvalGradFile
      DOCUMENT ME!
    • openT2Button

      private JButton openT2Button
      DOCUMENT ME!
    • bvalGradAppButton

      private JButton bvalGradAppButton
      DOCUMENT ME!
    • isJonesBox

      private JCheckBox isJonesBox
      DOCUMENT ME!
    • isKirbyBox

      private JCheckBox isKirbyBox
      DOCUMENT ME!
    • fatshiftBox

      private JComboBox fatshiftBox
      DOCUMENT ME!
    • gradResBox

      private JComboBox gradResBox
      DOCUMENT ME!
    • gradOPBox

      private JComboBox gradOPBox
      DOCUMENT ME!
    • philRelBox

      private JComboBox philRelBox
      DOCUMENT ME!
    • patientPosBox

      private JComboBox patientPosBox
      DOCUMENT ME!
    • patientOrientBox

      private JComboBox patientOrientBox
      DOCUMENT ME!
    • foldOverBox

      private JComboBox foldOverBox
      DOCUMENT ME!
    • osBox

      private JComboBox osBox
      DOCUMENT ME!
    • gradCreatetable

      private double[][] gradCreatetable
      DOCUMENT ME!
    • angCorrGT

      private double[][] angCorrGT
      DOCUMENT ME!
    • rev_angCorrGT

      private double[][] rev_angCorrGT
      DOCUMENT ME!
    • space

      private String space
      DOCUMENT ME!
    • osLabel

      private JLabel osLabel
      DOCUMENT ME!
    • invertedLabel

      private JLabel invertedLabel
      DOCUMENT ME!
    • gradResLabel

      private JLabel gradResLabel
      DOCUMENT ME!
    • gradOPLabel

      private JLabel gradOPLabel
      DOCUMENT ME!
    • fatShiftLabel

      private JLabel fatShiftLabel
      DOCUMENT ME!
    • patientPosLabel

      private JLabel patientPosLabel
      DOCUMENT ME!
    • patientOrientLabel

      private JLabel patientOrientLabel
      DOCUMENT ME!
    • foldOverLabel

      private JLabel foldOverLabel
      DOCUMENT ME!
    • philRelLabel

      private JLabel philRelLabel
      DOCUMENT ME!
    • pipeline

      private DTIPipeline pipeline
    • ui

      private ViewUserInterface ui
    • currDir

      private String currDir
      current directory *
    • lastStackFlag

      private boolean lastStackFlag
    • srcPanel

      private JPanel srcPanel
    • openImageNames

      Vector<String> openImageNames
    • frame

      public ViewJFrameImage frame
    • t2frame

      public ViewJFrameImage t2frame
    • browseDWIButton

      private JRadioButton browseDWIButton
    • activeDWIButton

      private JRadioButton activeDWIButton
    • DWIOpenPanel

      private JPanel DWIOpenPanel
    • t2OpenPanel

      private JPanel t2OpenPanel
    • loadTable

      private JPanel loadTable
    • DWIButtonPanel

      private JPanel DWIButtonPanel
    • openFile

      private ViewOpenFileUI openFile
    • loadBValGradFileButton

      private JButton loadBValGradFileButton
    • clearDWITableButton

      private JButton clearDWITableButton
    • saveBvalGradButton

      private JButton saveBvalGradButton
    • sliceAng0

      private double sliceAng0
    • sliceAng1

      private double sliceAng1
    • sliceAng2

      private double sliceAng2
    • gradResWOP

      private String gradResWOP
    • mosaicToSliceAlgo

      private AlgorithmMosaicToSlices mosaicToSliceAlgo
    • parNversion

      private String parNversion
    • parNExamName

      private String parNExamName
    • parNProtocolName

      private String parNProtocolName
    • parNPatientPosition

      private String parNPatientPosition
    • parNfoldover

      private String parNfoldover
    • parNsliceAng

      private double[] parNsliceAng
    • parNoffCentre

      private double[] parNoffCentre
    • parNorient

      private int parNorient
    • isBmatFile

      private boolean isBmatFile
    • fileInfoPARREC

      private FileInfoPARREC fileInfoPARREC
    • checkSiemens

      private boolean checkSiemens
    • gradientButton

      private JRadioButton gradientButton
    • BMatrixButton

      private JRadioButton BMatrixButton
  • Constructor Details

    • JPanelDTIImportData

      public JPanelDTIImportData(DTIPipeline pipeline)
  • 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
      Parameters:
      event - Event that triggers this function.
    • init

      public void init()
      init
    • getImageDTIParams

      private void getImageDTIParams()
    • buildTitledBorder

      private TitledBorder buildTitledBorder(String title)
    • highlightTitledBorder

      private TitledBorder highlightTitledBorder(String title)
    • buildSaveGradBvalPanel

      private JPanel 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

      public void niftiParExtraction(File parFileName) throws IOException
      Throws:
      IOException
    • philipsDicomGradExtract

      public void philipsDicomGradExtract()
    • checkSiemens3d

      public void checkSiemens3d()
    • loadT2File

      public void loadT2File()
    • getLastStackFlag

      public boolean getLastStackFlag()
    • readBVGradBMatfile

      public boolean readBVGradBMatfile(String gradientFilePath)
      reads the bval/gradient file...dti studio format, BRUKER method, and fsl format are accepted
      Parameters:
      gradientFilePath -
      Returns:
    • parse

      private String[] parse(String inString)
      DOCUMENT ME!
      Parameters:
      inString - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • readLine

      private String readLine(RandomAccessFile raFile, boolean[] foundEOF) throws IOException
      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

      private HashMap<String,String> buildParVolMap()
    • buildParSliceMap

      private HashMap<String,Integer> buildParSliceMap()
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      Description copied from interface: AlgorithmInterface
      Called 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:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algorithm - the algorithm which has just completed