gov.nih.mipav.view
Class ViewJComponentTriImage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by gov.nih.mipav.view.ViewJComponentBase
                  extended by gov.nih.mipav.view.ViewJComponentEditImage
                      extended by gov.nih.mipav.view.ViewJComponentTriImage
All Implemented Interfaces:
PaintGrowListener, ActionListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener

public class ViewJComponentTriImage
extends ViewJComponentEditImage
implements MouseWheelListener, KeyListener, ActionListener

One of the component images that make up the triplanar view (AXIAL, SAGITTAL, and CORONAL views).

Notes:
The protractor does not show up in ViewJComponentEditImage because it is not registered. If newVOI is hit, then the VOI must be registered for the points to show up in EditImage.

For the ViewJFrameTriImage addPoint command, that the ViewJComponentEditImage mode is set to DEFAULT while the ViewJComponentTriImage mode is set to POINT_VOI. For the Protractor command, the ViewJComponentTriImage mode is set to PROTRACTOR while the ViewJComponentEditImage mode is set to DEFAULT. For the Line command, the ViewJComponentTriImage mode is set to LINE while the ViewJComponentEditImage mode is set to DEFAULT. For the ViewJFrameTriImage center command, the ViewJComponentEditImage mode is set to DEFAULT while the ViewJComponentTriImage mode is set to CENTER_VOI. For the boundingBox command, the ViewJComponentEdit image mode is set to DEFAULT while the ViewJComponentTriImage mode is set to CUBE_BOUNDS. For the traverse command, both EditImage and TriImage have their modes set to DEFAULT. NEW_VOI, PAINT_VOI, DROPPER_PAINT, ERASER_PAINT, and PAINT_CAN are set in both EditImage and TriImage.

Author:
William Gandler
See Also:
ViewJFrameTriImage, ViewJComponentDualTriImage, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int ANOTHER_PT
          AC-PC: Another midsagittal reference point.
static int ANTERIOR_PT
          Talairach: Anterior reference point.
static String DELETE_INTENSITY_LINE
          used in the popup menu when the user right-clicks over a voi intensity line.
protected  boolean dragCenterPt
          DOCUMENT ME!
static int FIRST_PT
          AC-PC: First midsagittal reference point.
static int INFERIOR_EDGE
          AC-PC: Inferior Edge reference point.
static int INFERIOR_PT
          Talairach: Inferior reference point.
protected  boolean intensityLineVisible
          DOCUMENT ME!
static int LEFT_PT
          Talairach: Left reference point.
static int POSTERIOR_MARGIN
          AC-PC: Posterior Margin reference point.
static int POSTERIOR_PT
          Talairach: Posterior reference point.
protected  boolean protractorVisible
          DOCUMENT ME!
static int RIGHT_PT
          Talairach: Right reference point.
static String SHOW_INTENSITY_GRAPH
          DOCUMENT ME!
static int SUPERIOR_EDGE
          AC-PC: Superior Edge reference point.
static int SUPERIOR_PT
          Talairach: Superior reference point.
 
Fields inherited from class gov.nih.mipav.view.ViewJComponentEditImage
ACTIVE_IMAGE_COLOR, allActive, alphaBlend, alphaPrime, checkerDialog, cleanImageBufferA, cleanImageBufferB, crosshairCursor, cursorMode, displayFuzzy, drawVOIs, frame, frameControls, fuzzyThreshold, GEOMETRIC_ZOOM, growDialog, imageA, imageActive, imageB, imageBufferA, imageBufferActive, imageBufferB, imageExtents, imageStatList, intensityDropper, less, lessB, lessG, lessR, LINEAR_ZOOM, logMagDisplay, LUTa, LUTb, m_kPatientSlice, m_kWinLevel, MAGR_HEIGHT, MAGR_MAG, MAGR_WIDTH, magSettings, maxDistance, maxExtents, modifyFlag, more, moreB, moreG, moreR, mousePressIsShiftDown, nColumnCheckers, nRowCheckers, onTop, orientation, paintBitmap, paintBitmapBU, paintBitmapSwitch, paintBrush, paintBrushDim, paintBrushDimPrevious, paintBrushPrevious, paintBrushSize, paintBuffer, paintImage, paintImagePrevious, pixBuffer, pixBufferB, previousPaintBrush, renderBilinear, renderNearestNeighbor, rgbString, RGBTA, RGBTB, saveValue, saveValueB, saveValueG, saveValueR, saveX, saveY, saveZ, seedPaintBitmap, seedVal, seedValB, seedValG, seedValR, sizeLimit, slice, stringOverride, time, timeSlice, toppedColor, useBComp, useGComp, useRComp, useVOI, variableThresholds, visRect, voiHandler, winLevelSet, xPG, yPG, zPG
 
