Class JDialogSaveDicom

  • All Implemented Interfaces:
    DialogDefaultsInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class JDialogSaveDicom
    extends JDialogBase
    Simple dialog to tell the program important information necessary for saving the DICOM file.
    Version:
    1.0 Aug 1, 2000
    Author:
    Neva Cherniavsky
    See Also:
    FileDicom, Serialized Form
    • Nested Class Summary

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

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • 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
    • Constructor Summary

      Constructors 
      Constructor Description
      JDialogSaveDicom​(java.awt.Frame theParentFrame, FileInfoBase _fileInfo, FileInfoDicom dicomInfo, boolean isScriptRunning, boolean isMultiFrame, int dataType)
      Creates dialog for setting tag information for DICOM image.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Closes dialog box when the OK button is pressed and sets the information, doing error checking for every tag.
      void autofillRequiredFields()
      Autofill the dicom required tags to loosely fullfill the dicom standard.
      private boolean checkTag​(java.lang.String value, java.lang.String type)
      Checks the text field data for the proper format.
      private javax.swing.JButton createButton​(java.lang.String title, javax.swing.JButton button)
      Makes a button.
      private javax.swing.JComboBox createComboBox​(java.awt.Container panel, java.lang.String[] choices, int x, int y, int w, int h)
      Creates a combo box and adds it to the panel.
      private void createHashtable()
      Creates static hashtable to use to fill the tags in the dialog.
      private void createLabel​(java.lang.String title, java.awt.Container panel, int x, int y, int w, int h)
      Makes a label and adds it to the panel.
      private javax.swing.JPanel createPanel()
      Makes a panel with a grid layout with the parameters specified.
      private void createPatientPanel()
      Creates the panel for the patient tab.
      private void createRequiredPanel()
      Creates the panel of required tags.
      private void createSeriesPanel()
      Creates the panel for the series tab.
      private void createStudyPanel()
      Creates the panel for the study tab.
      private void fillDataFromFile()
      Asks for a text file of tags, then loads them into the text fields.
      private void fillDataFromTable​(java.util.Hashtable<java.lang.String,​java.lang.String> table)
      Fill the values in the dialog from tag-value pairs in a hashtable.
      private boolean isDefaultCharacter​(java.lang.String word, boolean control)
      Checks that all the characters of the string are in the default character repertoire.
      private void resetSize​(javax.swing.JTextField field)
      Resizes the text field so that all characters are displayed.
      private void setChooserFromTag​(java.lang.String tag, java.lang.String value)
      Sets the value for one of the choosers based on a dicom tag and value.
      private void setGBC​(int x, int y, int w, int h)
      A helper method for adding a component using GridBagLayout, so we don't have to set up the x, y, width, and height over and over again.
      private void setModalityChooser​(int modality)
      Sets the modality chooser box based on the file info modality (the modality indexes should match up with the ordering of the chooser).
      private javax.swing.JTextField setTextField​(java.lang.String initial, java.awt.Container panel, int x, int y, int w, int h)
      Makes a text field and adds it to the panel.
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, 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
      • autofillButton

        private javax.swing.JButton autofillButton
        DOCUMENT ME!
      • dicomFileInfo

        private final FileInfoDicom dicomFileInfo
        DOCUMENT ME!
      • fileInfo

        private final FileInfoBase fileInfo
        DOCUMENT ME!
      • fillButton

        private javax.swing.JButton fillButton
        DOCUMENT ME!
      • gbc

        private final java.awt.GridBagConstraints gbc
        DOCUMENT ME!
      • lateralities

        private final java.lang.String[] lateralities
        DOCUMENT ME!
      • laterality

        private javax.swing.JComboBox laterality
        DOCUMENT ME!
      • layout

        private final java.awt.GridBagLayout layout
        DOCUMENT ME!
      • modalities

        private final java.lang.String[] modalities
        DOCUMENT ME!
      • parts

        private final java.lang.String[] parts
        DOCUMENT ME!
      • patientBirthDate

        private javax.swing.JTextField patientBirthDate
        DOCUMENT ME!
      • patientBirthTime

        private javax.swing.JTextField patientBirthTime
        DOCUMENT ME!
      • patientComments

        private javax.swing.JTextField patientComments
        DOCUMENT ME!
      • patientEthnicGroup

        private javax.swing.JTextField patientEthnicGroup
        DOCUMENT ME!
      • patientID

        private javax.swing.JTextField patientID
        DOCUMENT ME!
      • patientName

        private javax.swing.JTextField patientName
        DOCUMENT ME!
      • patientOrientation

        private javax.swing.JTextField patientOrientation
        DOCUMENT ME!
      • patientOtherIDs

        private javax.swing.JTextField patientOtherIDs
        DOCUMENT ME!
      • patientOtherNames

        private javax.swing.JTextField patientOtherNames
        DOCUMENT ME!
      • patientPanel

        private javax.swing.JPanel patientPanel
        DOCUMENT ME!
      • patientSex

        private javax.swing.JComboBox patientSex
        DOCUMENT ME!
      • positions

        private final java.lang.String[] positions
        DOCUMENT ME!
      • requiredPanel

        private javax.swing.JPanel requiredPanel
        DOCUMENT ME!
      • seriesBody

        private javax.swing.JComboBox seriesBody
        DOCUMENT ME!
      • seriesDate

        private javax.swing.JTextField seriesDate
        DOCUMENT ME!
      • seriesDescrip

        private javax.swing.JTextField seriesDescrip
        DOCUMENT ME!
      • seriesLarge

        private javax.swing.JTextField seriesLarge
        DOCUMENT ME!
      • seriesMod

        private javax.swing.JComboBox seriesMod
        DOCUMENT ME!
      • seriesNo

        private javax.swing.JTextField seriesNo
        DOCUMENT ME!
      • seriesOp

        private javax.swing.JTextField seriesOp
        DOCUMENT ME!
      • seriesPanel

        private javax.swing.JPanel seriesPanel
        DOCUMENT ME!
      • seriesPerfPhy

        private javax.swing.JTextField seriesPerfPhy
        DOCUMENT ME!
      • seriesPos

        private javax.swing.JComboBox seriesPos
        DOCUMENT ME!
      • seriesProtocol

        private javax.swing.JTextField seriesProtocol
        DOCUMENT ME!
      • seriesSmall

        private javax.swing.JTextField seriesSmall
        DOCUMENT ME!
      • seriesStepDate

        private javax.swing.JTextField seriesStepDate
        DOCUMENT ME!
      • seriesStepDescrip

        private javax.swing.JTextField seriesStepDescrip
        DOCUMENT ME!
      • seriesStepID

        private javax.swing.JTextField seriesStepID
        DOCUMENT ME!
      • seriesStepTime

        private javax.swing.JTextField seriesStepTime
        DOCUMENT ME!
      • seriesTime

        private javax.swing.JTextField seriesTime
        DOCUMENT ME!
      • seriesUID

        private javax.swing.JTextField seriesUID
        DOCUMENT ME!
      • sexes

        private final java.lang.String[] sexes
        DOCUMENT ME!
      • studyAccNumber

        private javax.swing.JTextField studyAccNumber
        DOCUMENT ME!
      • studyAge

        private javax.swing.JTextField studyAge
        DOCUMENT ME!
      • studyDate

        private javax.swing.JTextField studyDate
        DOCUMENT ME!
      • studyDescrip

        private javax.swing.JTextField studyDescrip
        DOCUMENT ME!
      • studyDiag

        private javax.swing.JTextField studyDiag
        DOCUMENT ME!
      • studyHist

        private javax.swing.JTextField studyHist
        DOCUMENT ME!
      • studyID

        private javax.swing.JTextField studyID
        DOCUMENT ME!
      • studyOcc

        private javax.swing.JTextField studyOcc
        DOCUMENT ME!
      • studyPanel

        private javax.swing.JPanel studyPanel
        DOCUMENT ME!
      • studyPhyRead

        private javax.swing.JTextField studyPhyRead
        DOCUMENT ME!
      • studyPhyRec

        private javax.swing.JTextField studyPhyRec
        DOCUMENT ME!
      • studyRefPhy

        private javax.swing.JTextField studyRefPhy
        DOCUMENT ME!
      • studySize

        private javax.swing.JTextField studySize
        DOCUMENT ME!
      • studyTime

        private javax.swing.JTextField studyTime
        DOCUMENT ME!
      • studyUID

        private javax.swing.JTextField studyUID
        DOCUMENT ME!
      • studyWeight

        private javax.swing.JTextField studyWeight
        DOCUMENT ME!
      • tabPane

        private final javax.swing.JTabbedPane tabPane
        DOCUMENT ME!
      • tagsImportedFromNonDicomImage

        private java.util.Hashtable<java.lang.String,​java.lang.String> tagsImportedFromNonDicomImage
        DICOM tags extracted from the image we want to save. Example: dicom_0xNNNN el_0xNNNN tags stored in MINC headers.
      • tagsList

        private java.util.Hashtable<java.lang.String,​javax.swing.JComponent> tagsList
        The additional tags list is a list of tags the DTI group has requested.
      • additionalTagsList

        private java.util.Hashtable<java.lang.String,​java.lang.String> additionalTagsList
      • isMultiFrame

        private boolean isMultiFrame
      • dataType

        private int dataType
    • Constructor Detail

      • JDialogSaveDicom

        public JDialogSaveDicom​(java.awt.Frame theParentFrame,
                                FileInfoBase _fileInfo,
                                FileInfoDicom dicomInfo,
                                boolean isScriptRunning,
                                boolean isMultiFrame,
                                int dataType)
        Creates dialog for setting tag information for DICOM image.
        Parameters:
        theParentFrame - Parent frame.
        _fileInfo - File info object to get initialization info from.
        dicomInfo - Dicom file info object.
        isScriptRunning - Whether this dialog is being instantiated as part of the running of a script.
        isMultiFrame -
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Closes dialog box when the OK button is pressed and sets the information, doing error checking for every tag.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        event - Event that triggers this function.
      • autofillRequiredFields

        public void autofillRequiredFields()
        Autofill the dicom required tags to loosely fullfill the dicom standard.
      • checkTag

        private boolean checkTag​(java.lang.String value,
                                 java.lang.String type)
        Checks the text field data for the proper format. For example, UIDs must be strings of numbers and periods, person's names must be in the format Doe^John, etc.
        Parameters:
        value - The text we are checking.
        type - Types we can expect - UI, PN, LO, DA, TM, etc.
        Returns:
        Boolean confirming if the tag checked through or not.
      • createButton

        private javax.swing.JButton createButton​(java.lang.String title,
                                                 javax.swing.JButton button)
        Makes a button.
        Parameters:
        title - The value of the button.
        button - Button to create.
        Returns:
        The button.
      • createComboBox

        private javax.swing.JComboBox createComboBox​(java.awt.Container panel,
                                                     java.lang.String[] choices,
                                                     int x,
                                                     int y,
                                                     int w,
                                                     int h)
        Creates a combo box and adds it to the panel.
        Parameters:
        panel - the panel to add the combo box to
        choices - the layout to add the constraints to
        x - the constraints for this combo box
        y - DOCUMENT ME!
        w - DOCUMENT ME!
        h - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • createHashtable

        private void createHashtable()
        Creates static hashtable to use to fill the tags in the dialog.
      • createLabel

        private void createLabel​(java.lang.String title,
                                 java.awt.Container panel,
                                 int x,
                                 int y,
                                 int w,
                                 int h)
        Makes a label and adds it to the panel.
        Parameters:
        title - the value of the label
        panel - the panel to add the label to
        x - the layout to add the constraints to
        y - the constraints for this label
        w - DOCUMENT ME!
        h - DOCUMENT ME!
      • createPanel

        private javax.swing.JPanel createPanel()
        Makes a panel with a grid layout with the parameters specified.
        Returns:
        the panel created
      • createPatientPanel

        private void createPatientPanel()
        Creates the panel for the patient tab.
      • createRequiredPanel

        private void createRequiredPanel()
        Creates the panel of required tags.
      • createSeriesPanel

        private void createSeriesPanel()
        Creates the panel for the series tab.
      • createStudyPanel

        private void createStudyPanel()
        Creates the panel for the study tab.
      • fillDataFromFile

        private void fillDataFromFile()
        Asks for a text file of tags, then loads them into the text fields.
      • fillDataFromTable

        private void fillDataFromTable​(java.util.Hashtable<java.lang.String,​java.lang.String> table)
        Fill the values in the dialog from tag-value pairs in a hashtable.
        Parameters:
        table - the table of tag-value pairs
      • isDefaultCharacter

        private boolean isDefaultCharacter​(java.lang.String word,
                                           boolean control)
        Checks that all the characters of the string are in the default character repertoire.
        Parameters:
        word - Word to check.
        control - Indicates if control characters should be included or not.
        Returns:
        true if the string is in the default character repertoire.
      • resetSize

        private void resetSize​(javax.swing.JTextField field)
        Resizes the text field so that all characters are displayed.
        Parameters:
        field - Text field to change.
      • setChooserFromTag

        private void setChooserFromTag​(java.lang.String tag,
                                       java.lang.String value)
        Sets the value for one of the choosers based on a dicom tag and value.
        Parameters:
        tag - the tag (which determines which chooser to set)
        value - the value (which determines which index in the chooser is selected)
      • setGBC

        private void setGBC​(int x,
                            int y,
                            int w,
                            int h)
        A helper method for adding a component using GridBagLayout, so we don't have to set up the x, y, width, and height over and over again.
        Parameters:
        x - GridBagConstraints.gridx
        y - GridBagConstraints.gridy
        w - GridBagContraints.gridwidth
        h - GridBagConstraints.gridheight
        See Also:
        GridBagConstraints
      • setModalityChooser

        private void setModalityChooser​(int modality)
        Sets the modality chooser box based on the file info modality (the modality indexes should match up with the ordering of the chooser).
        Parameters:
        modality - The image modality.
      • setTextField

        private javax.swing.JTextField setTextField​(java.lang.String initial,
                                                    java.awt.Container panel,
                                                    int x,
                                                    int y,
                                                    int w,
                                                    int h)
        Makes a text field and adds it to the panel.
        Parameters:
        initial - the initial string in the text field
        panel - the panel to add the text field to
        x - the layout to add the constraints to
        y - the constraints for this text field
        w - DOCUMENT ME!
        h - DOCUMENT ME!
        Returns:
        the text field created