Class ViewJFrameRenderCamera
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- gov.nih.mipav.view.ViewJFrameBase
-
- gov.nih.mipav.view.renderer.J3D.ViewJFrameRenderCamera
-
- All Implemented Interfaces:
ViewImageUpdateInterface,java.awt.event.ActionListener,java.awt.event.ComponentListener,java.awt.event.MouseListener,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.RootPaneContainer,javax.swing.WindowConstants
public class ViewJFrameRenderCamera extends ViewJFrameBase implements java.awt.event.MouseListener
This class builds a "light box" view of a 3D or 4D dataset. In addition, a 2nd image can be overlayed and an alpha value can be adjusted to control the amount of each image that is displayed. The user can control how the images are tiled by specifing the number of row or cols, border thickness and size, and magnification. The options can changed using the dialog accessed via the options menu.- Version:
- 1.0 July 8, 1999
- Author:
- Matthew J. McAuliffe Ph.D., Ruida Cheng
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.ColorborderColorcolor for the line border surrounding each image in the light-box.private intborderSizespacing for the line border surrounding each image in the light-box.private java.util.VectorcomponentImageVectorDOCUMENT ME!private intcurrentSelectedSliceDOCUMENT ME!private intcurrentSlicecurrent info -- this slice info refers to the *real* slice number, not the page index for a slice on a page.static booleanDEFAULT_DEPENDENT_ROWdefault row is dependent, and column independent.private static intDEFAULT_IMAGE_MINDOCUMENT ME!private static intDEFAULT_IMAGE_SIZEdefault values indicating minimum, maximum sizes are in PIXELS on a side for a magnification. this is to fix the magnification problems of very small images for which the arbitrary limits of lightbox image sizes of 25%-75% of the full size of an image. in practice the default max will reference the side with greatest magnitude ...private static intDEFAULT_XSCREEN_SPACEDOCUMENT ME!private static intDEFAULT_YSCREEN_SPACEDOCUMENT ME!private javax.swing.JButtondeleteButtonDelete the captured image button.private javax.swing.JMenuItemdeleteSelectionDelete menu icon item.private javax.swing.JButtonextractButtonExtract the selected image button.private javax.swing.JMenuItemextractSelectionExtrace menu icon item.private booleanfirstTimeDOCUMENT ME!private intframeHeightDOCUMENT ME!private java.awt.PointframeStartLocationDOCUMENT ME!private intframeWidthframe information.private java.awt.ColorgridColorcolor for the region in-between the images in the light-box.private intgridColumnDOCUMENT ME!private intgridRowvalue for the number of rows (number of images along the y-axis) and columns (number of images along the x-axis) in the light-box.private intgridSpacingspacing between images in the light-box.private javax.swing.ButtonGroupgroupDOCUMENT ME!private java.util.VectorimageBorderVectorDOCUMENT ME!private float[]imageBufferADOCUMENT ME!private intimageHeightDOCUMENT ME!private intimagePanelSizeXper num visible images information.private intimagePanelSizeYper num visible images information.private java.util.VectorimagePanelVectorDOCUMENT ME!private intimageWidthDOCUMENT ME!private intlastSelectedSliceDOCUMENT ME!private floatmagMaxDOCUMENT ME!private floatmagMinDOCUMENT ME!private floatmagnificationmagnification of images in the light-box (mag is a percentage).static intMAX_GRID_BORDERmaximum spacing of the border surrounding images in the light-box.static intMAX_GRID_COLmaximum column value (when it is the independent variable).static intMAX_GRID_ROWmaximum row value (when it is the independent variable).static intMAX_GRID_SIZEmaximum spacing in-between images in the light-box.static floatMAX_MAGNIFICATIONDOCUMENT ME!static intMAX_SELECTED_GRID_BORDERmaximum spacing of the selection border surrounding images in the light-box.private intmaxPagePanelSizeXDOCUMENT ME!private intmaxPagePanelSizeYDOCUMENT ME!private javax.swing.JMenuBarmenuBarvariables for the menubar.static floatMIN_MAGNIFICATIONdefault magnification of images in the light-box.private java.util.VectormodelImageVectorDOCUMENT ME!static intNO_AXISDOCUMENT ME!static intNO_CANCELShow progress bar without a cancel button.static intNO_PROGRESSDo no show progress bar.private intnumTotalSlicesDOCUMENT ME!private javax.swing.JPanelpagePanelNumber of pages in this frame will always be one.private intpagePanelSizeXDOCUMENT ME!private intpagePanelSizeYDOCUMENT ME!private javax.swing.JScrollPanepageScrollPanelScroll panel to handle the frame scolling.private RenderViewBaseparentFrameDOCUMENT ME!protected booleanpBarVisibleFlag indicating if a whether of not the progress bar is visible.private int[]pixBufferDOCUMENT ME!protected ViewJProgressBarprogressBarProgress bar object.protected java.awt.PointprogressBarLocationProgress bar default location.protected intprogressModeProgress mode - either standard, no cancel, or no progress bar.private booleanrow_dependentindicates which--row or column--should be dependent on the other.private java.awt.ColorselectedBorderColorcolor for the line border surrounding each selected image in the light-box.private intselectedBorderSizespacing for the selected line border surrounding each image in the light-box.private java.util.VectorselectedImagesthe selectedImages contains the *real* slice numbers -- not the index of a slice on a page.private static longserialVersionUIDUse serialVersionUID for interoperability.private ModelImagesrcImageReference to imageA.static intSTANDARDShow standard progress bar with cancel.private javax.swing.JToolBartBarFrame ToolBar.private static javax.swing.JToggleButton[]toggleArrayelements of tBar.private javax.swing.JPaneltoolbarPanelvariables for the toolbar.private java.awt.ColorunselectedBorderColorDOCUMENT ME!static intX_AXISX axis constant.private intxScreenDOCUMENT ME!static intY_AXISY axis constant.private intyScreenDOCUMENT ME!static intZ_AXISZ axis constant.-
Fields inherited from class gov.nih.mipav.view.ViewJFrameBase
absoluteGoToButton, absoluteGoToPanel, absoluteLabel, absoluteLabelVals, absolutePanel, absoluteXLabel, absoluteXTextField, absoluteYLabel, absoluteYTextField, absoluteZLabel, absoluteZTextField, alphaBlend, defaultLUTa, defaultLUTb, displayMode, IMAGE_A, IMAGE_A_B, IMAGE_B, imageA, imageB, isClosing, linkedScrolling, linkFrame, linkTriFrame, LUTa, LUTb, scannerLPS_APLabel, scannerLPS_APTextField, scannerLPS_GoToButton, scannerLPS_GoToPanel, scannerLPS_ISLabel, scannerLPS_ISTextField, scannerLPS_RLLabel, scannerLPS_RLTextField, scannerLPSLabel, scannerLPSLabelVals, scannerLPSPanel, scannerRAS_APLabel, scannerRAS_APTextField, scannerRAS_GoToButton, scannerRAS_GoToPanel, scannerRAS_ISLabel, scannerRAS_ISTextField, scannerRAS_RLLabel, scannerRAS_RLTextField, scannerRASLabel, scannerRASLabelVals, scannerRASPanel, scannerTabbedPane, tabbedPane, talGoToButton, talGoToPanel, talXLabel, talXTextField, talYLabel, talYTextField, talZLabel, talZTextField, userInterface, zoomMode
-
Fields 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_CURSOR
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description ViewJFrameRenderCamera(ModelImage _imageA, RenderViewBase _parentFrame)Builds the initial lightbox view.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent event)Handler for action events.voidaddImage(ModelImage _imageA)Add model image into the capture frame.private voidbuildMenuBar()Builds a simple menubar for this frame (ViewJFrameLightBox).private voidbuildPage()Builds the panels for a page and adds them to the page.protected voidbuildProgressBar(java.lang.String imageName, java.lang.String message, int start, int end)Constructs progress bar.private voidbuildToolbar()Builds a simple toolbar for this frame (ViewJFrameLightBox).private voidcalcImagePanelSize()Calculate the individual image panel size based on the current magnification of the image.private voidcalcMaxPagePanelSize()Calculate the maximum page panel size based on the screen size, the size of the menubar and toolbars and whether the columns or rows are independent.private voidcalcPagePanelSize()Calculate the size of the page Panel.private voidcalcScreenSize()Calculate the screen size in pixels.voidclose()Closes the frame and calls disposeLocal and dispose.voidcloseImage(ModelImage image)Closes image and updates display.voidcomponentResized(java.awt.event.ComponentEvent event)Method called when a component resize event is generated.private javax.swing.border.CompoundBordercreateImageBorder()This method creates the compound image border array for each image in the light box.private voiddeleteSlices()Delete selected slices.voiddisposeLocal(boolean flag)Dispose the global variables.protected voiddisposeProgressBar()Disposes of progress bar.private java.awt.ColorextractColor(java.lang.String preferencesColorString)Makes a series of ints, corresponding to a color string stored in the Mipav.preferences file which looks like a color string defined in web pages ("RRGGBB"). and returns a java.awt.Color based on those values.private voidextractImages()Extract the camera capture frame into the resulting ModelImage model.protected voidfinalize()finalize - calls dispose.ViewControlsImagegetControls()Gets control widgets for frame.ModelImagegetImageA()Returns the reference to imageA.ModelImagegetImageB()Returns the reference to imageB.private voidinitBuffers()Initializes the buffers that hold the image data.protected voidinitProgressBar()Initializes progress bar.protected voidinvertSelections()Method to invert the selection of slices in an image.booleanisProgressBarVisible()Returns flag that indicates that the progressBar is visible.voidloadPage()Loads the images for a page into component images and then loads the page.private voidlockSize(javax.swing.JFrame frame)Only allow resizing the frame horizontally.voidmouseClicked(java.awt.event.MouseEvent mouseEvent)A mouse event.voidmouseEntered(java.awt.event.MouseEvent mouseEvent)unchanged.voidmouseExited(java.awt.event.MouseEvent mouseEvent)Resets the level set stack.voidmousePressed(java.awt.event.MouseEvent mouseEvent)A mouse event.voidmouseReleased(java.awt.event.MouseEvent mouseEvent)A mouse event.voidremoveControls()Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls.private voidrepaintFrame()Updating image for each componentImage vector element.private voidsaveAVI()Saves screen graps to the animation frame and uses the animation frame to save the images to AVI format.protected voidselectAll()Method to select all the slices in an image.protected voidselectNone()Method to select none of the slices in an image.voidsetActiveImage(int active)Sets the active image for drawing VOIs.voidsetAlphaBlend(int value)Sets the alpha blending of parameter for two image displaying.private voidsetBorderColor(java.awt.Color col)Sets the color of the image borders.private voidsetBorderSize(int size)Sets the image border size.protected voidsetButtonStatus()Method to set the status of the delete and extract menuItems and Buttons based on the selectedImages vector.voidsetControls()Sets the menu and controls (i.e. toolbars) of the main frame!voidsetEnabled(boolean flag)Controls whether or not the images/VOIs of the frame can be modified.private voidsetGridColor(java.awt.Color col)Sets the background color of the panel that is in the scrollpane.private voidsetGridColumn(int col)This method is called when there is a change to the light box column number--in the limiting case.private voidsetGridSpacing(int width)Sets the distance between adjacent images. verifies that the width value is within bounds.voidsetImageA(ModelImage _imageA)Accessor that sets the reference to imageA.voidsetImageB(ModelImage _imageB)Accessor that sets the reference to imageB.protected voidsetMagMax()Sets the maximum magnification to the image. will ensure that the current magnification is not larger than the maximum.protected voidsetMagMin()Sets the minimum magnification to the image. will ensure that the current magnification is not smaller than the minimum.voidsetPaintBitmapSwitch(boolean paintBitmapSwitch)When switching the active image, copy the paintBitmap of the previous active image into the paintBitmap of the new active image.voidsetProgressBarInitLocation(int xDim, int yDim)DOCUMENT ME!voidsetProgressBarVisible(boolean flag)Sets Progress Bar visibility.voidsetRGBTA(ModelRGB RGBT)The following 2 functions set the RGB tables for ARGB images A and B.voidsetRGBTB(ModelRGB RGBT)DOCUMENT ME!private voidsetSelectedBorderColor(java.awt.Color col)Sets the color of the selected image borders.private voidsetSelectedBorderSize(int size)Sets the selected image border size.voidsetSlice(int slice)Used in ViewImageUpdateInterface.voidsetTimeSlice(int tslice)Sets the time slice if the image has 4 dimensions and updates the image and title.voidsetTitle()Sets the title of the frame with the image name of slice location.private voidsetupCameraStorage()Setup the light box view.booleanupdateImage(int slice, boolean highlightFlag)This methods calls the componentImage's update method to repaint the screen.voidupdateImageBorder(int i)This methods updates the image border for a single slice.voidupdateImageBorders()This method updates all the image borders for a page.booleanupdateImageExtents()(Part of ViewImageUpdateInterface) This methods calls the componentImage's REPAINT method to redraw the screen.booleanupdateImages()This methods calls the componentImage's update method to repaint the screen.booleanupdateImages(boolean forceShow)This methods calls the componentImage's update method to redraw the screen.booleanupdateImages(ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)This methods calls the componentImage's update method to redraw the screen.private voidupdateImageSelection(int plane, boolean applyToRange)Updates the image selection list by toggling the selection of the Z(3rd dimension) plane and the time (4th dimesion) volume.voidupdateImageSlice(int plane, int timeVolume)Updates the Z(3rd dimension) plane and the time (4th dimesion) volume.private voidupdatePagePanel()Refill the page panel with imagePanelVector.private voidupdatePanelLayout()Updating frame panel layout.voidwindowActivated(java.awt.event.WindowEvent event)Over loaded so that it doesn't do anything.voidwindowClosing(java.awt.event.WindowEvent event)Ask user if really wishes to close the image frame.-
Methods inherited from class gov.nih.mipav.view.ViewJFrameBase
about, buildLabelPanel, canCloseImageBAfterLoad, close, closeImageB, componentHidden, componentMoved, componentShown, getAlphaBlend, getDefaultLUTa, getDefaultLUTb, getDisplayMode, getImageNameA, getImageNameB, getLastState, getLUTa, getLUTb, getRGBTA, getRGBTB, getTriImg, getUserInterface, handleMaskPopupMenu, handlePaintToMaskPopupMenu, handleZoomPopupMenu, initExtents, initImageBuffer, initLUT, initNumSlices, initPixelBuffer, initResFactor, initResolutions, initRGB, initSlicePositions, initUnits, initZoom, loadAllVOIs, loadAllVOIsFrom, loadImage, loadLUT, loadLUTandTransferFunctionFrom, loadLUTandTransferFunctionFrom, makeString, newFrameBeenCreated, openVOI, openVOI, pickImageFile, save, save, save, saveAllVOIs, saveAllVOIsTo, saveLabels, saveLUT, saveLUTandTransferFunction, saveLUTandTransferFunction, saveLUTAs, saveLUTAs, saveVOI, saveVOIAs, saveVOIAs, saveVOIIntensities, saveVOIIntensitiesTo, setAbsPositionLabels, setEnableCloseImageBAfterLoad, setLastState, setLinkedFrame, setLinkedTriFrame, setLUTa, setLUTb, setLUTs, setMessageText, setOpacityInfo, setpaintBitmap, setScannerPosition, stateChanged, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
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, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_SIZE
private static final int DEFAULT_IMAGE_SIZE
default values indicating minimum, maximum sizes are in PIXELS on a side for a magnification. this is to fix the magnification problems of very small images for which the arbitrary limits of lightbox image sizes of 25%-75% of the full size of an image. in practice the default max will reference the side with greatest magnitude ...- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_MIN
private static final int DEFAULT_IMAGE_MIN
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT_XSCREEN_SPACE
private static final int DEFAULT_XSCREEN_SPACE
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT_YSCREEN_SPACE
private static final int DEFAULT_YSCREEN_SPACE
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT_DEPENDENT_ROW
public static final boolean DEFAULT_DEPENDENT_ROW
default row is dependent, and column independent.the default is the number of rows is the dependent variable, and is dependent apon the total number of images and the number of columns.
- See Also:
- Constant Field Values
-
MIN_MAGNIFICATION
public static final float MIN_MAGNIFICATION
default magnification of images in the light-box.- See Also:
- Constant Field Values
-
MAX_MAGNIFICATION
public static final float MAX_MAGNIFICATION
DOCUMENT ME!- See Also:
- Constant Field Values
-
MAX_GRID_ROW
public static final int MAX_GRID_ROW
maximum row value (when it is the independent variable).- See Also:
- Constant Field Values
-
MAX_GRID_COL
public static final int MAX_GRID_COL
maximum column value (when it is the independent variable).- See Also:
- Constant Field Values
-
MAX_GRID_SIZE
public static final int MAX_GRID_SIZE
maximum spacing in-between images in the light-box.- See Also:
- Constant Field Values
-
MAX_GRID_BORDER
public static final int MAX_GRID_BORDER
maximum spacing of the border surrounding images in the light-box.- See Also:
- Constant Field Values
-
MAX_SELECTED_GRID_BORDER
public static final int MAX_SELECTED_GRID_BORDER
maximum spacing of the selection border surrounding images in the light-box.- See Also:
- Constant Field Values
-
NO_AXIS
public static final int NO_AXIS
DOCUMENT ME!- See Also:
- Constant Field Values
-
X_AXIS
public static final int X_AXIS
X axis constant.- See Also:
- Constant Field Values
-
Y_AXIS
public static final int Y_AXIS
Y axis constant.- See Also:
- Constant Field Values
-
Z_AXIS
public static final int Z_AXIS
Z axis constant.- See Also:
- Constant Field Values
-
toggleArray
private static javax.swing.JToggleButton[] toggleArray
elements of tBar.
-
STANDARD
public static final int STANDARD
Show standard progress bar with cancel.- See Also:
- Constant Field Values
-
NO_CANCEL
public static final int NO_CANCEL
Show progress bar without a cancel button.- See Also:
- Constant Field Values
-
NO_PROGRESS
public static final int NO_PROGRESS
Do no show progress bar.- See Also:
- Constant Field Values
-
pBarVisible
protected boolean pBarVisible
Flag indicating if a whether of not the progress bar is visible.
-
progressBar
protected ViewJProgressBar progressBar
Progress bar object.
-
progressBarLocation
protected java.awt.Point progressBarLocation
Progress bar default location.
-
progressMode
protected int progressMode
Progress mode - either standard, no cancel, or no progress bar.
-
borderColor
private java.awt.Color borderColor
color for the line border surrounding each image in the light-box.
-
borderSize
private int borderSize
spacing for the line border surrounding each image in the light-box.
-
componentImageVector
private java.util.Vector componentImageVector
DOCUMENT ME!
-
currentSelectedSlice
private int currentSelectedSlice
DOCUMENT ME!
-
currentSlice
private int currentSlice
current info -- this slice info refers to the *real* slice number, not the page index for a slice on a page.
-
deleteButton
private javax.swing.JButton deleteButton
Delete the captured image button.
-
deleteSelection
private javax.swing.JMenuItem deleteSelection
Delete menu icon item.
-
extractButton
private javax.swing.JButton extractButton
Extract the selected image button.
-
extractSelection
private javax.swing.JMenuItem extractSelection
Extrace menu icon item.
-
firstTime
private boolean firstTime
DOCUMENT ME!
-
frameHeight
private int frameHeight
DOCUMENT ME!
-
frameStartLocation
private java.awt.Point frameStartLocation
DOCUMENT ME!
-
frameWidth
private int frameWidth
frame information.
-
gridColor
private java.awt.Color gridColor
color for the region in-between the images in the light-box.
-
gridColumn
private int gridColumn
DOCUMENT ME!
-
gridRow
private int gridRow
value for the number of rows (number of images along the y-axis) and columns (number of images along the x-axis) in the light-box.Note that both row and column set to 1 cannot make sense, but that one or the other will be the 'dependent variable' as defined by the row_dependent boolean var.
A value of 0 means that the dependent variable will automatically be sized to its maximum size that can fit nicely on the screen.
-
gridSpacing
private int gridSpacing
spacing between images in the light-box.
-
group
private javax.swing.ButtonGroup group
DOCUMENT ME!
-
imageBorderVector
private java.util.Vector imageBorderVector
DOCUMENT ME!
-
imageBufferA
private float[] imageBufferA
DOCUMENT ME!
-
imageHeight
private int imageHeight
DOCUMENT ME!
-
imagePanelSizeX
private int imagePanelSizeX
per num visible images information.
-
imagePanelSizeY
private int imagePanelSizeY
per num visible images information.
-
imagePanelVector
private java.util.Vector imagePanelVector
DOCUMENT ME!
-
imageWidth
private int imageWidth
DOCUMENT ME!
-
lastSelectedSlice
private int lastSelectedSlice
DOCUMENT ME!
-
magMax
private float magMax
DOCUMENT ME!
-
magMin
private float magMin
DOCUMENT ME!
-
magnification
private float magnification
magnification of images in the light-box (mag is a percentage).
-
maxPagePanelSizeX
private int maxPagePanelSizeX
DOCUMENT ME!
-
maxPagePanelSizeY
private int maxPagePanelSizeY
DOCUMENT ME!
-
menuBar
private javax.swing.JMenuBar menuBar
variables for the menubar.
-
modelImageVector
private java.util.Vector modelImageVector
DOCUMENT ME!
-
numTotalSlices
private int numTotalSlices
DOCUMENT ME!
-
pagePanel
private javax.swing.JPanel pagePanel
Number of pages in this frame will always be one.
-
pagePanelSizeX
private int pagePanelSizeX
DOCUMENT ME!
-
pagePanelSizeY
private int pagePanelSizeY
DOCUMENT ME!
-
pageScrollPanel
private javax.swing.JScrollPane pageScrollPanel
Scroll panel to handle the frame scolling.
-
parentFrame
private RenderViewBase parentFrame
DOCUMENT ME!
-
pixBuffer
private int[] pixBuffer
DOCUMENT ME!
-
row_dependent
private boolean row_dependent
indicates which--row or column--should be dependent on the other.the default is the number of rows is the dependent variable, and is dependent apon the total number of images and the number of columns. Don't confuse the reading to be "This display is (t/f) dependent on the row." It -could- be read as "The display is a column-independent (t/f) matrix".
-
selectedBorderColor
private java.awt.Color selectedBorderColor
color for the line border surrounding each selected image in the light-box.
-
selectedBorderSize
private int selectedBorderSize
spacing for the selected line border surrounding each image in the light-box.
-
selectedImages
private java.util.Vector selectedImages
the selectedImages contains the *real* slice numbers -- not the index of a slice on a page. So the maximum number in the vector will be numTotalSlices - 1.
-
srcImage
private ModelImage srcImage
Reference to imageA.
-
tBar
private javax.swing.JToolBar tBar
Frame ToolBar.
-
toolbarPanel
private javax.swing.JPanel toolbarPanel
variables for the toolbar.
-
unselectedBorderColor
private java.awt.Color unselectedBorderColor
DOCUMENT ME!
-
xScreen
private int xScreen
DOCUMENT ME!
-
yScreen
private int yScreen
DOCUMENT ME!
-
-
Constructor Detail
-
ViewJFrameRenderCamera
public ViewJFrameRenderCamera(ModelImage _imageA, RenderViewBase _parentFrame)
Builds the initial lightbox view.- Parameters:
_imageA- model of image A_parentFrame- title of the frame
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Handler for action events.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Specified by:
actionPerformedin classViewJFrameBase- Parameters:
event- event which trigger the call to the handler
-
addImage
public void addImage(ModelImage _imageA)
Add model image into the capture frame.- Parameters:
_imageA- Model image A.
-
close
public void close()
Closes the frame and calls disposeLocal and dispose.- Overrides:
closein classViewJFrameBase
-
closeImage
public void closeImage(ModelImage image)
Closes image and updates display.- Parameters:
image- ModelImage reference
-
componentResized
public void componentResized(java.awt.event.ComponentEvent event)
Method called when a component resize event is generated. This method snaps the size of the frame and pagePanel to the nearest row, column sizing (so the gridRow and gridColumn and page layout may change).- Specified by:
componentResizedin interfacejava.awt.event.ComponentListener- Overrides:
componentResizedin classViewJFrameBase- Parameters:
event- ComponentEvent
-
disposeLocal
public void disposeLocal(boolean flag)
Dispose the global variables.- Parameters:
flag- boolean dispose super or not.
-
getControls
public ViewControlsImage getControls()
Gets control widgets for frame.- Specified by:
getControlsin classViewJFrameBase- Returns:
- DOCUMENT ME!
-
getImageA
public ModelImage getImageA()
Returns the reference to imageA.- Specified by:
getImageAin classViewJFrameBase- Returns:
- image
-
getImageB
public ModelImage getImageB()
Returns the reference to imageB.- Specified by:
getImageBin classViewJFrameBase- Returns:
- imageB
-
isProgressBarVisible
public final boolean isProgressBarVisible()
Returns flag that indicates that the progressBar is visible.- Returns:
trueif progress bar is visible.
-
loadPage
public void loadPage() throws java.lang.OutOfMemoryErrorLoads the images for a page into component images and then loads the page.- Throws:
java.lang.OutOfMemoryError- DOCUMENT ME!
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
A mouse event. When the mouse is clicked in the image, several different things may happen. If a Volume of Interest (VOI) is selected and the click count is 2, a VOI dialog should pop up. If the click count is 1 and the mouse is in an VOI, it should select the VOI. In all other cases, a click within the image but not in an VOI should deselect all VOIs.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener- Parameters:
mouseEvent- event that triggers function; contains click count
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
unchanged.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener- Parameters:
mouseEvent- DOCUMENT ME!
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent mouseEvent)
Resets the level set stack.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener- Parameters:
mouseEvent- event that triggered function
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
A mouse event. Sets the mode of the program depending on the cursor mode. If the mode is move, activates the contour or line and enables the delete button.- Specified by:
mousePressedin interfacejava.awt.event.MouseListener- Parameters:
mouseEvent- event that triggered function
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
A mouse event. This function sets up and draws the VOI according to the mode.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener- Parameters:
mouseEvent- event that triggered function
-
removeControls
public void removeControls()
Removes the menu and controls of the main frame so that a new frame can load the main frame with the proper controls.This function no longer loads its controls into the main control window however, this method is required because this class extends ViewJFrameBase
- Specified by:
removeControlsin classViewJFrameBase
-
setActiveImage
public void setActiveImage(int active)
Sets the active image for drawing VOIs.- Specified by:
setActiveImagein classViewJFrameBase- Parameters:
active- IMAGE_A or IMAGE_B
-
setAlphaBlend
public void setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.- Specified by:
setAlphaBlendin classViewJFrameBase- Parameters:
value- amount [0,100] that is the percentage of Image A to be displayed
-
setControls
public void setControls()
Sets the menu and controls (i.e. toolbars) of the main frame! This puts the menus and controls needed to controls the operations of this frame. Different image frames have different menu and controls.This function no longer loads its controls into the main control window however, this method is required because this class extends ViewJFrameBase
- Specified by:
setControlsin classViewJFrameBase
-
setEnabled
public void setEnabled(boolean flag)
Controls whether or not the images/VOIs of the frame can be modified.- Specified by:
setEnabledin classViewJFrameBase- Parameters:
flag- if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
-
setImageA
public void setImageA(ModelImage _imageA)
Accessor that sets the reference to imageA.- Overrides:
setImageAin classViewJFrameBase- Parameters:
_imageA- image to set the frame to
-
setImageB
public void setImageB(ModelImage _imageB)
Accessor that sets the reference to imageB.- Specified by:
setImageBin classViewJFrameBase- Parameters:
_imageB- image to set the frame to
-
setPaintBitmapSwitch
public void setPaintBitmapSwitch(boolean paintBitmapSwitch)
When switching the active image, copy the paintBitmap of the previous active image into the paintBitmap of the new active image.- Specified by:
setPaintBitmapSwitchin classViewJFrameBase- Parameters:
paintBitmapSwitch- DOCUMENT ME!
-
setProgressBarInitLocation
public void setProgressBarInitLocation(int xDim, int yDim)DOCUMENT ME!- Parameters:
xDim- DOCUMENT ME!yDim- DOCUMENT ME!
-
setProgressBarVisible
public void setProgressBarVisible(boolean flag)
Sets Progress Bar visibility.- Parameters:
flag- flag to set to
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
The following 2 functions set the RGB tables for ARGB images A and B.- Specified by:
setRGBTAin classViewJFrameBase- Parameters:
RGBT- DOCUMENT ME!
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
DOCUMENT ME!- Specified by:
setRGBTBin classViewJFrameBase- Parameters:
RGBT- DOCUMENT ME!
-
setSlice
public void setSlice(int slice)
Used in ViewImageUpdateInterface. This method sets the- Specified by:
setSlicein interfaceViewImageUpdateInterface- Parameters:
slice- image plane
-
setTimeSlice
public void setTimeSlice(int tslice)
Sets the time slice if the image has 4 dimensions and updates the image and title.- Specified by:
setTimeSlicein interfaceViewImageUpdateInterface- Parameters:
tslice- time slice
-
setTitle
public void setTitle()
Sets the title of the frame with the image name of slice location.- Specified by:
setTitlein classViewJFrameBase
-
updateImage
public final boolean updateImage(int slice, boolean highlightFlag)This methods calls the componentImage's update method to repaint the screen. This will set the requested highlight when the repaint is issued. Use setSlice() to update a single frames highlight, as this will not set the current slice.- Parameters:
slice- the slice of the image to update -- NOT the index into the visibile slices.highlightFlag- requests to paint the highlight around the component image- Returns:
- boolean confirming successful update see setSlice
- See Also:
ViewJComponentEditImage.useHighlight(boolean)
-
updateImageBorder
public void updateImageBorder(int i)
This methods updates the image border for a single slice.- Parameters:
i- the index of the image to update (NOT the slice number)
-
updateImageBorders
public void updateImageBorders()
This method updates all the image borders for a page. This needs to be called whenever a new page is loaded.
-
updateImageExtents
public boolean updateImageExtents()
(Part of ViewImageUpdateInterface) This methods calls the componentImage's REPAINT method to redraw the screen. The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.- Specified by:
updateImageExtentsin interfaceViewImageUpdateInterface- Specified by:
updateImageExtentsin classViewJFrameBase- Returns:
- DOCUMENT ME!
- See Also:
ViewImageUpdateInterface
-
updateImages
public final boolean updateImages()
This methods calls the componentImage's update method to repaint the screen.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Returns:
- boolean confirming successful update
-
updateImages
public final boolean updateImages(boolean forceShow)
This methods calls the componentImage's update method to redraw the screen. Without LUT changes.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
forceShow- forces show to re import image and calc. java image- Returns:
- boolean confirming successful update
-
updateImages
public final boolean updateImages(ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen.- Specified by:
updateImagesin interfaceViewImageUpdateInterface- Parameters:
_LUTa- LUT used to update imageA_LUTb- LUT used to update imageBforceShow- forces show to re import image and calc. java imageinterpMode- image interpolation method (Nearest or Smooth)- Returns:
- boolean confirming successful update
-
updateImageSlice
public void updateImageSlice(int plane, int timeVolume)Updates the Z(3rd dimension) plane and the time (4th dimesion) volume.- Parameters:
plane- image plane that is to displayedtimeVolume- the volume in which the plane the is to be displayed from
-
windowActivated
public void windowActivated(java.awt.event.WindowEvent event)
Over loaded so that it doesn't do anything.- Specified by:
windowActivatedin interfacejava.awt.event.WindowListener- Overrides:
windowActivatedin classViewJFrameBase- Parameters:
event- DOCUMENT ME!
-
windowClosing
public void windowClosing(java.awt.event.WindowEvent event)
Ask user if really wishes to close the image frame.- Specified by:
windowClosingin interfacejava.awt.event.WindowListener- Overrides:
windowClosingin classViewJFrameBase- Parameters:
event- DOCUMENT ME!
-
buildProgressBar
protected void buildProgressBar(java.lang.String imageName, java.lang.String message, int start, int end)Constructs progress bar.- Parameters:
imageName- title of the toolbarmessage- message to be displayed in the framestart- start (typical = 0)end- end (typical = 100)
-
disposeProgressBar
protected void disposeProgressBar()
Disposes of progress bar.
-
finalize
protected void finalize() throws java.lang.Throwablefinalize - calls dispose.- Overrides:
finalizein classViewJFrameBase- Throws:
java.lang.Throwable- DOCUMENT ME!
-
initProgressBar
protected void initProgressBar()
Initializes progress bar.
-
invertSelections
protected void invertSelections()
Method to invert the selection of slices in an image.
-
selectAll
protected void selectAll()
Method to select all the slices in an image.
-
selectNone
protected void selectNone()
Method to select none of the slices in an image.
-
setButtonStatus
protected void setButtonStatus()
Method to set the status of the delete and extract menuItems and Buttons based on the selectedImages vector.
-
setMagMax
protected void setMagMax()
Sets the maximum magnification to the image. will ensure that the current magnification is not larger than the maximum.
-
setMagMin
protected void setMagMin()
Sets the minimum magnification to the image. will ensure that the current magnification is not smaller than the minimum.
-
buildMenuBar
private void buildMenuBar()
Builds a simple menubar for this frame (ViewJFrameLightBox).
-
buildPage
private void buildPage() throws java.lang.OutOfMemoryErrorBuilds the panels for a page and adds them to the page.- Throws:
java.lang.OutOfMemoryError- DOCUMENT ME!
-
buildToolbar
private void buildToolbar()
Builds a simple toolbar for this frame (ViewJFrameLightBox).
-
calcImagePanelSize
private void calcImagePanelSize()
Calculate the individual image panel size based on the current magnification of the image.
-
calcMaxPagePanelSize
private void calcMaxPagePanelSize()
Calculate the maximum page panel size based on the screen size, the size of the menubar and toolbars and whether the columns or rows are independent.
-
calcPagePanelSize
private void calcPagePanelSize()
Calculate the size of the page Panel. First the maximum size of the pagePanel must have been determined. Once the maximum page panel size is determined, then the actual size may be reduced to nicely fit the current image panel size. This will also determine how many images will fit into the page panel.
-
calcScreenSize
private void calcScreenSize()
Calculate the screen size in pixels.
-
createImageBorder
private javax.swing.border.CompoundBorder createImageBorder()
This method creates the compound image border array for each image in the light box. The outer border is a LineBorder that uses the border color defined in the settings. The inner border is also a Line Border, however it's color depends on whether an image is selected or not (see the selectedImages vector).- Returns:
- DOCUMENT ME!
-
deleteSlices
private void deleteSlices()
Delete selected slices.
-
extractColor
private java.awt.Color extractColor(java.lang.String preferencesColorString)
Makes a series of ints, corresponding to a color string stored in the Mipav.preferences file which looks like a color string defined in web pages ("RRGGBB"). and returns a java.awt.Color based on those values.Call with extractColor(Preferences.getProperty("OneOfThoseColors"));
if preferencesColorString is null, or incomplete, returns black.
- Parameters:
String- preferencesColorString-- this class pre-arranges the colors to be- Returns:
- java.awt.Color
- See Also:
Color
-
extractImages
private void extractImages()
Extract the camera capture frame into the resulting ModelImage model. The extraction takes the first slice in each componentImageVector, then binding them into the resulting modelImage model.
-
initBuffers
private void initBuffers()
Initializes the buffers that hold the image data.
-
lockSize
private void lockSize(javax.swing.JFrame frame)
Only allow resizing the frame horizontally. Vertial not allow. Dr. Ben's contribution.- Parameters:
frame- DOCUMENT ME!
-
repaintFrame
private void repaintFrame()
Updating image for each componentImage vector element.
-
saveAVI
private void saveAVI()
Saves screen graps to the animation frame and uses the animation frame to save the images to AVI format.
-
setBorderColor
private void setBorderColor(java.awt.Color col)
Sets the color of the image borders.- Parameters:
col- color of the image borders
-
setBorderSize
private void setBorderSize(int size)
Sets the image border size.- Parameters:
size- thichness of the image border.
-
setGridColor
private void setGridColor(java.awt.Color col)
Sets the background color of the panel that is in the scrollpane.- Parameters:
col- the color the background of the panel that is in the scrollpane
-
setGridColumn
private void setGridColumn(int col)
This method is called when there is a change to the light box column number--in the limiting case. It ensures that the column value is within bounds.- Parameters:
col- the number of columns to be used to display the images
-
setGridSpacing
private void setGridSpacing(int width)
Sets the distance between adjacent images. verifies that the width value is within bounds. If width is outside of bounds, method fails quietly.- Parameters:
width- the width of space between images.
-
setSelectedBorderColor
private void setSelectedBorderColor(java.awt.Color col)
Sets the color of the selected image borders.- Parameters:
col- color of the selected image borders
-
setSelectedBorderSize
private void setSelectedBorderSize(int size)
Sets the selected image border size.- Parameters:
size- thichness of the selected image border.
-
setupCameraStorage
private void setupCameraStorage()
Setup the light box view. A scrollpane is added to the frame. A panel with a grid layout is added to the scrollpane. Bordered panels the size of the image are added to each position of the grid. Lastly image slices are added to each bordered panel.
-
updateImageSelection
private void updateImageSelection(int plane, boolean applyToRange)Updates the image selection list by toggling the selection of the Z(3rd dimension) plane and the time (4th dimesion) volume.- Parameters:
plane- image plane that is to displayedapplyToRange- the volume in which the plane the is to be displayed from
-
updatePagePanel
private void updatePagePanel()
Refill the page panel with imagePanelVector.
-
updatePanelLayout
private void updatePanelLayout()
Updating frame panel layout.
-
-