Class ViewJFrameDICOMParser

All Implemented Interfaces:
PreviewImageContainer, ActionListener, ComponentListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, TreeExpansionListener, TreeSelectionListener, RootPaneContainer, WindowConstants

public class ViewJFrameDICOMParser extends ViewImageDirectory implements 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:
  • Field Details

    • serialVersionUID

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

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

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

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

      private int brightness
      DOCUMENT ME!
    • brightnessContrastPanel

      private JPanel brightnessContrastPanel
      DOCUMENT ME!
    • brightnessSlider

      private JSlider brightnessSlider
      DOCUMENT ME!
    • contrastSlider

      private JSlider contrastSlider
      DOCUMENT ME!
    • columnKeyTable

      private Hashtable columnKeyTable
      DOCUMENT ME!
    • componentImageDicom

      private ViewJComponentPreviewImage componentImageDicom
      DOCUMENT ME!
    • contrast

      private float contrast
      DOCUMENT ME!
    • current

      private JLabel current
      DOCUMENT ME!
    • current2

      private JLabel current2
      DOCUMENT ME!
    • fileInfoVector

      private 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 Vector<FileInfoDicom> imageTableVector
    • imageTable

      private JTable imageTable
      DOCUMENT ME!
    • imageTableModel

      private SortingTableModel imageTableModel
      DOCUMENT ME!
    • imageTableSorter

      private TableSorter imageTableSorter
      DOCUMENT ME!
    • nfc

      private NumberFormat nfc
      DOCUMENT ME!
    • origBrightness

      private int origBrightness
      DOCUMENT ME!
    • origContrast

      private float origContrast
      DOCUMENT ME!
    • rightPane

      private JSplitPane rightPane
      DOCUMENT ME!
    • seriesNumberCounters

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

      private JCheckBoxMenuItem seriesOptionBox
      DOCUMENT ME!
    • seriesTable

      private JTable seriesTable
      DOCUMENT ME!
    • seriesTableModel

      private SortingTableModel seriesTableModel
      DOCUMENT ME!
    • seriesTableSorter

      private TableSorter seriesTableSorter
      DOCUMENT ME!
    • studyTable

      private JTable studyTable
      DOCUMENT ME!
    • studyTableModel

      private SortingTableModel studyTableModel
      DOCUMENT ME!
    • studyTableSorter

      private TableSorter studyTableSorter
      DOCUMENT ME!
  • Constructor Details

    • ViewJFrameDICOMParser

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

    • isCompositeXYZPositionColumn

      public static boolean isCompositeXYZPositionColumn(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(ActionEvent event)
      Recreates the tree when a new directory is selected; refreshes the tree when refresh is selected.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class ViewImageDirectory
      Parameters:
      event - Event that triggered this function.
    • finalize

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

      public Vector<String> getColumnNames()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getComponentImageDicom

      public ViewJComponentPreviewImage getComponentImageDicom()
    • getFileInfoVector

      public Vector<FileInfoDicom> getFileInfoVector()
    • getImageTableVector

      public Vector<FileInfoDicom> getImageTableVector()
    • reloadRows

      public void reloadRows()
      reloadRows.
    • reloadRows

      public void reloadRows(String seriesNumber, 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(JTable rightTable)
      DOCUMENT ME!
      Parameters:
      rightTable - DOCUMENT ME!
    • stateChanged

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

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

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

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

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

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

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

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

      protected 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(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(MouseListener tableListener) throws NumberFormatException
      DOCUMENT ME!
      Parameters:
      tableListener - DOCUMENT ME!
      Throws:
      NumberFormatException - DOCUMENT ME!
    • initializeSeriesTable

      private void initializeSeriesTable(MouseListener tableListener)
      DOCUMENT ME!
      Parameters:
      tableListener - DOCUMENT ME!
    • initializeStudyTable

      private void initializeStudyTable(MouseListener tableListener)
      DOCUMENT ME!
      Parameters:
      tableListener - DOCUMENT ME!
    • parse

      private void parse(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(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.