Fields inherited from class gov.nih.mipav.view.ViewJComponentBase
ANNOTATION, BILINEAR, BOTH, CENTER_VOI, CUBE_BOUNDS, DEFAULT, DELETE_POINT, DROPPER_PAINT, ELLIPSE, ERASER_PAINT, IMAGE_A, IMAGE_B, imageDim, img, imgB, interpMode, INTERPOLATE_A, INTERPOLATE_B, INTERPOLATE_BOTH, lastMouseX, lastMouseY, LEVELSET, LINE, LIVEWIRE, MAG_REGION, memImageA, memImageB, MOVE, MOVE_INTERSECTION_POINT, MOVE_POINT, MOVE_VOIPOINT, NEAREST, 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, showSliceNumber, sliceString, SMOOTH, SPLIT_VOI, textColor, TRANSLATE, WAND, WIN_REGION, ZOOMING_IN, ZOOMING_OUT, zoomX, zoomY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ViewJComponentTriImage(ViewJFrameBase _frame, ModelImage _imageA, ModelLUT _LUTa, float[] imgBufferA, ModelImage _imageB, ModelLUT _LUTb, float[] imgBufferB, int[] pixelBuffer, float zoom, int[] extents, boolean logMagDisplay, int _orientation)
          The TriImage component constructor.
 
Method Summary
 void actionPerformed(ActionEvent event)
          DOCUMENT ME!
 void computeTalairachVoxelPosition(int x, int y)
          Computes the talairach grid voxel from a screen coordinate.
 void deleteAllVOIs()
          Delete all VOIs in the active image.
 void displayAxes(boolean doShowAxes)
          Sets whether axes (either anatomical or x,y,z if no orientation info) are shown or not in one of the corners of the component.
 void displayXHairs(boolean doShowCrosshairs)
          Sets whether or not crosshairs are shown in the images.
 void disposeLocal(boolean flag)
          Sets all variables to null, disposes, and garbage collects (sometimes).
protected  void finalize()
          Clean up memory used by the component.
 WildMagic.LibFoundation.Mathematics.Vector3f getCenter()
          Returns the current center point in FileCoordinates:
 WildMagic.LibFoundation.Mathematics.Vector2f getCrosshairPoint()
          Returns the current cross hair position in screen coordinates.
 int[] getExtents()
          Returns the extents of the tri planar component (in the component's order, not the image volume's).
 float[] getResolutions()
          DOCUMENT ME!
 WildMagic.LibFoundation.Mathematics.Vector2f getScreenCoordinates(WildMagic.LibFoundation.Mathematics.Vector3f point3d)
          Accepts a point in volume space and converts it to screen space.
 double getTheta()
          Accessor that returns the protractor angle.
 WildMagic.LibFoundation.Mathematics.Vector3f getVolumePosition(float x, float y, float z)
          Translate a point on the x-y tri-image component into image volume space.
 Point3D getVolumePosition(int x, int y, int z)
          Translate a point on the x-y tri-image component into image volume space.
 Color getXSliceHairColor()
          Get the color for the crosshairPt.X crosshair.
 Color getYSliceHairColor()
          Get the color for the ySlice crosshair.
 Color getZSliceHairColor()
          Get the color for the zSlice crosshair.
 boolean isIntensityLineVisible()
          Returns a boolean indicating whether the intensity line is currently visible or invisible.
 boolean isProtractorVisible()
          Gets the status of the protractor.
 boolean isShowBoundingRect()
          Returns whether the bounding rectangle should be drawn.
 void keyPressed(KeyEvent e)
          keyReleased event method for KeyListener.
