Package gov.nih.mipav.view.dialogs
Class JDialogSaveDicom
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.JDialogSaveDicom
- All Implemented Interfaces:
DialogDefaultsInterface,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested 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 JButtonDOCUMENT ME!private intprivate final FileInfoDicomDOCUMENT ME!private final FileInfoBaseDOCUMENT ME!private JButtonDOCUMENT ME!private final GridBagConstraintsDOCUMENT ME!private booleanprivate final String[]DOCUMENT ME!private JComboBoxDOCUMENT ME!private final GridBagLayoutDOCUMENT ME!private final String[]DOCUMENT ME!private final String[]DOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JPanelDOCUMENT ME!private JComboBoxDOCUMENT ME!private final String[]DOCUMENT ME!private JPanelDOCUMENT ME!private static final longUse serialVersionUID for interoperability.private JComboBoxDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JComboBoxDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JPanelDOCUMENT ME!private JTextFieldDOCUMENT ME!private JComboBoxDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private final String[]DOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JPanelDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private JTextFieldDOCUMENT ME!private final JTabbedPaneDOCUMENT ME!DICOM tags extracted from the image we want to save.private Hashtable<String, JComponent> The additional tags list is a list of tags the DTI group has requested.private final ViewUserInterfaceDOCUMENT ME!Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManagerFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionJDialogSaveDicom(Frame theParentFrame, FileInfoBase _fileInfo, FileInfoDicom dicomInfo, boolean isScriptRunning, boolean isMultiFrame, int dataType) Creates dialog for setting tag information for DICOM image. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Closes dialog box when the OK button is pressed and sets the information, doing error checking for every tag.voidAutofill the dicom required tags to loosely fullfill the dicom standard.private booleanChecks the text field data for the proper format.private JButtoncreateButton(String title, JButton button) Makes a button.private JComboBoxcreateComboBox(Container panel, String[] choices, int x, int y, int w, int h) Creates a combo box and adds it to the panel.private voidCreates static hashtable to use to fill the tags in the dialog.private voidcreateLabel(String title, Container panel, int x, int y, int w, int h) Makes a label and adds it to the panel.private JPanelMakes a panel with a grid layout with the parameters specified.private voidCreates the panel for the patient tab.private voidCreates the panel of required tags.private voidCreates the panel for the series tab.private voidCreates the panel for the study tab.private voidAsks for a text file of tags, then loads them into the text fields.private voidfillDataFromTable(Hashtable<String, String> table) Fill the values in the dialog from tag-value pairs in a hashtable.private booleanisDefaultCharacter(String word, boolean control) Checks that all the characters of the string are in the default character repertoire.private voidresetSize(JTextField field) Resizes the text field so that all characters are displayed.private voidsetChooserFromTag(String tag, String value) Sets the value for one of the choosers based on a dicom tag and value.private voidsetGBC(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 voidsetModalityChooser(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 JTextFieldsetTextField(String initial, Container panel, int x, int y, int w, int h) Makes a text field and adds it to the panel.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, windowOpenedMethods 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, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, toFrontMethods 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, validateTreeMethods 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 Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
autofillButton
DOCUMENT ME! -
dicomFileInfo
DOCUMENT ME! -
fileInfo
DOCUMENT ME! -
fillButton
DOCUMENT ME! -
gbc
DOCUMENT ME! -
lateralities
DOCUMENT ME! -
laterality
DOCUMENT ME! -
layout
DOCUMENT ME! -
modalities
DOCUMENT ME! -
parts
DOCUMENT ME! -
patientBirthDate
DOCUMENT ME! -
patientBirthTime
DOCUMENT ME! -
patientComments
DOCUMENT ME! -
patientEthnicGroup
DOCUMENT ME! -
patientID
DOCUMENT ME! -
patientName
DOCUMENT ME! -
patientOrientation
DOCUMENT ME! -
patientOtherIDs
DOCUMENT ME! -
patientOtherNames
DOCUMENT ME! -
patientPanel
DOCUMENT ME! -
patientSex
DOCUMENT ME! -
positions
DOCUMENT ME! -
requiredPanel
DOCUMENT ME! -
seriesBody
DOCUMENT ME! -
seriesDate
DOCUMENT ME! -
seriesDescrip
DOCUMENT ME! -
seriesLarge
DOCUMENT ME! -
seriesMod
DOCUMENT ME! -
seriesNo
DOCUMENT ME! -
seriesOp
DOCUMENT ME! -
seriesPanel
DOCUMENT ME! -
seriesPerfPhy
DOCUMENT ME! -
seriesPos
DOCUMENT ME! -
seriesProtocol
DOCUMENT ME! -
seriesSmall
DOCUMENT ME! -
seriesStepDate
DOCUMENT ME! -
seriesStepDescrip
DOCUMENT ME! -
seriesStepID
DOCUMENT ME! -
seriesStepTime
DOCUMENT ME! -
seriesTime
DOCUMENT ME! -
seriesUID
DOCUMENT ME! -
sexes
DOCUMENT ME! -
studyAccNumber
DOCUMENT ME! -
studyAge
DOCUMENT ME! -
studyDate
DOCUMENT ME! -
studyDescrip
DOCUMENT ME! -
studyDiag
DOCUMENT ME! -
studyHist
DOCUMENT ME! -
studyID
DOCUMENT ME! -
studyOcc
DOCUMENT ME! -
studyPanel
DOCUMENT ME! -
studyPhyRead
DOCUMENT ME! -
studyPhyRec
DOCUMENT ME! -
studyRefPhy
DOCUMENT ME! -
studySize
DOCUMENT ME! -
studyTime
DOCUMENT ME! -
studyUID
DOCUMENT ME! -
studyWeight
DOCUMENT ME! -
tabPane
DOCUMENT ME! -
tagsImportedFromNonDicomImage
DICOM tags extracted from the image we want to save. Example: dicom_0xNNNN el_0xNNNN tags stored in MINC headers. -
tagsList
The additional tags list is a list of tags the DTI group has requested. -
additionalTagsList
-
UI
DOCUMENT ME! -
isMultiFrame
private boolean isMultiFrame -
dataType
private int dataType
-
-
Constructor Details
-
JDialogSaveDicom
public JDialogSaveDicom(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 Details
-
actionPerformed
Closes dialog box when the OK button is pressed and sets the information, doing error checking for every tag.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event- Event that triggers this function.
-
autofillRequiredFields
public void autofillRequiredFields()Autofill the dicom required tags to loosely fullfill the dicom standard. -
checkTag
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
Makes a button.- Parameters:
title- The value of the button.button- Button to create.- Returns:
- The button.
-
createComboBox
Creates a combo box and adds it to the panel.- Parameters:
panel- the panel to add the combo box tochoices- the layout to add the constraints tox- the constraints for this combo boxy- 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
Makes a label and adds it to the panel.- Parameters:
title- the value of the labelpanel- the panel to add the label tox- the layout to add the constraints toy- the constraints for this labelw- DOCUMENT ME!h- DOCUMENT ME!
-
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
Fill the values in the dialog from tag-value pairs in a hashtable.- Parameters:
table- the table of tag-value pairs
-
isDefaultCharacter
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:
trueif the string is in the default character repertoire.
-
resetSize
Resizes the text field so that all characters are displayed.- Parameters:
field- Text field to change.
-
setChooserFromTag
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.gridxy- GridBagConstraints.gridyw- GridBagContraints.gridwidthh- GridBagConstraints.gridheight- See Also:
-
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
Makes a text field and adds it to the panel.- Parameters:
initial- the initial string in the text fieldpanel- the panel to add the text field tox- the layout to add the constraints toy- the constraints for this text fieldw- DOCUMENT ME!h- DOCUMENT ME!- Returns:
- the text field created
-