Package gov.nih.mipav.view.dialogs
Class JDialogDicomTagSelector
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- gov.nih.mipav.view.dialogs.JDialogBase
-
- gov.nih.mipav.view.dialogs.JDialogScriptableBase
-
- gov.nih.mipav.view.dialogs.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 gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ADD_TAG
For adding a top level dicom tagstatic java.lang.String
ADD_TAG_SEQ
For adding a dicom tag contained within a sequenceprotected javax.swing.JButton
addButton
Buttons used by this dialogprotected javax.swing.JButton
addButtonSeq
Buttons used by this dialogprivate java.awt.event.FocusListener
addListener
static java.lang.String
CLEAR_TAGS
For removing all tags from the main dialogprotected javax.swing.JButton
clearButton
Buttons used by this dialogstatic java.lang.String
CLOSE
Closes the dialogprotected javax.swing.JButton
closeButton
Buttons used by this dialogprivate javax.swing.JComboBox
elementCombo
Combo boxes used for sequence tagsprivate javax.swing.JComponent
elementFocus
private javax.swing.JList
elementList
Lists used to display available DICOM tagsprivate javax.swing.JTextField
elementSeqText
Text fields for displaying/entering a group/element tagprivate javax.swing.JTextField
elementText
Text fields for displaying/entering a group/element tagprivate 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 tagsprivate javax.swing.JList
groupList
Lists used to display available DICOM tagsprivate javax.swing.JTextField
groupSeqText
Text fields for displaying/entering a group/element tagprivate javax.swing.JTextField
groupText
Text fields for displaying/entering a group/element tagprivate 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 setprivate 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 setprotected 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 dictionaryprivate java.util.TreeMap<java.lang.String,java.lang.String>
keyToNameSeq
FileDicomTag to its name in the Dicom dictionaryprivate java.util.TreeMap<java.lang.String,java.lang.String>
keyToValue
FileDicomTag to its value in the fileprivate java.util.TreeMap<java.lang.String,java.lang.String>
keyToValueSeq
FileDicomTag to its value in the fileprivate javax.swing.JLabel
nameValue
Name and property labels that describe a DICOM tag for a particular fileprivate javax.swing.JLabel
nameValueSeq
Name and property labels that describe a DICOM tag for a particular fileprivate DicomTagSelectorImpl
parentDialog
The parent dialog which receives text from this dicom tag editorstatic java.lang.String
PRIVATE
Indicates tag is a private tagprivate 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 fileprivate javax.swing.JScrollPane
propPane
When a tag value exists, this panel displays the valueprivate 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 tagprivate javax.swing.JPanel
sequenceInformationPanel
Panels used by this dialog boxprivate javax.swing.JPanel
tablePanel
Panel contains JTable for storing dicom tags.private javax.swing.JPanel
tagInformationPanel
Panels used by this dialog boxprotected java.util.Hashtable<FileDicomKey,FileDicomTag>
tagList
Original list of available DICOM tagsprivate javax.swing.JPanel
tagSelectorPanel
Panels used by this dialog boxprotected 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 gov.nih.mipav.view.dialogs.JDialogScriptableBase
displayInNewFrame, isComplete, scriptParameters
-
Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JDialogDicomTagSelector()
Blank constructor needed for scriptingJDialogDicomTagSelector(JDialogBase parent, boolean isStandalone)
-
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 gov.nih.mipav.view.dialogs.JDialogScriptableBase
doPostAlgorithmActions, getDialogActionString, insertScriptLine, isComplete, scriptRun, setComplete
-
Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
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
-
-
-
-
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
-
CLOSE
public static final java.lang.String CLOSE
Closes the dialog- 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
-
tagList
protected java.util.Hashtable<FileDicomKey,FileDicomTag> tagList
Original list of available DICOM tags
-
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
-
k1
private JDialogDicomTagSelector.TagInputListener k1
-
k2
private JDialogDicomTagSelector.TagInputListener k2
-
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
-
setTagList
public void setTagList(java.util.Hashtable<FileDicomKey,FileDicomTag> tagList)
-
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 interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJDialogBase
-
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 interfacejavax.swing.event.ListSelectionListener
-
getTagListTextField
public javax.swing.JTextField getTagListTextField()
- Specified by:
getTagListTextField
in interfaceDicomTagSelectorImpl
-
getTagTable
public javax.swing.JTable getTagTable()
- Specified by:
getTagTable
in interfaceDicomTagSelectorImpl
-
getParentDialog
public DicomTagSelectorImpl getParentDialog()
-
setParentDialog
public void setParentDialog(DicomTagSelectorImpl parentDialog)
-
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 classJDialogScriptableBase
-
setGUIFromParams
protected void setGUIFromParams()
Description copied from class:JDialogScriptableBase
Set the dialog GUI using the script parameters while running this algorithm as part of a script.- Specified by:
setGUIFromParams
in classJDialogScriptableBase
-
storeParamsFromGUI
protected void storeParamsFromGUI() throws ParserException
Description copied from class:JDialogScriptableBase
Record the parameters just used to run this algorithm in a script.- Specified by:
storeParamsFromGUI
in classJDialogScriptableBase
- Throws:
ParserException
- If there is a problem creating/recording the new parameters.
-
-