Package gov.nih.mipav.view
Class ViewJComponentAnimateClip
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- gov.nih.mipav.view.ViewJComponentBase
-
- gov.nih.mipav.view.ViewJComponentAnimateClip
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
public class ViewJComponentAnimateClip extends ViewJComponentBase
DOCUMENT ME!- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected float
alphaBlend
alphaBlending values for compositing two images.protected float
alphaPrime
DOCUMENT ME!private int
blue
DOCUMENT ME!private java.awt.image.BufferedImage
copy
DOCUMENT ME!private int
green
DOCUMENT ME!private boolean[]
ignoreSlice
DOCUMENT ME!protected java.awt.Image[]
img
DOCUMENT ME!protected int
interpMode
DOCUMENT ME!protected int
mode
mode - used to describe the cursor mode.private java.awt.MediaTracker
mt
DOCUMENT ME!private int
nColumn
DOCUMENT ME!private int
nRow
DOCUMENT ME!float
OPACITY
Opacity value used by the paint brush. value = 1.0 - opaque value = 0.25 - default (mostly see through)private int
originalZDim
DOCUMENT ME!private int
red
DOCUMENT ME!private float
resX
DOCUMENT ME!private float
resY
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.private boolean
showNumbers
DOCUMENT ME!private boolean
showSliceNumber
DOCUMENT ME!protected int
slice
DOCUMENT ME!protected java.lang.String
string
DOCUMENT ME!protected long
time
DOCUMENT ME!protected int
timeSlice
DOCUMENT ME!private int
xDim
DOCUMENT ME!private int[]
xLabel
DOCUMENT ME!private int
yDim
DOCUMENT ME!private int[]
yLabel
DOCUMENT ME!private int
zDim
DOCUMENT ME!private float
zoomX
DOCUMENT ME!private float
zoomY
DOCUMENT ME!private java.lang.String[]
zString
DOCUMENT ME!-
Fields inherited from class gov.nih.mipav.view.ViewJComponentBase
ANNOTATION, BOTH, CENTER_VOI, CUBE_BOUNDS, DEFAULT, DELETE_POINT, DROPPER_PAINT, ELLIPSE, ERASER_PAINT, IMAGE_A, IMAGE_B, imageDim, imgB, INTERPOLATE_A, INTERPOLATE_B, INTERPOLATE_BOTH, lastMouseX, lastMouseY, LEVELSET, LINE, LIVEWIRE, MAG_REGION, memImageA, memImageB, MOVE, MOVE_INTERSECTION_POINT, MOVE_POINT, MOVE_VOIPOINT, NEAREST_BOTH, NEW_POINT, NEW_VOI, OUT_OF_BOUNDS, PAINT_CAN, PAINT_VASC, PAINT_VOI, POINT_VOI, POLYLINE, POLYLINE_SLICE_VOI, PROBE, PROTRACTOR, QUICK_LUT, RECTANGLE, RECTANGLE3D, resolutionX, resolutionY, RETRACE, ROTATE, SELECT, sliceString, SMOOTH, SPLIT_VOI, textColor, TRANSLATE, VOI_3D, WAND, WIN_REGION, ZOOMING_IN, ZOOMING_OUT
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description ViewJComponentAnimateClip(float zoom, int nRow, int nColumn, int nImage)
Constructor: ImageA and ImageB are expected to be of the same dimensionality !!
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
buildImageObject(int zSlice, java.lang.String dir)
For generating the display of 1 or 2 RGB images.void
displayNumbers(boolean showNumbers)
In 4D whether to show numbers for each z slice.void
dispose(boolean gcFlag)
Sets all variables to null, disposes, and garbage collects.void
finalizeLocal()
Clean up some resources!int
getblue()
Accessor that returns int blue.int
getgreen()
Accessor that returns int green.java.awt.Image
getImage()
Gets Java image.ModelImage
getImageA()
Accessor that returns the imageA.java.awt.Image[]
getImageArray()
DOCUMENT ME!int
getInterpMode()
Gets the interpolation mode.float
getOPACITY()
Accessor that returns float OPACITY.java.awt.Dimension
getPreferredSize()
Size set to object size.int
getred()
Accessor that returns int red.java.awt.Dimension
getSize(java.awt.Dimension wh)
Gets the size of the object taking into account the zoom.float
getZoomX()
Magnification in the x - dimension.float
getZoomY()
Magnification in the y - dimension.void
ignoreSlice()
Method to ensure img[slice] is not displayed.void
importImage(java.lang.String fileName)
Creates a Image object form an array of ints that have been formatted (packed) properly (i.e. aRGB)void
paintComponent(java.awt.Graphics g)
Paints the image and border.void
set4DSpecs(int originalZDim, int nColumn, int nRow)
Specifications that are only relevant to 4D images.void
setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.void
setInterpMode(int mode)
Sets the interpolation mode.void
setLabelXY()
For 4D sets the numbering string of each z slice and its x and y positions.void
setLabelZ()
setlabelZ - For 3D sets the numbering string of each frame.void
setShowSliceNumber(boolean flag)
In 3D whether to show number for complete frame.void
setSlice(int _slice)
Accessor that sets the slice of the image.void
setZoom(float zX, float zY)
Sets the magnification in both x and y directions.void
update()
Method to call paint without erasing background this reduces flicker!void
update(java.awt.Graphics g)
Method to call paint without erasing background this reduces flicker!-
Methods inherited from class gov.nih.mipav.view.ViewJComponentBase
disposeLocal, finalize, getLastMouseX, getLastMouseY, getResolutionX, getResolutionY, getScaledX, getScaledY, getSelectedPaintColor, getShowMagIntensityEnabled, importImage, importImageB, LocalToScreen, makePaintBitmapBorder, makePaintImage, paintCursorBoxComponent, paintWindowComponent, paintWindowComponent, ScreenToLocal, setInterpolationMode, setResolutions, setSliceString, setTextColor, setZoomExact
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUI
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
OPACITY
public float OPACITY
Opacity value used by the paint brush. value = 1.0 - opaque value = 0.25 - default (mostly see through)
-
alphaBlend
protected float alphaBlend
alphaBlending values for compositing two images.
-
alphaPrime
protected float alphaPrime
DOCUMENT ME!
-
img
protected java.awt.Image[] img
DOCUMENT ME!
-
interpMode
protected int interpMode
DOCUMENT ME!
-
mode
protected int mode
mode - used to describe the cursor mode.
-
slice
protected int slice
DOCUMENT ME!
-
string
protected java.lang.String string
DOCUMENT ME!
-
time
protected long time
DOCUMENT ME!
-
timeSlice
protected int timeSlice
DOCUMENT ME!
-
copy
private java.awt.image.BufferedImage copy
DOCUMENT ME!
-
ignoreSlice
private boolean[] ignoreSlice
DOCUMENT ME!
-
mt
private java.awt.MediaTracker mt
DOCUMENT ME!
-
nRow
private int nRow
DOCUMENT ME!
-
nColumn
private int nColumn
DOCUMENT ME!
-
originalZDim
private int originalZDim
DOCUMENT ME!
-
red
private int red
DOCUMENT ME!
-
green
private int green
DOCUMENT ME!
-
blue
private int blue
DOCUMENT ME!
-
resX
private float resX
DOCUMENT ME!
-
resY
private float resY
DOCUMENT ME!
-
showNumbers
private boolean showNumbers
DOCUMENT ME!
-
showSliceNumber
private boolean showSliceNumber
DOCUMENT ME!
-
xDim
private int xDim
DOCUMENT ME!
-
yDim
private int yDim
DOCUMENT ME!
-
zDim
private int zDim
DOCUMENT ME!
-
xLabel
private int[] xLabel
DOCUMENT ME!
-
yLabel
private int[] yLabel
DOCUMENT ME!
-
zoomX
private float zoomX
DOCUMENT ME!
-
zoomY
private float zoomY
DOCUMENT ME!
-
zString
private java.lang.String[] zString
DOCUMENT ME!
-
-
Constructor Detail
-
ViewJComponentAnimateClip
public ViewJComponentAnimateClip(float zoom, int nRow, int nColumn, int nImage)
Constructor: ImageA and ImageB are expected to be of the same dimensionality !!- Parameters:
zoom
- initial magnification of imagenRow
- frame where the controls are obtainednColumn
- Model of the image that will be displayednImage
- LUT used to display imageA
-
-
Method Detail
-
buildImageObject
public boolean buildImageObject(int zSlice, java.lang.String dir)
For generating the display of 1 or 2 RGB images.- Parameters:
zSlice
- z slice to showdir
- t (time) slice to show- Returns:
- boolean to indicate if the show was successful
-
displayNumbers
public void displayNumbers(boolean showNumbers)
In 4D whether to show numbers for each z slice.- Parameters:
showNumbers
- if true display numbers for each z slice in 4D
-
dispose
public void dispose(boolean gcFlag)
Sets all variables to null, disposes, and garbage collects.- Overrides:
dispose
in classViewJComponentBase
- Parameters:
gcFlag
- if true garbage collector should be called.
-
finalizeLocal
public void finalizeLocal()
Clean up some resources!
-
getblue
public int getblue()
Accessor that returns int blue.- Returns:
- blue
-
getgreen
public int getgreen()
Accessor that returns int green.- Returns:
- green
-
getImage
public java.awt.Image getImage()
Gets Java image.- Overrides:
getImage
in classViewJComponentBase
- Returns:
- Java image
- See Also:
Image
-
getImageA
public ModelImage getImageA()
Accessor that returns the imageA.- Returns:
- imageA
-
getImageArray
public java.awt.Image[] getImageArray()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getInterpMode
public int getInterpMode()
Gets the interpolation mode.- Overrides:
getInterpMode
in classViewJComponentBase
- Returns:
- returns the interpolation mode
-
getOPACITY
public float getOPACITY()
Accessor that returns float OPACITY.- Returns:
- OPACITY
-
getPreferredSize
public java.awt.Dimension getPreferredSize()
Size set to object size.- Overrides:
getPreferredSize
in classViewJComponentBase
- Returns:
- dimension with the size
-
getred
public int getred()
Accessor that returns int red.- Returns:
- red
-
getSize
public java.awt.Dimension getSize(java.awt.Dimension wh)
Gets the size of the object taking into account the zoom.- Overrides:
getSize
in classViewJComponentBase
- Parameters:
wh
- dimension- Returns:
- dimension with the size
-
getZoomX
public float getZoomX()
Magnification in the x - dimension.- Overrides:
getZoomX
in classViewJComponentBase
- Returns:
- magnificaiton in the x - dimension
-
getZoomY
public float getZoomY()
Magnification in the y - dimension.- Overrides:
getZoomY
in classViewJComponentBase
- Returns:
- magnificaiton in the y - dimension
-
ignoreSlice
public void ignoreSlice()
Method to ensure img[slice] is not displayed.
-
importImage
public void importImage(java.lang.String fileName)
Creates a Image object form an array of ints that have been formatted (packed) properly (i.e. aRGB)- Parameters:
fileName
- Data (image) to be displayed that has been formatted (packed) properly (i.e. aRGB)
-
paintComponent
public void paintComponent(java.awt.Graphics g)
Paints the image and border.- Overrides:
paintComponent
in classViewJComponentBase
- Parameters:
g
- Graphics handle
-
set4DSpecs
public void set4DSpecs(int originalZDim, int nColumn, int nRow)
Specifications that are only relevant to 4D images.- Parameters:
originalZDim
- number of z slicesnColumn
- the number of columns of z slicesnRow
- the number of rows of z slices
-
setAlphaBlend
public void setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.- Parameters:
value
- amount [0,100] that is the percentage of Image A to be displayed
-
setInterpMode
public void setInterpMode(int mode)
Sets the interpolation mode.- Parameters:
mode
- mode to set it to
-
setLabelXY
public void setLabelXY()
For 4D sets the numbering string of each z slice and its x and y positions.
-
setLabelZ
public void setLabelZ()
setlabelZ - For 3D sets the numbering string of each frame.
-
setShowSliceNumber
public void setShowSliceNumber(boolean flag)
In 3D whether to show number for complete frame.- Overrides:
setShowSliceNumber
in classViewJComponentBase
- Parameters:
flag
- if true show number for complete frame
-
setSlice
public void setSlice(int _slice)
Accessor that sets the slice of the image.- Parameters:
_slice
- image slice to be displayed
-
setZoom
public void setZoom(float zX, float zY)
Sets the magnification in both x and y directions.- Overrides:
setZoom
in classViewJComponentBase
- Parameters:
zX
- zoom in the x directionzY
- zoom in the y direction
-
update
public void update()
Method to call paint without erasing background this reduces flicker!
-
update
public void update(java.awt.Graphics g)
Method to call paint without erasing background this reduces flicker!- Overrides:
update
in classViewJComponentBase
- Parameters:
g
- Graphics handle
-
-