Package gov.nih.mipav.view
Class ViewOpenImageSequence
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
gov.nih.mipav.view.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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested 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 TypeFieldDescriptionprotected static final StringDOCUMENT ME!protected JSliderDOCUMENT ME!protected static final StringDOCUMENT ME!protected static final StringDOCUMENT ME!protected AlternatingTableCellRendererDOCUMENT ME!(package private) int[]DOCUMENT ME!protected JCheckBoxDOCUMENT ME!protected JComboBoxDOCUMENT ME!protected static final StringDOCUMENT ME!protected JSliderDOCUMENT ME!protected final intInt denoting CTZ sequenceprotected FileDOCUMENT ME!protected final intInt denoting CZT sequenceprotected static final StringDOCUMENT ME!protected JCheckBoxDOCUMENT ME!protected File[]DOCUMENT ME!private JTableDOCUMENT ME!private SortingTableModelDOCUMENT ME!private TableSorterDOCUMENT ME!protected static final StringDOCUMENT ME!protected JLabelDOCUMENT ME!protected static final StringDOCUMENT ME!protected StringDOCUMENT ME!protected JPanelDOCUMENT ME!protected JRadioButtonRadio button for CTZ sequenceprotected JRadioButtonRadio button for CZT sequenceprotected JRadioButtonRadio button for TCZ sequenceprotected JRadioButtonRadio button for TZC sequenceprotected JRadioButtonRadio button for ZCT sequenceprotected JRadioButtonRadio button for ZTC sequenceprotected static final StringDOCUMENT ME!private static final longUse serialVersionUID for interoperability.protected JTableDOCUMENT ME!protected UneditableTableModelDOCUMENT ME!protected final intInt denoting TCZ sequenceprotected JTextFieldDOCUMENT ME!protected JTextFieldDOCUMENT ME!protected JTextFieldDOCUMENT ME!protected JTextFieldDOCUMENT ME!protected JTextFieldDOCUMENT ME!protected JTextFieldDOCUMENT ME!protected final intInt denoting TZC sequenceprotected final intInt denoting ZCT sequenceprotected final intInt denoting ZTC sequenceFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) DOCUMENT ME!protected voidarrangeCTZ(int numSlices, int numChannels, int numTimePoints) Arrange the table in CTZ order.protected voidarrangeCZT(int numSlices, int numChannels, int numTimePoints) Arrange the table in CZT order.protected voidarrangeTCZ(int numSlices, int numChannels, int numTimePoints) Arrange the table in TCZ order.protected voidarrangeTZC(int numSlices, int numChannels, int numTimePoints) Arrange the table in TZC order.protected voidarrangeZCT(int numSlices, int numChannels, int numTimePoints) Arrange the table in ZCT order.protected voidarrangeZTC(int numSlices, int numChannels, int numTimePoints) Arrange the table in ZTC order.protected JPanelDOCUMENT ME!protected JPanelDOCUMENT ME!protected JPanelDOCUMENT ME!protected JPanelDOCUMENT ME!protected JPanelDOCUMENT ME!protected JPanelDOCUMENT ME!protected JPanelDOCUMENT ME!protected voidDOCUMENT ME!protected booleanMethod checks the dimensions parameters entered by the user.filterFileExtension(Vector<String> rawFileList, File selectedFile) Method filters out the rawFileList based of the file extension of the parameter selectedFile.protected voidformatTable(int selectedSequence) Ensures the table is drawn in the way specified by the dimensions parameters and the selected sequence.protected File[]DOCUMENT ME!protected FileReads the preferences file to determine the path that was last used in opening a file sequence.Method is required by PreviewImageContainer interface to draw a preview image.protected intDOCUMENT ME!private voidMethod keep selected items from the file list.voidkeyPressed(KeyEvent event) DOCUMENT ME!voidkeyReleased(KeyEvent event) DOCUMENT ME!voidDOCUMENT ME!private voidmakePreview(String currentPath, String selectedFilename) Makes an image preview of the image currentPath/selectedFilename and draws it in the image preview area.voidmouseClicked(MouseEvent event) DOCUMENT ME!voidmouseEntered(MouseEvent event) DOCUMENT ME!voidmouseExited(MouseEvent event) DOCUMENT ME!voidmousePressed(MouseEvent event) DOCUMENT ME!voidmouseReleased(MouseEvent event) DOCUMENT ME!voidnewChannelMap(int[] channelMap) DOCUMENT ME!protected voidWill read a series of images and put them into a frame.private voidMethod removed selected items from the file list.protected voidThis method calculates the width needed to encompass the table data for each column.private voidThe purpose of this method is to load the previous values in from the preferences file.voidstateChanged(ChangeEvent event) DOCUMENT ME!protected booleanDOCUMENT ME!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, updateMethods 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, setUndecoratedMethods 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, 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, 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
CANCEL
DOCUMENT ME!- See Also:
-
OK
DOCUMENT ME!- See Also:
-
APPLY
DOCUMENT ME!- See Also:
-
BROWSE
DOCUMENT ME!- See Also:
-
FILTER
DOCUMENT ME!- See Also:
-
REMOVE
DOCUMENT ME!- See Also:
-
CONFIGURE_CHANNELS
DOCUMENT ME!- See Also:
-
ENABLE
DOCUMENT ME!- See Also:
-
brightnessSlider
DOCUMENT ME! -
cellRenderer
DOCUMENT ME! -
chkForceUBYTE
DOCUMENT ME! -
cmbFilter
DOCUMENT ME! -
contrastSlider
DOCUMENT ME! -
currentPath
DOCUMENT ME! -
enableCheckbox
DOCUMENT ME! -
fileListData
DOCUMENT ME! -
lblOrigDim
DOCUMENT ME! -
previewFilename
DOCUMENT ME! -
previewPanel
DOCUMENT ME! -
radCTZ
Radio button for CTZ sequence -
radCZT
Radio button for CZT sequence -
radTCZ
Radio button for TCZ sequence -
radTZC
Radio button for TZC sequence -
radZCT
Radio button for ZCT sequence -
radZTC
Radio button for ZTC sequence -
table
DOCUMENT ME! -
tableModel
DOCUMENT ME! -
txtChannels
DOCUMENT ME! -
txtDirectory
DOCUMENT ME! -
txtHeight
DOCUMENT ME! -
txtSlices
DOCUMENT ME! -
txtTimePoints
DOCUMENT ME! -
txtWidth
DOCUMENT ME! -
CZT
protected final int CZTInt denoting CZT sequence- See Also:
-
TCZ
protected final int TCZInt denoting TCZ sequence- See Also:
-
CTZ
protected final int CTZInt denoting CTZ sequence- See Also:
-
TZC
protected final int TZCInt denoting TZC sequence- See Also:
-
ZCT
protected final int ZCTInt denoting ZCT sequence- See Also:
-
ZTC
protected final int ZTCInt denoting ZTC sequence- See Also:
-
channelMap
int[] channelMapDOCUMENT ME! -
filenameTableModel
DOCUMENT ME! -
filenameTableSorter
DOCUMENT ME! -
filenameTable
DOCUMENT ME!
-
-
Constructor Details
-
ViewOpenImageSequence
public ViewOpenImageSequence()Creates a new ViewOpenImageSequence object.
-
-
Method Details
-
actionPerformed
DOCUMENT ME!- Specified by:
actionPerformedin interfaceActionListener- Parameters:
event- DOCUMENT ME!
-
getPanelSize
Method is required by PreviewImageContainer interface to draw a preview image.- Specified by:
getPanelSizein interfacePreviewImageContainer- Returns:
- Dimension - indicating the size of the preview image area.
-
keyPressed
DOCUMENT ME!- Specified by:
keyPressedin interfaceKeyListener- Parameters:
event- DOCUMENT ME!
-
keyReleased
DOCUMENT ME!- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
event- DOCUMENT ME!
-
keyTyped
DOCUMENT ME!- Specified by:
keyTypedin interfaceKeyListener- Parameters:
event- DOCUMENT ME!
-
mouseClicked
DOCUMENT ME!- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
event- DOCUMENT ME!
-
mouseEntered
DOCUMENT ME!- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
event- DOCUMENT ME!
-
mouseExited
DOCUMENT ME!- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
event- DOCUMENT ME!
-
mousePressed
DOCUMENT ME!- Specified by:
mousePressedin interfaceMouseListener- Parameters:
event- DOCUMENT ME!
-
mouseReleased
DOCUMENT ME!- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
event- DOCUMENT ME!
-
newChannelMap
public void newChannelMap(int[] channelMap) DOCUMENT ME!- Parameters:
channelMap- DOCUMENT ME!
-
stateChanged
DOCUMENT ME!- Specified by:
stateChangedin interfaceChangeListener- 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 representsnumChannels- int - the number of channels the data representsnumTimePoints- 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 representsnumChannels- int - the number of channels the data representsnumTimePoints- 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 representsnumChannels- int - the number of channels the data representsnumTimePoints- 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 representsnumChannels- int - the number of channels the data representsnumTimePoints- 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 representsnumChannels- int - the number of channels the data representsnumTimePoints- 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 representsnumChannels- int - the number of channels the data representsnumTimePoints- int - the number of time points the data represents
-
buildBrightnessContrastPanel
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildCenterPanel
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildDimensionsPanel
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildLeftSubPanel
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildOKCancelPanel
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildSequencesPanel
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
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
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 objectsselectedFile- 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
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
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 imagenumSlices- 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
Makes an image preview of the image currentPath/selectedFilename and draws it in the image preview area.- Parameters:
currentPath- StringselectedFilename- 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.
-