protected  void makePaintImage(int[] paintImageBuffer, 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 makeProtractor()
          Constructs and initializes one of the 3 protractors, depending on which component this is.
 void mouseClicked(MouseEvent mouseEvent)
          When an image is double-clicked with the right-mouse button, the slice of the parent image is updated to match the current volume slice.
 void mouseDragged(MouseEvent mouseEvent)
          A mouse-dragged event.
 void mouseEntered(MouseEvent mouseEvent)
          Mouse entry handler: tells the parent tri-image frame about the current component orientation.
 void mouseExited(MouseEvent mouseEvent)
          Mouse exit handler: repaints the image to get rid of the cursor if we are in a mode that custom draws the mouse cursor.
 void mouseMoved(MouseEvent mouseEvent)
          A mouse event.
 void mousePressed(MouseEvent mouseEvent)
          A mouse-pressed event.
 void mouseReleased(MouseEvent mouseEvent)
          A mouse-released event.
 void mouseWheelMoved(MouseWheelEvent event)
          Mouse wheel movement handler, used to change the displayed slice in the component.
 boolean nearBoundsPoint(int mouseX, int mouseY, int boundsX, int boundsY)
          Returns true if mouse point is close to bounds point.
 void paintComponent(Graphics graphics)
          Paints the image, optionally draws the axis, the center of rotation point, the talairach grid, etc., and calls drawSelf for all VOIs.
 boolean removeReference(String label)
          Remove a talairach / ACPC reference point.
 void setCenter(int i, int j, int k)
          setCenter, sets the crosshairPt and the local copies of the volumePosition (in FileCoordinates and PatientCoordinates).
 void setCrop(WildMagic.LibFoundation.Mathematics.Vector3f lower, WildMagic.LibFoundation.Mathematics.Vector3f upper)
          Sets the crop volume.
 void setCrosshairPixelGap(int newGap)
          Sets the pixel gap to be used by the crosshair (in one direction away from the center)
 void setCursorMode(int newMode)
          DOCUMENT ME!
 void setDoCenter(boolean doCenter)
          Sets whether the center of rotation point should be displayed and the user should be allowed to change it.
 void setIntensityLineVisible(boolean visible)
          Sets the intensity line to visible or invisible.
 void setProtractorVisible(boolean visible)
          Sets the protractor to either a visible or invisible state.
 void setReferenceXY(int pointType, WildMagic.LibFoundation.Mathematics.Vector3f pt)
          Set a talairach / ACPC reference point.
 void setShowBoundingRect(boolean flag)
          Sets whether the bounding rectangle should be drawn.
 void setSnapProtractor90(boolean snapProtractor90)
          Accessor to set the snapProtractor90 variable.
 void setXSliceHairColor(Color c)
          Change the color for the x crosshair.
 void setYSliceHairColor(Color c)
          Change the color for the y crosshair.
 void setZoom(float zX, float zY)
          sets the screen scale variable when setZoom is called:
 void setZSliceHairColor(Color c)
          Change the color for the z crosshair.
 boolean show(int tSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int _interpMode)
          DOCUMENT ME!
 void showTalairachGrid(boolean doShowTalairachGrid)
          Sets whether or not lines dividing the Talairach regions are shown.
 void showTalairachGridmarkers(boolean doShowTalairachGridmarkers)
          Sets whether the talairach grid markers will be displayed.
 void update(Graphics g)
          Calls paintComponent - reduces flicker.
 void updateCrosshairPosition(int x, int y)
          Changes the crosshair coordinate (screen coordinate) that this component should display.
protected  void updatePaintBitmap(boolean paintPixels, int x, int y)
          Updates the image volume's paint bitmap based on the current position of the mouse in the component, called after a mouse action indicates the user wants part of the image either painted or erased.
 
Methods inherited from class gov.nih.mipav.view.ViewJComponentEditImage
calcPaintedVolume, cine, commitMask, commitMask, commitMask, commitMask, commitPaintToMask, commitPaintToUbyteMask, createImg, deleteSelectedContours, deleteSelectedContours, drawGradicules, drawStringBW, eraseAllPaint, getActiveImage, getActiveImageBuffer, getActiveImageSliceBuffer, getActiveLUT, getAlphaBlend, getBrushSize, getCursorMode, getFrame, getHBrushSize, getImageA, getImageB, getImageBufferA, getImageBufferB, getIntensityDropper, getLUTa, getLUTb, getModifyFlag, getNumPoints, getnVOI, getOpacity, getOrientation, getPaintBitmap, getPaintBuffer, getPaintMask, getPixBuffer, getPixBufferB, getRGBPaintComponents, getRGBTA, getRGBTB, getScannerPositionLabels, getShowMagIntensityEnabled, getSlice, getTimeSlice, getVOIHandler, getZoomMagnitudeX, getZoomMagnitudeY, isCheckerboarded, isZeroToOneLUTAdj, keyReleased, keyTyped, loadOnlyLUTFrom, loadPaintBrush, mousePressedPaint, openUDLUT, paintComponentForPrinter, paintMagComponent, performPaint, performPaint, processDefaultMouseDrag, quickSwitchBrush, regionGrow, regionGrow, regionGrow, regionGrow, regionGrow, regionGrowColor, rememberPaintBrushSize, resetLUTs, resetPaintBrushSize, saveOnlyLUTAs, saveUDLUT, setActiveImage, setAlphaBlend, setBuffers, setCheckerboard, setCrosshairCursor, setDisplayFuzzy, setEnabled, setFrameControls, setFuzzyThreshold, setGrowDialog, setHasThreshold1, setHasThreshold2, setHighlightColor, setImageA, setImageB, setImageBufferB, setImageColocalize, setImageExtents, setIntensityDropper, setLess, setLessB, setLessG, setLessR, setLogMagDisplay, setLUTa, setLUTb, setMaxDistance, setModifyFlag, setMore, setMoreB, setMoreG, setMoreR, setPaintBitmapSwitch, setPaintBrushSize, setPaintMask, setPixelInformationAtLocation, setRegionGrowVars, setRGBPaintComponents, setRGBTA, setRGBTB, setShowMagIntensity, setShowSliceNum, setSizeLimit, setSlice, setStringOverride, setThresholdColors, setThresholds, setTimeSlice, setUseVOI, setVariableThresholds, setZeroToOneLUTAdj, show, show, show, showBlank, showRegionInfo, showRegionInfo, showStatisticsCalculator, undoLastPaint, updatePaint, updatePaintBrushCursor, useHighlight
 
Methods inherited from class gov.nih.mipav.view.ViewJComponentBase
dispose, disposeLocal, getImage, getInterpMode, getLastMouseX, getLastMouseY, getPreferredSize, getResolutionX, getResolutionY, getScaledX, getScaledY, getSelectedPaintColor, getShowMagIntensityEnabled, getSize, getZoomX, getZoomY, importImage, importImageB, LocalToScreen, makePaintBitmapBorder, paintCursorBoxComponent, paintWindowComponent, paintWindowComponent, ScreenToLocal, setInterpolationMode, setResolutions, setShowSliceNumber, setSliceString, setTextColor
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, transferFocusBackward, 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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.event.KeyListener
keyReleased, keyTyped
 

Field Detail

SUPERIOR_EDGE

public static final int SUPERIOR_EDGE
AC-PC: Superior Edge reference point. Used for conversions by the dialogs that create new AC-PC images.

See Also:
Constant Field Values

POSTERIOR_MARGIN

public static final int POSTERIOR_MARGIN
AC-PC: Posterior Margin reference point. Used for conversions by the dialogs that create new AC-PC images.

See Also:
Constant Field Values

INFERIOR_EDGE

public static final int INFERIOR_EDGE
AC-PC: Inferior Edge reference point. Used for conversions by the dialogs that create new AC-PC images.

See Also:
Constant Field Values

FIRST_PT

public static final int FIRST_PT
AC-PC: First midsagittal reference point. Used for conversions by the dialogs that create new AC-PC images.

See Also:
Constant Field Values

ANOTHER_PT

public static final int ANOTHER_PT
AC-PC: Another midsagittal reference point. Used for conversions by the dialogs that create new AC-PC images.

See Also:
Constant Field Values

ANTERIOR_PT

public static final int ANTERIOR_PT
Talairach: Anterior reference point. Used for conversions by the dialogs that create new Talairach images.

See Also:
Constant Field Values

POSTERIOR_PT

public static final int POSTERIOR_PT
Talairach: Posterior reference point. Used for conversions by the dialogs that create new Talairach images.

See Also:
Constant Field Values

SUPERIOR_PT

public static final int SUPERIOR_PT
Talairach: Superior reference point. Used for conversions by the dialogs that create new Talairach images.

See Also:
Constant Field Values

INFERIOR_PT

public static final int INFERIOR_PT
Talairach: Inferior reference point. Used for conversions by the dialogs that create new Talairach images.

See Also:
Constant Field Values

LEFT_PT

public static final int LEFT_PT
Talairach: Left reference point. Used for conversions by the dialogs that create new Talairach images.

See Also:
Constant Field Values

RIGHT_PT

public static final int RIGHT_PT
Talairach: Right reference point. Used for conversions by the dialogs that create new Talairach images.

See Also:
Constant Field Values

DELETE_INTENSITY_LINE

public static final String DELETE_INTENSITY_LINE
used in the popup menu when the user right-clicks over a voi intensity line.

See Also:
Constant Field Values

SHOW_INTENSITY_GRAPH

public static final String SHOW_INTENSITY_GRAPH
DOCUMENT ME!

See Also:
Constant Field Values

dragCenterPt

protected boolean dragCenterPt
DOCUMENT ME!


intensityLineVisible

protected boolean intensityLineVisible
DOCUMENT ME!


protractorVisible

protected boolean protractorVisible
DOCUMENT ME!

Constructor Detail

ViewJComponentTriImage

public ViewJComponentTriImage(ViewJFrameBase _frame,
                              ModelImage _imageA,
                              ModelLUT _LUTa,
                              float[] imgBufferA,
                              ModelImage _imageB,
                              ModelLUT _LUTb,
                              float[] imgBufferB,
                              int[] pixelBuffer,
                              float zoom,
                              int[] extents,
                              boolean logMagDisplay,
                              int _orientation)
The TriImage component constructor. Sets up the initial slice to show, the placement of the crosshairs, updates the position labels, and the bounding box locations.

Note that reordering occurs in paintBuffer and pixBuffer, but reordering does not occur in imageBuffer. Thus, for the ZY orientation in hasOrientation imageDim.width and imageDim.height are swapped in paintBuffer and pixBuffer, but not in imageBuffer.

Parameters:
_frame - frame where component will be displayed
_imageA - Model of the image that will be displayed
_LUTa - LUT used to display imageA
imgBufferA - storage buffer used to display imageA
_imageB - Model of the image that will be displayed
_LUTb - LUT used to display imageB
imgBufferB - storage buffer used to display imageB
pixelBuffer - storage buffer used to build a displayable image
zoom - initial magnification of the image
extents - initial display dimensions of the image
logMagDisplay - display log magnitude of the image
_orientation - display orientation of the image
Method Detail

actionPerformed

public void actionPerformed(ActionEvent event)
DOCUMENT ME!

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - DOCUMENT ME!

computeTalairachVoxelPosition

public void computeTalairachVoxelPosition(int x,
                                          int y)
Computes the talairach grid voxel from a screen coordinate. Also updates the talairach voxel label in the tri-planar frame.

Parameters:
x - screen x
y - screen y

deleteAllVOIs

public void deleteAllVOIs()
Delete all VOIs in the active image.


displayAxes

public void displayAxes(boolean doShowAxes)
Sets whether axes (either anatomical or x,y,z if no orientation info) are shown or not in one of the corners of the component.

Parameters:
doShowAxes - whether to show the axes

displayXHairs

public void displayXHairs(boolean doShowCrosshairs)
Sets whether or not crosshairs are shown in the images.

Parameters:
doShowCrosshairs - whether to show the tri-image crosshairs

disposeLocal

public void disposeLocal(boolean flag)
Sets all variables to null, disposes, and garbage collects (sometimes).

Overrides:
disposeLocal in class ViewJComponentEditImage
Parameters:
flag - if true garbage collector should be called.

getCenter

public WildMagic.LibFoundation.Mathematics.Vector3f getCenter()
Returns the current center point in FileCoordinates:

Returns:
DOCUMENT ME!

getCrosshairPoint

public WildMagic.LibFoundation.Mathematics.Vector2f getCrosshairPoint()
Returns the current cross hair position in screen coordinates.

Returns:
crosshairPt, the current cross-hair position in screen coordinates

getExtents

public int[] getExtents()
Returns the extents of the tri planar component (in the component's order, not the image volume's).

Returns:
the extents of the tri image component

getResolutions

public float[] getResolutions()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getScreenCoordinates

public WildMagic.LibFoundation.Mathematics.Vector2f getScreenCoordinates(WildMagic.LibFoundation.Mathematics.Vector3f point3d)
Accepts a point in volume space and converts it to screen space.

Parameters:
point3d - Point3D the point in volume space
Returns:
Point

getTheta

public double getTheta()
Accessor that returns the protractor angle.

Returns:
the protractor angle

getVolumePosition

public final Point3D getVolumePosition(int x,
                                       int y,
                                       int z)
Translate a point on the x-y tri-image component into image volume space. Assumes input parameters have zoom and voxel resolution already factored out.

Parameters:
x - x value of the point within the component
y - y value of the point within the component
z - the z coordinate ( usually == slice ) (the out-of-component dimension)
Returns:
the point translated into the image volume

getVolumePosition

public final WildMagic.LibFoundation.Mathematics.Vector3f getVolumePosition(float x,
                                                                            float y,
                                                                            float z)
Translate a point on the x-y tri-image component into image volume space. Assumes input parameters have zoom and voxel resolution already factored out.

Parameters:
x - x value of the point within the component
y - y value of the point within the component
z - the z coordinate ( usually == slice ) (the out-of-component dimension)
Returns:
the point translated into the image volume

getXSliceHairColor

public Color getXSliceHairColor()
Get the color for the crosshairPt.X crosshair.

Returns:
the x crosshair color

getYSliceHairColor

public Color getYSliceHairColor()
Get the color for the ySlice crosshair.

Returns:
the y crosshair color

getZSliceHairColor

public Color getZSliceHairColor()
Get the color for the zSlice crosshair.

Returns:
the z crosshair color

isIntensityLineVisible

public boolean isIntensityLineVisible()
Returns a boolean indicating whether the intensity line is currently visible or invisible.

Returns:
true if the intensity line is visible, false otherwise

isProtractorVisible

public boolean isProtractorVisible()
Gets the status of the protractor.

Returns:
boolean indicating whether the protractor is visible or invisible

isShowBoundingRect

public boolean isShowBoundingRect()
Returns whether the bounding rectangle should be drawn.

Returns:
whether the bounding rectangle should be drawn

keyPressed

public void keyPressed(KeyEvent e)
keyReleased event method for KeyListener.

Specified by:
keyPressed in interface KeyListener
Overrides:
keyPressed in class ViewJComponentEditImage
Parameters:
e - KeyEvent

makeProtractor

public void makeProtractor()
Constructs and initializes one of the 3 protractors, depending on which component this is.


mouseClicked

public void mouseClicked(MouseEvent mouseEvent)
When an image is double-clicked with the right-mouse button, the slice of the parent image is updated to match the current volume slice.

Specified by:
mouseClicked in interface MouseListener
Overrides:
mouseClicked in class ViewJComponentEditImage
Parameters:
mouseEvent - mouse event

mouseDragged

public void mouseDragged(MouseEvent mouseEvent)
A mouse-dragged event.

Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class ViewJComponentEditImage
Parameters:
mouseEvent - event that triggered function

mouseEntered

public void mouseEntered(MouseEvent mouseEvent)
Mouse entry handler: tells the parent tri-image frame about the current component orientation.

Specified by:
mouseEntered in interface MouseListener
Overrides:
mouseEntered in class ViewJComponentEditImage
Parameters:
mouseEvent - event that triggers this function

mouseExited

public void mouseExited(MouseEvent mouseEvent)
Mouse exit handler: repaints the image to get rid of the cursor if we are in a mode that custom draws the mouse cursor.

Specified by:
mouseExited in interface MouseListener
Overrides:
mouseExited in class ViewJComponentEditImage
Parameters:
mouseEvent - event that triggered function

mouseMoved

public void mouseMoved(MouseEvent mouseEvent)
A mouse event. If the mode is level set, draws level sets as user moves mouse. Otherwise, changes the cursor depending on where the mouse is in relation to the VOI.

Specified by:
mouseMoved in interface MouseMotionListener
Overrides:
mouseMoved in class ViewJComponentEditImage
Parameters:
mouseEvent - event that triggered the function

mousePressed

public void mousePressed(MouseEvent mouseEvent)
A mouse-pressed 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:
mousePressed in interface MouseListener
Overrides:
mousePressed in class ViewJComponentEditImage
Parameters:
mouseEvent - event that triggered this function

mouseReleased

public void mouseReleased(MouseEvent mouseEvent)
A mouse-released event. This function sets up and draws the VOI according to the mode.

Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class ViewJComponentEditImage
Parameters:
mouseEvent - event that triggered this function

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent event)
Mouse wheel movement handler, used to change the displayed slice in the component.

