Class ViewOpenImageSequence

All Implemented Interfaces:
PreviewImageContainer, ActionListener, KeyListener, MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class ViewOpenImageSequence extends JFrame implements ActionListener, PreviewImageContainer, MouseListener, KeyListener, ChangeListener
The purpose of this class is to present the user with a window enabling him/her to open a sequence of TIFF files based on timepoint-channel-slice ordering. This is useful for opening a dataset captured by a machine where the order of the files on disk may not necessarily be the correct sequence from the machine. Also shows a preview of each image.
See Also:
  • Field Details

  • Constructor Details

    • ViewOpenImageSequence

      public ViewOpenImageSequence()
      Creates a new ViewOpenImageSequence object.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      DOCUMENT ME!
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - DOCUMENT ME!
    • getPanelSize

      public Dimension getPanelSize()
      Method is required by PreviewImageContainer interface to draw a preview image.
      Specified by:
      getPanelSize in interface PreviewImageContainer
      Returns:
      Dimension - indicating the size of the preview image area.
    • keyPressed

      public void keyPressed(KeyEvent event)
      DOCUMENT ME!
      Specified by:
      keyPressed in interface KeyListener
      Parameters:
      event - DOCUMENT ME!
    • keyReleased

      public void keyReleased(KeyEvent event)
      DOCUMENT ME!
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      event - DOCUMENT ME!
    • keyTyped

      public void keyTyped(KeyEvent event)
      DOCUMENT ME!
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      event - DOCUMENT ME!
    • mouseClicked

      public void mouseClicked(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      event - DOCUMENT ME!
    • mouseEntered

      public void mouseEntered(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      event - DOCUMENT ME!
    • mouseExited

      public void mouseExited(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      event - DOCUMENT ME!
    • mousePressed

      public void mousePressed(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      event - DOCUMENT ME!
    • mouseReleased

      public void mouseReleased(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      event - DOCUMENT ME!
    • newChannelMap

      public void newChannelMap(int[] channelMap)
      DOCUMENT ME!
      Parameters:
      channelMap - DOCUMENT ME!
    • stateChanged

      public void stateChanged(ChangeEvent event)
      DOCUMENT ME!
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      event - DOCUMENT ME!
    • arrangeCTZ

      protected void arrangeCTZ(int numSlices, int numChannels, int numTimePoints)
      Arrange the table in CTZ order.
      Parameters:
      numSlices - int - the number of slices the data represents
      numChannels - int - the number of channels the data represents
      numTimePoints - int - the number of time points the data represents
    • arrangeCZT

      protected void arrangeCZT(int numSlices, int numChannels, int numTimePoints)
      Arrange the table in CZT order.
      Parameters:
      numSlices - int - the number of slices the data represents
      numChannels - int - the number of channels the data represents
      numTimePoints - int - the number of time points the data represents
    • arrangeTCZ

      protected void arrangeTCZ(int numSlices, int numChannels, int numTimePoints)
      Arrange the table in TCZ order.
      Parameters:
      numSlices - int - the number of slices the data represents
      numChannels - int - the number of channels the data represents
      numTimePoints - int - the number of time points the data represents
    • arrangeTZC

      protected void arrangeTZC(int numSlices, int numChannels, int numTimePoints)
      Arrange the table in TZC order.
      Parameters:
      numSlices - int - the number of slices the data represents
      numChannels - int - the number of channels the data represents
      numTimePoints - int - the number of time points the data represents
    • arrangeZCT

      protected void arrangeZCT(int numSlices, int numChannels, int numTimePoints)
      Arrange the table in ZCT order.
      Parameters:
      numSlices - int - the number of slices the data represents
      numChannels - int - the number of channels the data represents
      numTimePoints - int - the number of time points the data represents
    • arrangeZTC

      protected void arrangeZTC(int numSlices, int numChannels, int numTimePoints)
      Arrange the table in ZTC order.
      Parameters:
      numSlices - int - the number of slices the data represents
      numChannels - int - the number of channels the data represents
      numTimePoints - int - the number of time points the data represents
    • buildBrightnessContrastPanel

      protected JPanel buildBrightnessContrastPanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • buildCenterPanel

      protected JPanel buildCenterPanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • buildDimensionsPanel

      protected JPanel buildDimensionsPanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • buildLeftSubPanel

      protected JPanel buildLeftSubPanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • buildOKCancelPanel

      protected JPanel buildOKCancelPanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • buildSequencesPanel

      protected JPanel buildSequencesPanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • buildSubsamplePanel

      protected JPanel buildSubsamplePanel()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • buildUserInterface

      protected void buildUserInterface()
      DOCUMENT ME!
    • dimensionsSanityCheck

      protected boolean dimensionsSanityCheck()
      Method checks the dimensions parameters entered by the user. Returns true if valid, false otherwise.
      Returns:
      boolean - if the dimension parameters are valid
    • filterFileExtension

      protected Vector<String> filterFileExtension(Vector<String> rawFileList, File selectedFile)
      Method filters out the rawFileList based of the file extension of the parameter selectedFile. This ensures that the resulting Vector contains files only of the same extensions as selectedFile.
      Parameters:
      rawFileList - Vector - a Vector of File objects
      selectedFile - File - the file whose extension will be used as a filter for rawFileList
      Returns:
      Vector - a new Vector containing the filtered list of String objects representing filenames
    • formatTable

      protected void formatTable(int selectedSequence)
      Ensures the table is drawn in the way specified by the dimensions parameters and the selected sequence.
      Parameters:
      selectedSequence - int - the Z-T-C ordering as selected by the user
    • getFileList

      protected File[] getFileList()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getLastOpenSequencePath

      protected File getLastOpenSequencePath()
      Reads the preferences file to determine the path that was last used in opening a file sequence.
      Returns:
      File - the File object representing the directory last used in opening a file sequence.
    • getSelectedSequence

      protected int getSelectedSequence()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • openImage

      protected void openImage(int numChannels, int numSlices, int numTimePoints, Dimension subsampleDimension)
      Will read a series of images and put them into a frame.
      Parameters:
      numChannels - int - valid values are 1, 2, 3, and 4, which indicates the number of channels the image will have. "1" means a grayscale image
      numSlices - DOCUMENT ME!
      numTimePoints - DOCUMENT ME!
      subsampleDimension - DOCUMENT ME!
    • setColumnWidths

      protected void setColumnWidths()
      This method calculates the width needed to encompass the table data for each column. Without this method, the column widths would not be set correctly and the user would potentialy have to resize each column to view the filename it contains.
    • subsamplingSanityCheck

      protected boolean subsamplingSanityCheck()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • makePreview

      private void makePreview(String currentPath, String selectedFilename)
      Makes an image preview of the image currentPath/selectedFilename and draws it in the image preview area.
      Parameters:
      currentPath - String
      selectedFilename - String
    • removeSelected

      private void removeSelected()
      Method removed selected items from the file list.
    • keepSelected

      private void keepSelected()
      Method keep selected items from the file list.
    • setDefaults

      private void setDefaults()
      The purpose of this method is to load the previous values in from the preferences file.