Class JDialogDicomTagSelector

  • All Implemented Interfaces:
    ScriptableActionInterface, DialogDefaultsInterface, DicomTagSelectorImpl, 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.event.ListSelectionListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    Direct Known Subclasses:
    JDialogDicomTagMultiEditor

    public class JDialogDicomTagSelector
    extends JDialogScriptableBase
    implements javax.swing.event.ListSelectionListener, DicomTagSelectorImpl
    This class allows for DICOM tags to be selected. Selected DICOM tags can either come from the overall DICOM dictionary or from the tags that exist in a given image.
    Author:
    senseneyj
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  JDialogDicomTagSelector.DicomTableModel  
      private class  JDialogDicomTagSelector.NumberComparator  
      private class  JDialogDicomTagSelector.TagInputListener  
      • 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ADD_TAG
      For adding a top level dicom tag
      static java.lang.String ADD_TAG_SEQ
      For adding a dicom tag contained within a sequence
      protected javax.swing.JButton addButton
      Buttons used by this dialog
      protected javax.swing.JButton addButtonSeq
      Buttons used by this dialog
      private java.awt.event.FocusListener addListener  
      static java.lang.String CLEAR_TAGS
      For removing all tags from the main dialog
      protected javax.swing.JButton clearButton
      Buttons used by this dialog
      static java.lang.String CLOSE
      Closes the dialog
      protected javax.swing.JButton closeButton
      Buttons used by this dialog
      private javax.swing.JComboBox elementCombo
      Combo boxes used for sequence tags
      private javax.swing.JComponent elementFocus  
      private javax.swing.JList elementList
      Lists used to display available DICOM tags
      private javax.swing.JTextField elementSeqText
      Text fields for displaying/entering a group/element tag
      private javax.swing.JTextField elementText
      Text fields for displaying/entering a group/element tag
      private javax.swing.JPanel embeddedPanel
      When this object exists as an embedded panel, this variable contains all necessary data elements.
      private javax.swing.JComboBox groupCombo
      Combo boxes used for sequence tags
      private javax.swing.JList groupList
      Lists used to display available DICOM tags
      private javax.swing.JTextField groupSeqText
      Text fields for displaying/entering a group/element tag
      private javax.swing.JTextField groupText
      Text fields for displaying/entering a group/element tag
      private java.util.TreeMap<java.lang.String,​java.util.ArrayList<java.lang.String>> groupToElement
      List of all file's elements for each group of a FileDicomKey set
      private java.util.TreeMap<java.lang.String,​java.util.ArrayList<java.lang.String>> groupToElementSeq
      List of all file's elements for each group of a FileDicomKey set
      protected boolean isStandalone  
      private JDialogDicomTagSelector.TagInputListener k1  
      private JDialogDicomTagSelector.TagInputListener k2  
      private java.util.TreeMap<java.lang.String,​java.lang.String> keyToName
      FileDicomTag to its name in the Dicom dictionary
      private java.util.TreeMap<java.lang.String,​java.lang.String> keyToNameSeq
      FileDicomTag to its name in the Dicom dictionary
      private java.util.TreeMap<java.lang.String,​java.lang.String> keyToValue
      FileDicomTag to its value in the file
      private java.util.TreeMap<java.lang.String,​java.lang.String> keyToValueSeq
      FileDicomTag to its value in the file
      private javax.swing.JLabel nameValue
      Name and property labels that describe a DICOM tag for a particular file
      private javax.swing.JLabel nameValueSeq
      Name and property labels that describe a DICOM tag for a particular file
      private DicomTagSelectorImpl parentDialog
      The parent dialog which receives text from this dicom tag editor
      static java.lang.String PRIVATE
      Indicates tag is a private tag
      private javax.swing.JLabel propertyLabel
      When a tag value exists, this label displays the text "Tag value:"
      private javax.swing.JTextField propertyValue  
      private javax.swing.JLabel propertyValueSeq
      Name and property labels that describe a DICOM tag for a particular file
      private javax.swing.JScrollPane propPane
      When a tag value exists, this panel displays the value
      private java.awt.Dimension SCROLL_PANE_SIZE
      Min/max size of all text boxes contained in scroll panes.
      static java.lang.String SEQUENCE
      Indicates tag value is a sequence tag
      private javax.swing.JPanel sequenceInformationPanel
      Panels used by this dialog box
      private javax.swing.JPanel tablePanel
      Panel contains JTable for storing dicom tags.
      private javax.swing.JPanel tagInformationPanel
      Panels used by this dialog box
      protected java.util.Hashtable<FileDicomKey,​FileDicomTag> tagList
      Original list of available DICOM tags
      private javax.swing.JPanel tagSelectorPanel
      Panels used by this dialog box
      protected javax.swing.JTable tagsTable
      Option table where dicom tags are reported to.
      static java.lang.String UNKNOWN
      Indicates tag value may exist but cannot be understood by the dialog.
      • Fields inherited from class javax.swing.JDialog

        accessibleContext, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Dialog

        DEFAULT_MODALITY_TYPE
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent e)  
      private void buildGroupElementMap​(java.util.Hashtable<FileDicomKey,​FileDicomTag> tagHash)  
      private void buildSeqGroupElementMap​(java.util.Hashtable<FileDicomKey,​FileDicomTag> tagHash)  
      private javax.swing.JPanel buildSequenceInfoPanel()  
      private javax.swing.JPanel buildTablePanel()  
      private javax.swing.JPanel buildTagInfoPanel()  
      private javax.swing.JPanel buildTagSelectorPanel()  
      protected void callAlgorithm()
      Starts the algorithm.
      javax.swing.JPanel getEmbeddedPanel()  
      DicomTagSelectorImpl getParentDialog()  
      javax.swing.JTextField getTagListTextField()  
      javax.swing.JTable getTagTable()  
      void init​(boolean isStandalone)
      Builds the panel that the tag dialog frame contains, and optionally builds the standalone frame that encompasses all functionality of this class.
      protected void setGUIFromParams()
      Set the dialog GUI using the script parameters while running this algorithm as part of a script.
      void setParentDialog​(DicomTagSelectorImpl parentDialog)  
      void setTagList​(java.util.Hashtable<FileDicomKey,​FileDicomTag> tagList)  
      protected void storeParamsFromGUI()
      Record the parameters just used to run this algorithm in a script.
      private boolean tagExistsInField​(java.lang.String text)  
      void valueChanged​(javax.swing.event.ListSelectionEvent e)  
      • 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

      • ADD_TAG

        public static final java.lang.String ADD_TAG
        For adding a top level dicom tag
        See Also:
        Constant Field Values
      • ADD_TAG_SEQ

        public static final java.lang.String ADD_TAG_SEQ
        For adding a dicom tag contained within a sequence
        See Also:
        Constant Field Values
      • CLEAR_TAGS

        public static final java.lang.String CLEAR_TAGS
        For removing all tags from the main dialog
        See Also:
        Constant Field Values
      • UNKNOWN

        public static final java.lang.String UNKNOWN
        Indicates tag value may exist but cannot be understood by the dialog.
        See Also:
        Constant Field Values
      • SEQUENCE

        public static final java.lang.String SEQUENCE
        Indicates tag value is a sequence tag
        See Also:
        Constant Field Values
      • PRIVATE

        public static final java.lang.String PRIVATE
        Indicates tag is a private tag
        See Also:
        Constant Field Values
      • SCROLL_PANE_SIZE

        private final java.awt.Dimension SCROLL_PANE_SIZE
        Min/max size of all text boxes contained in scroll panes.
      • groupToElement

        private java.util.TreeMap<java.lang.String,​java.util.ArrayList<java.lang.String>> groupToElement
        List of all file's elements for each group of a FileDicomKey set
      • groupToElementSeq

        private java.util.TreeMap<java.lang.String,​java.util.ArrayList<java.lang.String>> groupToElementSeq
        List of all file's elements for each group of a FileDicomKey set
      • keyToName

        private java.util.TreeMap<java.lang.String,​java.lang.String> keyToName
        FileDicomTag to its name in the Dicom dictionary
      • keyToNameSeq

        private java.util.TreeMap<java.lang.String,​java.lang.String> keyToNameSeq
        FileDicomTag to its name in the Dicom dictionary
      • keyToValue

        private java.util.TreeMap<java.lang.String,​java.lang.String> keyToValue
        FileDicomTag to its value in the file
      • keyToValueSeq

        private java.util.TreeMap<java.lang.String,​java.lang.String> keyToValueSeq
        FileDicomTag to its value in the file
      • tagSelectorPanel

        private javax.swing.JPanel tagSelectorPanel
        Panels used by this dialog box
      • tagInformationPanel

        private javax.swing.JPanel tagInformationPanel
        Panels used by this dialog box
      • sequenceInformationPanel

        private javax.swing.JPanel sequenceInformationPanel
        Panels used by this dialog box
      • groupList

        private javax.swing.JList groupList
        Lists used to display available DICOM tags
      • elementList

        private javax.swing.JList elementList
        Lists used to display available DICOM tags
      • groupCombo

        private javax.swing.JComboBox groupCombo
        Combo boxes used for sequence tags
      • elementCombo

        private javax.swing.JComboBox elementCombo
        Combo boxes used for sequence tags
      • addButton

        protected javax.swing.JButton addButton
        Buttons used by this dialog
      • addButtonSeq

        protected javax.swing.JButton addButtonSeq
        Buttons used by this dialog
      • clearButton

        protected javax.swing.JButton clearButton
        Buttons used by this dialog
      • closeButton

        protected javax.swing.JButton closeButton
        Buttons used by this dialog
      • nameValue

        private javax.swing.JLabel nameValue
        Name and property labels that describe a DICOM tag for a particular file
      • nameValueSeq

        private javax.swing.JLabel nameValueSeq
        Name and property labels that describe a DICOM tag for a particular file
      • propertyValueSeq

        private javax.swing.JLabel propertyValueSeq
        Name and property labels that describe a DICOM tag for a particular file
      • propertyValue

        private javax.swing.JTextField propertyValue
      • parentDialog

        private DicomTagSelectorImpl parentDialog
        The parent dialog which receives text from this dicom tag editor
      • embeddedPanel

        private javax.swing.JPanel embeddedPanel
        When this object exists as an embedded panel, this variable contains all necessary data elements.
      • tablePanel

        private javax.swing.JPanel tablePanel
        Panel contains JTable for storing dicom tags.
      • propertyLabel

        private javax.swing.JLabel propertyLabel
        When a tag value exists, this label displays the text "Tag value:"
      • propPane

        private javax.swing.JScrollPane propPane
        When a tag value exists, this panel displays the value
      • elementSeqText

        private javax.swing.JTextField elementSeqText
        Text fields for displaying/entering a group/element tag
      • groupSeqText

        private javax.swing.JTextField groupSeqText
        Text fields for displaying/entering a group/element tag
      • elementText

        private javax.swing.JTextField elementText
        Text fields for displaying/entering a group/element tag
      • groupText

        private javax.swing.JTextField groupText
        Text fields for displaying/entering a group/element tag
      • tagsTable

        protected javax.swing.JTable tagsTable
        Option table where dicom tags are reported to.
      • isStandalone

        protected boolean isStandalone
      • addListener

        private java.awt.event.FocusListener addListener
      • elementFocus

        private javax.swing.JComponent elementFocus
    • Constructor Detail

      • JDialogDicomTagSelector

        public JDialogDicomTagSelector()
        Blank constructor needed for scripting
      • JDialogDicomTagSelector

        public JDialogDicomTagSelector​(JDialogBase parent,
                                       boolean isStandalone)
    • Method Detail

      • init

        public void init​(boolean isStandalone)
        Builds the panel that the tag dialog frame contains, and optionally builds the standalone frame that encompasses all functionality of this class.
        Parameters:
        isStandalone -
      • buildTablePanel

        private javax.swing.JPanel buildTablePanel()
      • buildTagSelectorPanel

        private javax.swing.JPanel buildTagSelectorPanel()
      • buildTagInfoPanel

        private javax.swing.JPanel buildTagInfoPanel()
      • buildSequenceInfoPanel

        private javax.swing.JPanel buildSequenceInfoPanel()
      • buildGroupElementMap

        private void buildGroupElementMap​(java.util.Hashtable<FileDicomKey,​FileDicomTag> tagHash)
      • buildSeqGroupElementMap

        private void buildSeqGroupElementMap​(java.util.Hashtable<FileDicomKey,​FileDicomTag> tagHash)
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
      • getEmbeddedPanel

        public javax.swing.JPanel getEmbeddedPanel()
        Returns:
        the embeddedPanel
      • tagExistsInField

        private boolean tagExistsInField​(java.lang.String text)
      • valueChanged

        public void valueChanged​(javax.swing.event.ListSelectionEvent e)
        Specified by:
        valueChanged in interface javax.swing.event.ListSelectionListener
      • callAlgorithm

        protected void callAlgorithm()
        Description copied from class: JDialogScriptableBase
        Starts the algorithm. Already exists in most algorithm dialogs. Should be called during scripted execution and regular operation.
        Specified by:
        callAlgorithm in class JDialogScriptableBase