Specified by:
mouseWheelMoved in interface MouseWheelListener
Overrides:
mouseWheelMoved in class ViewJComponentEditImage
Parameters:
event - the mouse wheel rotation event

nearBoundsPoint

public boolean nearBoundsPoint(int mouseX,
                               int mouseY,
                               int boundsX,
                               int boundsY)
Returns true if mouse point is close to bounds point.

Parameters:
mouseX - the x component of the mouse click within the component
mouseY - the y component of the mouse click within the component
boundsX - the x component of the bounds point to check against
boundsY - the y component of the bounds point to check against
Returns:
true if mouse point is close to bounds point

paintComponent

public void paintComponent(Graphics graphics)
Paints the image, optionally draws the axis, the center of rotation point, the talairach grid, etc., and calls drawSelf for all VOIs.

Overrides:
paintComponent in class ViewJComponentEditImage
Parameters:
graphics - graphics to draw with

removeReference

public boolean removeReference(String label)
Remove a talairach / ACPC reference point.

Parameters:
label - the label of the reference point to remove
Returns:
true if the requested reference point was found and removed

setCenter

public void setCenter(int i,
                      int j,
                      int k)
setCenter, sets the crosshairPt and the local copies of the volumePosition (in FileCoordinates and PatientCoordinates).

Parameters:
i - FileCoordinates
j - FileCoordinates
k - FileCoordinates

