Class ViewJFrameDICOMParser

  • All Implemented Interfaces:
    PreviewImageContainer, java.awt.event.ActionListener, java.awt.event.ComponentListener, 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.TreeExpansionListener, javax.swing.event.TreeSelectionListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class ViewJFrameDICOMParser
    extends ViewImageDirectory
    implements java.awt.event.WindowListener
    DICOM parser - shows pertinent DICOM tags, allows user to sort on specific values in the tags and open the proper images. Can also open the images to an AVI file. Can see image as thumbnail. Extends ViewImageDirectory for the tree and thumbnail.
    Author:
    Neva Cherniavsky
    See Also:
    FileInfoDicom, Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  ViewJFrameDICOMParser.TableListener
      Table listener - listens for clicks on any of the three table headers or clicks within each table.
      • Nested classes/interfaces inherited from class javax.swing.JFrame

        javax.swing.JFrame.AccessibleJFrame
      • Nested classes/interfaces inherited from class java.awt.Frame

        java.awt.Frame.AccessibleAWTFrame
      • 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
      ViewJFrameDICOMParser​(java.lang.String dir)
      Creates new frame.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Recreates the tree when a new directory is selected; refreshes the tree when refresh is selected.
      private void addSeriesData​(java.lang.String studyNo)
      AddSeriesData This method populates the series table based upon the studyID.
      private void addStudyData​(FileInfoDicom fileInfo)
      Adds the study data to the table.
      private void buildBrightnessContrastPanel()
      Initializes GUI components and displays dialog.
      private void buildMenu()
      Builds the jmenubar and adds two options.. disregard series #s and exit/close
      protected javax.swing.JPanel buildToolbar()
      Builds a toolbar with the same functionality as the menu.
      private void close()
      DOCUMENT ME!
      void finalize()
      Cleans memory.
      java.util.Vector<java.lang.String> getColumnNames()
      DOCUMENT ME!
      ViewJComponentPreviewImage getComponentImageDicom()  
      java.util.Vector<FileInfoDicom> getFileInfoVector()  
      java.util.Vector<FileInfoDicom> getImageTableVector()  
      protected void init()
      Initializes scroll panes, tables, and models and adds them to the frame.
      private void initializeImageTable​(java.awt.event.MouseListener tableListener)
      DOCUMENT ME!
      private void initializeSeriesTable​(java.awt.event.MouseListener tableListener)
      DOCUMENT ME!
      private void initializeStudyTable​(java.awt.event.MouseListener tableListener)
      DOCUMENT ME!
      static boolean isCompositeXYZPositionColumn​(java.lang.String columnName)
      The purpose of this method is to determine whether the parameter represents one of the special table columns.
      private void parse​(java.io.File file)
      Parses the files in the directory.
      void reloadRows()
      reloadRows.
      void reloadRows​(java.lang.String seriesNumber, java.lang.String studyNo)
      The purpose of this method is to re-parse the DICOM files to refresh the table data.
      private void restorePreferredColumnConfiguration()
      DOCUMENT ME!
      private boolean seriesNumberEqual​(java.lang.String seriesNumber, FileInfoDicom fileInfoDICOM)
      DOCUMENT ME!
      void setHeaderConfiguration​(javax.swing.JTable rightTable)
      DOCUMENT ME!
      private void setSeriesTableMinMax()
      Sets the series table's min and max column widths.
      private void setStudyTableMinMax()
      Sets the study table's min and max column widths.
      void stateChanged​(javax.swing.event.ChangeEvent e)
      Sets values based on knob along slider.
      void windowActivated​(java.awt.event.WindowEvent event)
      windowActivated - unchanged.
      void windowClosed​(java.awt.event.WindowEvent event)
      windowClosed - unchanged.
      void windowClosing​(java.awt.event.WindowEvent event)
      windowClosing - calls close.
      void windowDeactivated​(java.awt.event.WindowEvent event)
      windowDeactivated - unchanged.
      void windowDeiconified​(java.awt.event.WindowEvent event)
      windowDeiconified - unchanged.
      void windowIconified​(java.awt.event.WindowEvent event)
      windowIconified - unchanged.
      void windowOpened​(java.awt.event.WindowEvent event)
      windowOpened - unchanged.
      • Methods inherited from class javax.swing.JFrame

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

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • 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, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, 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, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Field Detail

      • serialVersionUID

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

        public static final java.lang.String[] DEFAULT_COLUMN_HEADERS_IMAGE_TABLE
        DOCUMENT ME!
      • DEFAULT_COLUMN_HEADERS_STUDY_TABLE

        public static final java.lang.String[] DEFAULT_COLUMN_HEADERS_STUDY_TABLE
        DOCUMENT ME!
      • DEFAULT_COLUMN_HEADERS_SERIES_TABLE

        public static final java.lang.String[] DEFAULT_COLUMN_HEADERS_SERIES_TABLE
        DOCUMENT ME!
      • brightness

        private int brightness
        DOCUMENT ME!
      • brightnessContrastPanel

        private javax.swing.JPanel brightnessContrastPanel
        DOCUMENT ME!
      • brightnessSlider

        private javax.swing.JSlider brightnessSlider
        DOCUMENT ME!
      • contrastSlider

        private javax.swing.JSlider contrastSlider
        DOCUMENT ME!
      • columnKeyTable

        private java.util.Hashtable columnKeyTable
        DOCUMENT ME!
      • contrast

        private float contrast
        DOCUMENT ME!
      • current

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

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

        private java.util.Vector<FileInfoDicom> fileInfoVector
        fileInfoVector represents images in image table but imageTableVector was needed also becasue this handles multiple series in the same dir. fileInfoVector is all the images in the dir but imageTableVector represents all the images that are in the image table at a particular instance or series
      • imageTableVector

        private java.util.Vector<FileInfoDicom> imageTableVector
      • imageTable

        private javax.swing.JTable imageTable
        DOCUMENT ME!
      • imageTableSorter

        private TableSorter imageTableSorter
        DOCUMENT ME!
      • nfc

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

        private int origBrightness
        DOCUMENT ME!
      • origContrast

        private float origContrast
        DOCUMENT ME!
      • rightPane

        private javax.swing.JSplitPane rightPane
        DOCUMENT ME!
      • seriesNumberCounters

        private java.util.HashMap<java.lang.String,​java.lang.Integer> seriesNumberCounters
        This is a hashmasp of series numbers and corresponding counter for the number of images in each series.*
      • seriesOptionBox

        private javax.swing.JCheckBoxMenuItem seriesOptionBox
        DOCUMENT ME!
      • seriesTable

        private javax.swing.JTable seriesTable
        DOCUMENT ME!
      • seriesTableSorter

        private TableSorter seriesTableSorter
        DOCUMENT ME!
      • studyTable

        private javax.swing.JTable studyTable
        DOCUMENT ME!
      • studyTableSorter

        private TableSorter studyTableSorter
        DOCUMENT ME!
    • Constructor Detail

      • ViewJFrameDICOMParser

        public ViewJFrameDICOMParser​(java.lang.String dir)
        Creates new frame. Tables contain no data but the tree is initialized to the appropriate directory.
        Parameters:
        dir - Directory.
    • Method Detail

      • isCompositeXYZPositionColumn

        public static boolean isCompositeXYZPositionColumn​(java.lang.String columnName)
        The purpose of this method is to determine whether the parameter represents one of the special table columns. In this case, X-position, Y-position, and Z-position are special columns because they are not standard DICOM tags. They are parsed out from the Patient Orientation tag and populated manually.
        Parameters:
        columnName - String
        Returns:
        boolean
      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Recreates the tree when a new directory is selected; refreshes the tree when refresh is selected.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class ViewImageDirectory
        Parameters:
        event - Event that triggered this function.
      • finalize

        public void finalize()
        Cleans memory.
        Overrides:
        finalize in class java.lang.Object
      • getColumnNames

        public java.util.Vector<java.lang.String> getColumnNames()
        DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • getFileInfoVector

        public java.util.Vector<FileInfoDicom> getFileInfoVector()
      • getImageTableVector

        public java.util.Vector<FileInfoDicom> getImageTableVector()
      • reloadRows

        public void reloadRows()
        reloadRows.
      • reloadRows

        public void reloadRows​(java.lang.String seriesNumber,
                               java.lang.String studyNo)
        The purpose of this method is to re-parse the DICOM files to refresh the table data. It is called after the user hits "apply" in the configuration dialog, or the user clicks "parse" in the toolbar.
        Parameters:
        seriesNumber - DOCUMENT ME!
        studyNo - DOCUMENT ME!
      • setHeaderConfiguration

        public void setHeaderConfiguration​(javax.swing.JTable rightTable)
        DOCUMENT ME!
        Parameters:
        rightTable - DOCUMENT ME!
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        Sets values based on knob along slider.
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Overrides:
        stateChanged in class ViewImageDirectory
        Parameters:
        e - Event that triggered this function
      • windowActivated

        public void windowActivated​(java.awt.event.WindowEvent event)
        windowActivated - unchanged.
        Specified by:
        windowActivated in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowClosed

        public void windowClosed​(java.awt.event.WindowEvent event)
        windowClosed - unchanged.
        Specified by:
        windowClosed in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowClosing

        public void windowClosing​(java.awt.event.WindowEvent event)
        windowClosing - calls close.
        Specified by:
        windowClosing in interface java.awt.event.WindowListener
        Parameters:
        event - event that triggered function
      • windowDeactivated

        public void windowDeactivated​(java.awt.event.WindowEvent event)
        windowDeactivated - unchanged.
        Specified by:
        windowDeactivated in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowDeiconified

        public void windowDeiconified​(java.awt.event.WindowEvent event)
        windowDeiconified - unchanged.
        Specified by:
        windowDeiconified in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowIconified

        public void windowIconified​(java.awt.event.WindowEvent event)
        windowIconified - unchanged.
        Specified by:
        windowIconified in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • windowOpened

        public void windowOpened​(java.awt.event.WindowEvent event)
        windowOpened - unchanged.
        Specified by:
        windowOpened in interface java.awt.event.WindowListener
        Parameters:
        event - DOCUMENT ME!
      • buildToolbar

        protected javax.swing.JPanel buildToolbar()
        Builds a toolbar with the same functionality as the menu.
        Overrides:
        buildToolbar in class ViewImageDirectory
        Returns:
        DOCUMENT ME!
      • init

        protected void init()
        Initializes scroll panes, tables, and models and adds them to the frame.
        Overrides:
        init in class ViewImageDirectory
      • addSeriesData

        private void addSeriesData​(java.lang.String studyNo)
        AddSeriesData This method populates the series table based upon the studyID.
        Parameters:
        studyNo - DOCUMENT ME!
      • addStudyData

        private void addStudyData​(FileInfoDicom fileInfo)
        Adds the study data to the table.
        Parameters:
        fileInfo - File info structure where data is stored.
      • buildBrightnessContrastPanel

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

        For the brightnessSlider 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,contrastSlider.getValue()/200.0) The original red, green, and blue are mutliplied by contrast.

      • buildMenu

        private void buildMenu()
        Builds the jmenubar and adds two options.. disregard series #s and exit/close
      • close

        private void close()
        DOCUMENT ME!
      • initializeImageTable

        private void initializeImageTable​(java.awt.event.MouseListener tableListener)
                                   throws java.lang.NumberFormatException
        DOCUMENT ME!
        Parameters:
        tableListener - DOCUMENT ME!
        Throws:
        java.lang.NumberFormatException - DOCUMENT ME!
      • initializeSeriesTable

        private void initializeSeriesTable​(java.awt.event.MouseListener tableListener)
        DOCUMENT ME!
        Parameters:
        tableListener - DOCUMENT ME!
      • initializeStudyTable

        private void initializeStudyTable​(java.awt.event.MouseListener tableListener)
        DOCUMENT ME!
        Parameters:
        tableListener - DOCUMENT ME!
      • parse

        private void parse​(java.io.File file)
        Parses the files in the directory. Looks for DICOM files within several subdirectories of the file. Populates the FileInfoVector
        Parameters:
        file - File to start parse at.
      • restorePreferredColumnConfiguration

        private void restorePreferredColumnConfiguration()
        DOCUMENT ME!
      • seriesNumberEqual

        private boolean seriesNumberEqual​(java.lang.String seriesNumber,
                                          FileInfoDicom fileInfoDICOM)
        DOCUMENT ME!
        Parameters:
        seriesNumber - DOCUMENT ME!
        fileInfoDICOM - DOCUMENT ME!
        Returns:
        DOCUMENT ME!
      • setSeriesTableMinMax

        private void setSeriesTableMinMax()
        Sets the series table's min and max column widths.
      • setStudyTableMinMax

        private void setStudyTableMinMax()
        Sets the study table's min and max column widths.