Class JDialogDicomDir

  • All Implemented Interfaces:
    DialogDefaultsInterface, PreviewImageContainer, 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.ChangeListener, javax.swing.event.TreeSelectionListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class JDialogDicomDir
    extends JDialogBase
    implements java.awt.event.ActionListener, java.awt.event.ItemListener, javax.swing.event.TreeSelectionListener, javax.swing.event.ChangeListener, PreviewImageContainer
    Simple dialog used to show the contents of a selected DICOMDIR file. Allows the user to view previews of the image, related tags, along with opening the image.
    See Also:
    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
      JDialogDicomDir​(java.awt.Frame parent)
      Default constructor for DICOMDIR
      JDialogDicomDir​(java.awt.Frame parent, java.io.File file, FileDicom caller)  
    • 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 "Close" button is pressed.
      private void buildBrightContPanel()
      Initializes GUI components and displays dialog.
      protected FileInfoBase buildImage​(java.lang.String fileName, java.lang.String directory)
      Opens preview of image in frame
      private javax.swing.JSplitPane buildImagePanel()  
      private void createNodes()
      Creates nodes on the tree based on DICOMDIR
      java.awt.Dimension getPanelSize()
      The method returns the size of the panel into which the ViewJComponentPreviewImage will be drawing itself.
      private void init​(java.lang.String title)
      Initializes the dialog box to a certain size and adds the components.
      private void open()
      Open new DICOMDIR file, if successful then close current box
      private void openImage()  
      void stateChanged​(javax.swing.event.ChangeEvent e)
      Updates the image based on thumbnails
      void valueChanged​(javax.swing.event.TreeSelectionEvent e)
      Updates the table based on tree selection
      boolean wasSuccess()  
      • 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
      • Methods inherited from interface java.awt.event.ItemListener

        itemStateChanged
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • dpColumnNames

        public static final java.lang.String[] dpColumnNames
        Column names for data provenance
      • DEFAULT_SIZE

        protected final java.awt.Dimension DEFAULT_SIZE
        Describes the initial size of the textual display area when the dialog is created. The value is given in pixel size rather than the number of characters since the display area has no characters to display.
      • origBrightness

        private int origBrightness
        DOCUMENT ME!
      • origContrast

        private float origContrast
        DOCUMENT ME!
      • buttonPanel

        private javax.swing.JPanel buttonPanel
        DOCUMENT ME!
      • scrollPane

        private javax.swing.JScrollPane scrollPane
        DOCUMENT ME!
      • ifSuccess

        private boolean ifSuccess
      • imagePanel

        javax.swing.JPanel imagePanel
      • brightPanel

        private javax.swing.JPanel brightPanel
        DOCUMENT ME!
      • serif12

        protected java.awt.Font serif12
        DOCUMENT ME!
      • serif12B

        protected java.awt.Font serif12B
        DOCUMENT ME!
      • brightSlider

        private javax.swing.JSlider brightSlider
        DOCUMENT ME!
      • contSlider

        private javax.swing.JSlider contSlider
        DOCUMENT ME!
      • imageSliderPane

        private javax.swing.JSplitPane imageSliderPane
        DOCUMENT ME!
      • defaultImageSize

        private java.awt.Dimension defaultImageSize
        DOCUMENT ME!
      • current

        private javax.swing.JLabel current
        DOCUMENT ME!
      • current2

        private javax.swing.JLabel current2
        DOCUMENT ME!
      • sliderPanel

        private javax.swing.JPanel sliderPanel
        DOCUMENT ME!
      • nfc

        private java.text.NumberFormat nfc
        DOCUMENT ME!
      • contrast

        private float contrast
        DOCUMENT ME!
      • brightness

        private int brightness
        DOCUMENT ME!
      • base

        javax.swing.tree.DefaultMutableTreeNode base
      • file

        private java.io.File file
    • Constructor Detail

      • JDialogDicomDir

        public JDialogDicomDir​(java.awt.Frame parent)
        Default constructor for DICOMDIR
      • JDialogDicomDir

        public JDialogDicomDir​(java.awt.Frame parent,
                               java.io.File file,
                               FileDicom caller)
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Closes dialog box when the "Close" button is pressed. Opens either a new file or selected images based on button.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        event - Event that triggers this function.
      • openImage

        private void openImage()
      • init

        private void init​(java.lang.String title)
        Initializes the dialog box to a certain size and adds the components.
        Parameters:
        title - Title of the dialog box.
      • createNodes

        private void createNodes()
        Creates nodes on the tree based on DICOMDIR
      • open

        private void open()
        Open new DICOMDIR file, if successful then close current box
      • buildImage

        protected FileInfoBase buildImage​(java.lang.String fileName,
                                          java.lang.String directory)
        Opens preview of image in frame
      • buildBrightContPanel

        private void buildBrightContPanel()
        Initializes GUI components and displays dialog.

        For the brightSlider the slider values and the brightness values are identical. brightness is an offset going from -255 to 255. This is enough to change all 0 values to 255 and all 255 values to 0. brightness is added to all contrast scaled red, green, and blue.

        However, for the contrastSlider the slider values are different from the contrast values. The contrast values go from 0.1 to 10.0 while the slider values go from -200 to 200. contrast = (float)Math.pow(10.0,contSlider.getValue()/200.0) The original red, green, and blue are mutliplied by contrast.

      • valueChanged

        public void valueChanged​(javax.swing.event.TreeSelectionEvent e)
        Updates the table based on tree selection
        Specified by:
        valueChanged in interface javax.swing.event.TreeSelectionListener
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        Updates the image based on thumbnails
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
      • getPanelSize

        public java.awt.Dimension getPanelSize()
        Description copied from interface: PreviewImageContainer
        The method returns the size of the panel into which the ViewJComponentPreviewImage will be drawing itself. It needs the Dimension so that it knows how large to scale.
        Specified by:
        getPanelSize in interface PreviewImageContainer
        Returns:
        Dimension
      • buildImagePanel

        private javax.swing.JSplitPane buildImagePanel()
      • wasSuccess

        public boolean wasSuccess()