setCrop

public void setCrop(WildMagic.LibFoundation.Mathematics.Vector3f lower,
                    WildMagic.LibFoundation.Mathematics.Vector3f upper)
Sets the crop volume.

Parameters:
lower - the lower corner of the crop volume in FileCoordinates
upper - the upper corner of the crop volume in FileCoordinates

setCrosshairPixelGap

public void setCrosshairPixelGap(int newGap)
Sets the pixel gap to be used by the crosshair (in one direction away from the center)

Parameters:
newGap - the new gap value

setCursorMode

public void setCursorMode(int newMode)
DOCUMENT ME!

Overrides:
setCursorMode in class ViewJComponentEditImage
Parameters:
newMode - DOCUMENT ME!

setDoCenter

public void setDoCenter(boolean doCenter)
Sets whether the center of rotation point should be displayed and the user should be allowed to change it.

Parameters:
doCenter - whether the center of rotation point should be displayed and the user should be allowed to change it

setIntensityLineVisible

public void setIntensityLineVisible(boolean visible)
Sets the intensity line to visible or invisible.

Parameters:
visible - true if the intensity line should be made visible, false otherwise

setProtractorVisible

public void setProtractorVisible(boolean visible)
Sets the protractor to either a visible or invisible state.

Parameters:
visible - true to set the protractor visible, false to set it invisible

