Package gov.nih.mipav.view
Class ViewJComponentBase
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- gov.nih.mipav.view.ViewJComponentBase
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
- Direct Known Subclasses:
ViewJComponentAnimate
,ViewJComponentAnimateClip
,ViewJComponentColocalizationEM
,ViewJComponentColocalizationRegression
,ViewJComponentEditImage
,ViewJComponentLUT
,ViewJComponentLUTTable
,ViewJComponentPreviewImage
,ViewJComponentSurface
public abstract class ViewJComponentBase extends javax.swing.JComponent
Abstract class used for displaying images in the program MIPAV.- Version:
- 1.0 August 31, 1999
- Author:
- Matthew J. McAuliffe, Ph.D.
$Logfile: /mipav/src/gov/nih/mipav/view/ViewJComponentBase.java $ $Revision: 135 $ $Date: 1/30/06 2:25p $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ANNOTATION
Indicates the MIPAV cursor is in annotation VOI modestatic int
BOTH
DOCUMENT ME!static int
CENTER_VOI
DOCUMENT ME!static int
CUBE_BOUNDS
DOCUMENT ME!static int
DEFAULT
Used to describe cursor mode, this means no VOIs will be drawn.static int
DELETE_POINT
DOCUMENT ME!static int
DROPPER_PAINT
This mode is an active VOI mode used by the VOI Handlerstatic int
ELLIPSE
Indicates the MIPAV cursor is in ellipse VOI modestatic int
ERASER_PAINT
This mode is an active VOI mode used by the VOI Handlerstatic int
IMAGE_A
DOCUMENT ME!static int
IMAGE_B
DOCUMENT ME!protected java.awt.Dimension
imageDim
DOCUMENT ME!protected java.awt.Image
img
DOCUMENT ME!protected java.awt.Image
imgB
DOCUMENT ME!protected int
interpMode
Interpolation mode for image displaystatic int
INTERPOLATE_A
Image interpolation only done for image Astatic int
INTERPOLATE_B
Image interpolation only done for image Bstatic int
INTERPOLATE_BOTH
Image interpolation only done for both images A and Bprotected int
lastMouseX
used by the repaintPaintBrushCursorFast methodprotected int
lastMouseY
used by the repaintPaintBrushCursorFast methodstatic int
LEVELSET
Indicates the MIPAV cursor is in levelset VOI modestatic int
LINE
Indicates the MIPAV cursor is in 2D line VOI modestatic int
LIVEWIRE
Indicates the MIPAV cursor is in livewire VOI modestatic int
MAG_REGION
DOCUMENT ME!protected java.awt.image.MemoryImageSource
memImageA
DOCUMENT ME!protected java.awt.image.MemoryImageSource
memImageB
DOCUMENT ME!static int
MOVE
DOCUMENT ME!static int
MOVE_INTERSECTION_POINT
DOCUMENT ME!static int
MOVE_POINT
DOCUMENT ME!static int
MOVE_VOIPOINT
DOCUMENT ME!static int
NEAREST_BOTH
Nearest neighbor interpolation applied to both imagesstatic int
NEW_POINT
DOCUMENT ME!static int
NEW_VOI
Indicates that a VOI has just been created, is not related to the various possible VOI modes that the handler deals withprotected int
OUT_OF_BOUNDS
DOCUMENT ME!static int
PAINT_CAN
Indicates the cursor is in paint can modestatic int
PAINT_VASC
DOCUMENT ME!static int
PAINT_VOI
Indicates the MIPAV cursor is in paint VOI modestatic int
POINT_VOI
Indicates the MIPAV cursor is in point VOI modestatic int
POLYLINE
Indicates the MIPAV cursor is in polyline VOI modestatic int
POLYLINE_SLICE_VOI
Indicates the MIPAV cursor is in polyline slice VOI modestatic int
PROBE
DOCUMENT ME!static int
PROTRACTOR
This mode is an active VOI mode used by the VOI Handlerstatic int
QUICK_LUT
This mode is used by the VOI Handler to determine whether VOIs will be drawn.static int
RECTANGLE
Indicates the MIPAV cursor is in slice rectangle VOI modestatic int
RECTANGLE3D
Indicates the MIPAV cursor is in volume rectangle VOI modeprotected float
resolutionX
resolutionX and Y are used to correct difference in intra and inter plane voxel resolution These represent the aspect ratio of the image These are NOT to be confused with the pixel resolutions.protected float
resolutionY
DOCUMENT ME!static int
RETRACE
DOCUMENT ME!static int
ROTATE
Indicates the VOI cursor is in translate modestatic int
SELECT
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.protected boolean
showSliceNumber
DOCUMENT ME!protected java.lang.String
sliceString
DOCUMENT ME!static int
SMOOTH
DOCUMENT ME!static int
SPLIT_VOI
Indicates the MIPAV cursor is in split VOI modeprotected java.awt.Color
textColor
DOCUMENT ME!static int
TRANSLATE
Indicates the VOI cursor is in translate modestatic int
VOI_3D
Indicates the cursor is in 3D voi drawing mode while in tri-planar viewstatic int
WAND
DOCUMENT ME!static int
WIN_REGION
DOCUMENT ME!static int
ZOOMING_IN
Indicates the cursor is in zoom in modestatic int
ZOOMING_OUT
Indicates the cursor is in zoom out modeprotected float
zoomX
DOCUMENT ME!protected float
zoomY
DOCUMENT ME!-
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 ViewJComponentBase(int width, int height, ModelImage _imageA)
creates object of size defined by width & height.ViewJComponentBase(java.awt.Dimension compDim)
creates object of size defined by width & height.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose(boolean flag)
DOCUMENT ME!void
disposeLocal()
Clean up some resources!protected void
finalize()
Clean up some resources!java.awt.Image
getImage()
Gets the Java image.int
getInterpMode()
Gets the interpolation mode.int
getLastMouseX()
Get the x position of the last place we drew something from a mouse event.int
getLastMouseY()
Get the y position of the last place we drew something from a mouse event.java.awt.Dimension
getPreferredSize()
size set to object size.float
getResolutionX()
Resolution correction factor in the x - dimension.float
getResolutionY()
Resolution correction factor in the y - dimension.int
getScaledX(int x)
Converts the screen cursor x-coordinate to scaled version using the image's pixel resolution and zoom.int
getScaledY(int y)
Converts the screen cursor y-coordinate to scaled version using the image's pixel resolution and zoom.int
getSelectedPaintColor(ViewJFrameBase vjfb)
Gets the color of the paint the user has selected from the paint toolbar.boolean
getShowMagIntensityEnabled(java.awt.Graphics g, int width, int height, float mag, int imageType, double minIntensity, double maxIntensity)
Returns whether to enable the showIntensity checkbox for mag. boxjava.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
importImage(int[] data)
Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB)void
importImageB(int[] dataB)
Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB) for the magnifier in image Bvoid
LocalToScreen(WildMagic.LibFoundation.Mathematics.Vector3f localPoint, WildMagic.LibFoundation.Mathematics.Vector3f screenPoint)
LocalToScreen converts a point from local coordinates to screen coordinates.protected void
makePaintBitmapBorder(int[] paintImageBuffer, java.util.BitSet paintBitmap, int slice, ViewJFrameBase frame)
This method adds an opaque border to the painted area on-screen.protected void
makePaintImage(int[] paintImageBuffer, java.util.BitSet paintBitmap, int slice, ViewJFrameBase frame, boolean b2D)
This method creates a buffer that will be used to make an image of the painted area on-screen.void
paintComponent(java.awt.Graphics g)
Paints the image and border.void
paintCursorBoxComponent(java.awt.Graphics g, int xNew, int yNew, int width, int height)
Paints a box over the image centered about the cursor.void
paintWindowComponent(java.awt.Graphics graphics, int xNew, int yNew, int width, int height, float mag)
DOCUMENT ME!void
paintWindowComponent(java.awt.Graphics graphics, int xNew, int yNew, int width, int height, float mag, java.awt.Image drawImage)
Paints a image B in a window over the image centered about the cursor.void
ScreenToLocal(WildMagic.LibFoundation.Mathematics.Vector3f screenPoint, WildMagic.LibFoundation.Mathematics.Vector3f localPoint)
ScreenToLocal converts a point from screen coordinates to local coordinates.void
setInterpolationMode(int mode)
Sets the interpolation mode.void
setResolutions(float rX, float rY)
Sets the resolution correction factor in both x and y directions.void
setShowSliceNumber(boolean flag)
Sets whether the slice number is shown.void
setSliceString(java.lang.String str)
Sets the string painted on the lower left.void
setTextColor(java.awt.Color color)
Sets the text to the desired color.void
setZoom(float zX, float zY)
Sets the magnification in both x and y directions.void
setZoomExact(float zX, float zY)
Sets the magnification to exactly the zoom specified values in both x and y directions.void
update(java.awt.Graphics g)
Calls paint without erasing background - this reduces flicker!-
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
-
SMOOTH
public static final int SMOOTH
DOCUMENT ME!- See Also:
- Constant Field Values
-
INTERPOLATE_A
public static final int INTERPOLATE_A
Image interpolation only done for image A- See Also:
- Constant Field Values
-
INTERPOLATE_B
public static final int INTERPOLATE_B
Image interpolation only done for image B- See Also:
- Constant Field Values
-
INTERPOLATE_BOTH
public static final int INTERPOLATE_BOTH
Image interpolation only done for both images A and B- See Also:
- Constant Field Values
-
NEAREST_BOTH
public static final int NEAREST_BOTH
Nearest neighbor interpolation applied to both images- See Also:
- Constant Field Values
-
IMAGE_A
public static final int IMAGE_A
DOCUMENT ME!- See Also:
- Constant Field Values
-
IMAGE_B
public static final int IMAGE_B
DOCUMENT ME!- See Also:
- Constant Field Values
-
BOTH
public static final int BOTH
DOCUMENT ME!- See Also:
- Constant Field Values
-
DEFAULT
public static final int DEFAULT
Used to describe cursor mode, this means no VOIs will be drawn.- See Also:
- Constant Field Values
-
SELECT
public static final int SELECT
DOCUMENT ME!- See Also:
- Constant Field Values
-
MOVE
public static final int MOVE
DOCUMENT ME!- See Also:
- Constant Field Values
-
RECTANGLE
public static final int RECTANGLE
Indicates the MIPAV cursor is in slice rectangle VOI mode- See Also:
- Constant Field Values
-
RECTANGLE3D
public static final int RECTANGLE3D
Indicates the MIPAV cursor is in volume rectangle VOI mode- See Also:
- Constant Field Values
-
LEVELSET
public static final int LEVELSET
Indicates the MIPAV cursor is in levelset VOI mode- See Also:
- Constant Field Values
-
MOVE_POINT
public static final int MOVE_POINT
DOCUMENT ME!- See Also:
- Constant Field Values
-
NEW_POINT
public static final int NEW_POINT
DOCUMENT ME!- See Also:
- Constant Field Values
-
DELETE_POINT
public static final int DELETE_POINT
DOCUMENT ME!- See Also:
- Constant Field Values
-
WAND
public static final int WAND
DOCUMENT ME!- See Also:
- Constant Field Values
-
ELLIPSE
public static final int ELLIPSE
Indicates the MIPAV cursor is in ellipse VOI mode- See Also:
- Constant Field Values
-
LINE
public static final int LINE
Indicates the MIPAV cursor is in 2D line VOI mode- See Also:
- Constant Field Values
-
POLYLINE
public static final int POLYLINE
Indicates the MIPAV cursor is in polyline VOI mode- See Also:
- Constant Field Values
-
NEW_VOI
public static final int NEW_VOI
Indicates that a VOI has just been created, is not related to the various possible VOI modes that the handler deals with- See Also:
- Constant Field Values
-
RETRACE
public static final int RETRACE
DOCUMENT ME!- See Also:
- Constant Field Values
-
POINT_VOI
public static final int POINT_VOI
Indicates the MIPAV cursor is in point VOI mode- See Also:
- Constant Field Values
-
PAINT_VOI
public static final int PAINT_VOI
Indicates the MIPAV cursor is in paint VOI mode- See Also:
- Constant Field Values
-
PAINT_CAN
public static final int PAINT_CAN
Indicates the cursor is in paint can mode- See Also:
- Constant Field Values
-
DROPPER_PAINT
public static final int DROPPER_PAINT
This mode is an active VOI mode used by the VOI Handler- See Also:
- Constant Field Values
-
ERASER_PAINT
public static final int ERASER_PAINT
This mode is an active VOI mode used by the VOI Handler- See Also:
- Constant Field Values
-
MAG_REGION
public static final int MAG_REGION
DOCUMENT ME!- See Also:
- Constant Field Values
-
WIN_REGION
public static final int WIN_REGION
DOCUMENT ME!- See Also:
- Constant Field Values
-
QUICK_LUT
public static final int QUICK_LUT
This mode is used by the VOI Handler to determine whether VOIs will be drawn. A quick lut is implemented in MIPAV as a rectangle VOI- See Also:
- Constant Field Values
-
PROTRACTOR
public static final int PROTRACTOR
This mode is an active VOI mode used by the VOI Handler- See Also:
- Constant Field Values
-
ROTATE
public static final int ROTATE
Indicates the VOI cursor is in translate mode- See Also:
- Constant Field Values
-
TRANSLATE
public static final int TRANSLATE
Indicates the VOI cursor is in translate mode- See Also:
- Constant Field Values
-
MOVE_VOIPOINT
public static final int MOVE_VOIPOINT
DOCUMENT ME!- See Also:
- Constant Field Values
-
CENTER_VOI
public static final int CENTER_VOI
DOCUMENT ME!- See Also:
- Constant Field Values
-
CUBE_BOUNDS
public static final int CUBE_BOUNDS
DOCUMENT ME!- See Also:
- Constant Field Values
-
LIVEWIRE
public static final int LIVEWIRE
Indicates the MIPAV cursor is in livewire VOI mode- See Also:
- Constant Field Values
-
PAINT_VASC
public static final int PAINT_VASC
DOCUMENT ME!- See Also:
- Constant Field Values
-
ANNOTATION
public static final int ANNOTATION
Indicates the MIPAV cursor is in annotation VOI mode- See Also:
- Constant Field Values
-
PROBE
public static final int PROBE
DOCUMENT ME!- See Also:
- Constant Field Values
-
MOVE_INTERSECTION_POINT
public static final int MOVE_INTERSECTION_POINT
DOCUMENT ME!- See Also:
- Constant Field Values
-
ZOOMING_IN
public static final int ZOOMING_IN
Indicates the cursor is in zoom in mode- See Also:
- Constant Field Values
-
ZOOMING_OUT
public static final int ZOOMING_OUT
Indicates the cursor is in zoom out mode- See Also:
- Constant Field Values
-
POLYLINE_SLICE_VOI
public static final int POLYLINE_SLICE_VOI
Indicates the MIPAV cursor is in polyline slice VOI mode- See Also:
- Constant Field Values
-
SPLIT_VOI
public static final int SPLIT_VOI
Indicates the MIPAV cursor is in split VOI mode- See Also:
- Constant Field Values
-
VOI_3D
public static final int VOI_3D
Indicates the cursor is in 3D voi drawing mode while in tri-planar view- See Also:
- Constant Field Values
-
imageDim
protected java.awt.Dimension imageDim
DOCUMENT ME!
-
img
protected java.awt.Image img
DOCUMENT ME!
-
imgB
protected java.awt.Image imgB
DOCUMENT ME!
-
interpMode
protected int interpMode
Interpolation mode for image display
-
memImageA
protected java.awt.image.MemoryImageSource memImageA
DOCUMENT ME!
-
memImageB
protected java.awt.image.MemoryImageSource memImageB
DOCUMENT ME!
-
resolutionX
protected float resolutionX
resolutionX and Y are used to correct difference in intra and inter plane voxel resolution These represent the aspect ratio of the image These are NOT to be confused with the pixel resolutions.
-
resolutionY
protected float resolutionY
DOCUMENT ME!
-
showSliceNumber
protected boolean showSliceNumber
DOCUMENT ME!
-
sliceString
protected java.lang.String sliceString
DOCUMENT ME!
-
textColor
protected java.awt.Color textColor
DOCUMENT ME!
-
zoomX
protected float zoomX
DOCUMENT ME!
-
zoomY
protected float zoomY
DOCUMENT ME!
-
OUT_OF_BOUNDS
protected int OUT_OF_BOUNDS
DOCUMENT ME!
-
lastMouseX
protected int lastMouseX
used by the repaintPaintBrushCursorFast method
-
lastMouseY
protected int lastMouseY
used by the repaintPaintBrushCursorFast method
-
-
Constructor Detail
-
ViewJComponentBase
public ViewJComponentBase(java.awt.Dimension compDim)
creates object of size defined by width & height.- Parameters:
compDim
- width and height of component
-
ViewJComponentBase
public ViewJComponentBase(int width, int height, ModelImage _imageA)
creates object of size defined by width & height.- Parameters:
extents
- the image width and height_imageA
- the image that this ViewJComponentBase is a view of
-
-
Method Detail
-
dispose
public void dispose(boolean flag)
DOCUMENT ME!- Parameters:
flag
- DOCUMENT ME!
-
disposeLocal
public void disposeLocal()
Clean up some resources!
-
getImage
public java.awt.Image getImage()
Gets the Java image.- Returns:
- Java image
- See Also:
Image
-
getInterpMode
public int getInterpMode()
Gets the interpolation mode.- Returns:
- returns the interpolation mode
-
getLastMouseX
public int getLastMouseX()
Get the x position of the last place we drew something from a mouse event.- Returns:
- the x coordinate of the last mouse event
-
getLastMouseY
public int getLastMouseY()
Get the y position of the last place we drew something from a mouse event.- Returns:
- the y coordinate of the last mouse event
-
getPreferredSize
public java.awt.Dimension getPreferredSize()
size set to object size.- Overrides:
getPreferredSize
in classjavax.swing.JComponent
- Returns:
- dimension with the size
-
getResolutionX
public float getResolutionX()
Resolution correction factor in the x - dimension.- Returns:
- correction in the x - dimension
-
getResolutionY
public float getResolutionY()
Resolution correction factor in the y - dimension.- Returns:
- correction in the y - dimension
-
getScaledX
public int getScaledX(int x)
Converts the screen cursor x-coordinate to scaled version using the image's pixel resolution and zoom.- Parameters:
x
- the cursor's x-coordinate- Returns:
- x-coordinate in image space
-
getScaledY
public int getScaledY(int y)
Converts the screen cursor y-coordinate to scaled version using the image's pixel resolution and zoom.- Parameters:
y
- the cursor's y-coordinate- Returns:
- x-coordinate in image space
-
LocalToScreen
public void LocalToScreen(WildMagic.LibFoundation.Mathematics.Vector3f localPoint, WildMagic.LibFoundation.Mathematics.Vector3f screenPoint)
LocalToScreen converts a point from local coordinates to screen coordinates.- Parameters:
localPoint
- a 3D point, where x,y represent the point in local slice coordinates and the z value is the slice value.screenPoint
- the transfromed localPoint, scaled with the image pixel resolution and zoom.
-
ScreenToLocal
public void ScreenToLocal(WildMagic.LibFoundation.Mathematics.Vector3f screenPoint, WildMagic.LibFoundation.Mathematics.Vector3f localPoint)
ScreenToLocal converts a point from screen coordinates to local coordinates.- Parameters:
screenPoint
- a 3D point, where x,y represent the point in local slice coordinates and the z value is the slice value. screenPoint is usually taken from the MouseEvent point.localPoint
- the transfromed point in local slice coordinates. The z-value represents the current slice.
-
getShowMagIntensityEnabled
public boolean getShowMagIntensityEnabled(java.awt.Graphics g, int width, int height, float mag, int imageType, double minIntensity, double maxIntensity)
Returns whether to enable the showIntensity checkbox for mag. box- Parameters:
g
- DOCUMENT ME!width
- DOCUMENT ME!height
- DOCUMENT ME!mag
- DOCUMENT ME!imageType
- DOCUMENT ME!minIntensity
- DOCUMENT ME!maxIntensity
- DOCUMENT ME!- Returns:
- whether to enable showIntensity checkbox
-
getSize
public java.awt.Dimension getSize(java.awt.Dimension wh)
gets the size of the object taking into account the zoom.- Overrides:
getSize
in classjavax.swing.JComponent
- Parameters:
wh
- DOCUMENT ME!- Returns:
- dimension with the size
-
getZoomX
public float getZoomX()
Magnification in the x - dimension.- Returns:
- magnificaiton in the x - dimension
-
getZoomY
public float getZoomY()
Magnification in the y - dimension.- Returns:
- magnificaiton in the y - dimension
-
importImage
public void importImage(int[] data)
Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB)- Parameters:
data
- Data (image) to be displayed that has been formatted (packed) properly (i.e. aRGB)
-
importImageB
public void importImageB(int[] dataB)
Creates a Image object from an array of ints that have been formatted (packed) properly (i.e. aRGB) for the magnifier in image B- Parameters:
dataB
- Data (imageB) 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 classjavax.swing.JComponent
- Parameters:
g
- Graphics handle
-
paintCursorBoxComponent
public void paintCursorBoxComponent(java.awt.Graphics g, int xNew, int yNew, int width, int height)
Paints a box over the image centered about the cursor.- Parameters:
g
- graphics componentxNew
- x coord in imageyNew
- y coord in imagewidth
- width of the cursor window in pixelsheight
- height of the cursor window in pixels
-
paintWindowComponent
public void paintWindowComponent(java.awt.Graphics graphics, int xNew, int yNew, int width, int height, float mag)
DOCUMENT ME!- Parameters:
graphics
- DOCUMENT ME!xNew
- DOCUMENT ME!yNew
- DOCUMENT ME!width
- DOCUMENT ME!height
- DOCUMENT ME!mag
- DOCUMENT ME!
-
paintWindowComponent
public void paintWindowComponent(java.awt.Graphics graphics, int xNew, int yNew, int width, int height, float mag, java.awt.Image drawImage)
Paints a image B in a window over the image centered about the cursor.- Parameters:
graphics
- graphics componentxNew
- x coord in imageyNew
- y coord in imagewidth
- width of the magnification window in pixels in unit zoomheight
- height of the magnification window in pixels in unit zoommag
- magnification of the zoom windowdrawImage
- DOCUMENT ME!
-
setInterpolationMode
public void setInterpolationMode(int mode)
Sets the interpolation mode.- Parameters:
mode
- the interpolation mode (i.e. SMOOTH, NEAREST)
-
setResolutions
public void setResolutions(float rX, float rY)
Sets the resolution correction factor in both x and y directions.- Parameters:
rX
- resolution correction factor in the x directionrY
- resolution correction factor in the y direction
-
setShowSliceNumber
public void setShowSliceNumber(boolean flag)
Sets whether the slice number is shown.- Parameters:
flag
- if true show slice number
-
setSliceString
public void setSliceString(java.lang.String str)
Sets the string painted on the lower left.- Parameters:
str
- str that is painted on the lower left of image
-
setTextColor
public void setTextColor(java.awt.Color color)
Sets the text to the desired color.- Parameters:
color
- color of text
-
setZoom
public void setZoom(float zX, float zY)
Sets the magnification in both x and y directions.- Parameters:
zX
- zoom in the x directionzY
- zoom in the y direction
-
setZoomExact
public void setZoomExact(float zX, float zY)
Sets the magnification to exactly the zoom specified values in both x and y directions.- Parameters:
zX
- zoom in the x directionzY
- zoom in the y direction
-
update
public void update(java.awt.Graphics g)
Calls paint without erasing background - this reduces flicker!- Overrides:
update
in classjavax.swing.JComponent
- Parameters:
g
- Graphics handle
-
finalize
protected void finalize() throws java.lang.Throwable
Clean up some resources!- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
makePaintImage
protected void makePaintImage(int[] paintImageBuffer, java.util.BitSet paintBitmap, int slice, ViewJFrameBase frame, boolean b2D)
This method creates a buffer that will be used to make an image of the painted area on-screen.- Parameters:
paintImageBuffer
- int[] the buffer to fill that will make the paint imagepaintBitmap
- the bit map representing the painted pixelsslice
- the current slice to paint if this is a 3D imageframe
- the ViewJFrameBase containing the painted component.b2D
- when true this is a 2D image component, when false it is greater than 2D
-
makePaintBitmapBorder
protected void makePaintBitmapBorder(int[] paintImageBuffer, java.util.BitSet paintBitmap, int slice, ViewJFrameBase frame)
This method adds an opaque border to the painted area on-screen.- Parameters:
paintImageBuffer
- int[] the buffer the paint image will be created frompaintBitmap
- the bit map representing the painted pixelsslice
- the current slice to paint if this is a 3D imageframe
- the ViewJFrameBase containing the painted component.
-
getSelectedPaintColor
public int getSelectedPaintColor(ViewJFrameBase vjfb)
Gets the color of the paint the user has selected from the paint toolbar.- Parameters:
vjfb
- the ViewJFrameBase object that contains the paint toolbar.- Returns:
- int the color of the paint selected by the user, represented as a packed integer
-
-