setReferenceXY

public void setReferenceXY(int pointType,
                           WildMagic.LibFoundation.Mathematics.Vector3f pt)
Set a talairach / ACPC reference point.

Parameters:
pointType - the reference point type
pt - the point position (in image volume space)

setShowBoundingRect

public void setShowBoundingRect(boolean flag)
Sets whether the bounding rectangle should be drawn.

Parameters:
flag - whether the bounding rectangle should be drawn

setSnapProtractor90

public void setSnapProtractor90(boolean snapProtractor90)
Accessor to set the snapProtractor90 variable.

Parameters:
snapProtractor90 - DOCUMENT ME!

setXSliceHairColor

public void setXSliceHairColor(Color c)
Change the color for the x crosshair.

Parameters:
c - the new crosshair color

setYSliceHairColor

public void setYSliceHairColor(Color c)
Change the color for the y crosshair.

Parameters:
c - the new crosshair color

setZoom

public void setZoom(float zX,
                    float zY)
sets the screen scale variable when setZoom is called:

Overrides:
setZoom in class ViewJComponentBase
Parameters:
zX - new zoom factor in X
zY - new zoom factor in Y

setZSliceHairColor

public void setZSliceHairColor(Color c)
Change the color for the z crosshair.

Parameters:
c - the new crosshair color

show

public boolean show(int tSlice,
                    ModelLUT _LUTa,
                    ModelLUT _LUTb,
                    boolean forceShow,
                    int _interpMode)
DOCUMENT ME!

Parameters:
tSlice - DOCUMENT ME!
_LUTa - DOCUMENT ME!
_LUTb - DOCUMENT ME!
forceShow - DOCUMENT ME!
_interpMode - DOCUMENT ME!
Returns:
DOCUMENT ME!

showTalairachGrid

public void showTalairachGrid(boolean doShowTalairachGrid)
Sets whether or not lines dividing the Talairach regions are shown.

Parameters:
doShowTalairachGrid - whether to show the talairach region grid

showTalairachGridmarkers

public void showTalairachGridmarkers(boolean doShowTalairachGridmarkers)
Sets whether the talairach grid markers will be displayed.

Parameters:
doShowTalairachGridmarkers - boolean show talairach grid markers

update

public void update(Graphics g)
Calls paintComponent - reduces flicker.

Overrides:
update in class ViewJComponentBase
Parameters:
g - graphics to draw with

updateCrosshairPosition

public void updateCrosshairPosition(int x,
                                    int y)
Changes the crosshair coordinate (screen coordinate) that this component should display.

Parameters:
x - which x screen coordinate to show
y - which y screen coordinate to show
See Also:
#xSlice, #ySlice, #zSlice

finalize

protected void finalize()
                 throws Throwable
Clean up memory used by the component.

Overrides:
finalize in class ViewJComponentEditImage
Throws:
Throwable - if there is a problem encountered during memory clean-up
See Also:
disposeLocal(boolean)

makePaintImage

protected void makePaintImage(int[] paintImageBuffer,
                              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.

Overrides:
makePaintImage in class ViewJComponentBase
Parameters:
paintImageBuffer - int[] the buffer to fill that will make the paint image
paintBitmap - the bit map representing the painted pixels
slice - the current slice to paint if this is a 3D image
frame - the ViewJFrameBase containing the painted component.
b2D - when true this is a 2D image component, when false it is greater than 2D

updatePaintBitmap

protected void updatePaintBitmap(boolean paintPixels,
                                 int x,
                                 int y)
Updates the image volume's paint bitmap based on the current position of the mouse in the component, called after a mouse action indicates the user wants part of the image either painted or erased.

Parameters:
paintPixels - if true, the pixels under the paint brush should be painted. if false, they are cleared of any paint
x - the x position of the mouse, adjusted for zoom and resolutions
y - the y position of the mouse, adjusted for zoom and resolutions