Class ViewJComponentTriImage
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- gov.nih.mipav.view.ViewJComponentBase
-
- gov.nih.mipav.view.ViewJComponentEditImage
-
- gov.nih.mipav.view.ViewJComponentTriImage
-
- All Implemented Interfaces:
PaintGrowListener
,ScreenCoordinateListener
,java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
public class ViewJComponentTriImage extends ViewJComponentEditImage implements java.awt.event.MouseWheelListener, java.awt.event.KeyListener, ScreenCoordinateListener
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
-
-
Field Summary
Fields Modifier and Type Field Description static int
ANOTHER_PT
AC-PC: Another midsagittal reference point.static int
ANTERIOR_PT
Talairach: Anterior reference point.private java.lang.String[][]
axisLabels
Labels for the axes:.private int[]
axisOrientation
private WildMagic.LibFoundation.Mathematics.Vector3f[]
cornerCropPt
Crop Bounding Box Corners in Screen Coordinates:.private java.awt.Color[]
cropColor
Crop Bounding Box Colors:.private WildMagic.LibFoundation.Mathematics.Vector2f[]
cropPoints
Crop Bounding Box in Screen Coordinates:.private int
crosshairPixelGap
the gap (in one direction) between the center of the crosshair and the actual crosshair lineprivate WildMagic.LibFoundation.Mathematics.Vector3f
crosshairPt
The x and y coordinate of the cursor position in screen space of this component.private boolean
doCenter
Whether to show the center of rotation point in the volume and allow the user to change it.private int
dragBBpt
DOCUMENT ME!protected boolean
dragCenterPt
DOCUMENT ME!static int
FIRST_PT
AC-PC: First midsagittal reference point.private boolean
hasOrientation
true if the imageActive has an orientation, false if imageActive is of FileInfoBase.UNKNOWN_ORIENT.private int[]
horizontalTalGridPts
DOCUMENT ME!static int
INFERIOR_EDGE
AC-PC: Inferior Edge reference point.static int
INFERIOR_PT
Talairach: Inferior reference point.static int
LEFT_PT
Talairach: Left reference point.private int[]
localImageExtents
imageActive extents in the local (Patient) coordinate system:.private WildMagic.LibFoundation.Mathematics.Vector3f
m_kLocalCropLower
Lower Crop Bounding Box in Patient Coordinates:.private WildMagic.LibFoundation.Mathematics.Vector3f
m_kLocalCropUpper
Upper Crop Bounding Box in Patient Coordinates:.private WildMagic.LibFoundation.Mathematics.Vector3f
m_kVolumePoint
Cursor 3D point in FileCoordinates.static int
POSTERIOR_MARGIN
AC-PC: Posterior Margin reference point.static int
POSTERIOR_PT
Talairach: Posterior reference point.private float[]
res
Reordered resolutions according to orientation.static int
RIGHT_PT
Talairach: Right reference point.private static long
serialVersionUID
Use serialVersionUID for interoperability.protected boolean
showAxes
If true, show XY, XZ, or ZY orientation axes in a corner of the component.protected boolean
showBoundingRect
Specifies whether the user wants to show the cropping / paint bounds rectangle.protected boolean
showCrosshairs
If true, show crosshairs indicating the currently position within the component.protected boolean
showTalairachGrid
Whether to show the talairach grid on the component.protected boolean
showTalairachGridmarkers
Whether to show the talairach gridmarkers on the component.static int
SUPERIOR_EDGE
AC-PC: Superior Edge reference point.static int
SUPERIOR_PT
Talairach: Superior reference point.private java.awt.Color
talairachMajorLineColor
DOCUMENT ME!private java.awt.Color
talairachMinorLineColor
DOCUMENT ME!protected ViewJFrameTriImage
triImageFrame
The tri image frame of which this object is a component.private int[]
verticalTalGridPts
DOCUMENT ME!private VOIProtractor
voiProtractor
The protractor VOI.private java.awt.Color[]
xColor
color of the crosshairs.private int
xCursorAdjustment
private java.awt.Color[]
yColor
DOCUMENT ME!private int
yCursorAdjustment
private java.awt.Color[]
zColor
DOCUMENT ME!-
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, gridColor, gridLabelingOn, gridLabelOrientation, gridOverlayOn, gridSpacingX, gridSpacingY, 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, MultiFrameEyetrackerMode, nColumnCheckers, nRowCheckers, onTop, orientation, overlayOn, paintBitmap, paintBitmapBU, paintBitmapSwitch, paintBrush, paintBrushDim, paintBrushDimPrevious, paintBrushPrevious, paintBrushSize, paintBuffer, paintImage, paintImagePrevious, pixBuffer, pixBufferB, PluginEyetrackerMode, previousPaintBrush, rgbString, RGBTA, RGBTB, saveValue, saveValueB, saveValueG, saveValueR, saveX, saveY, saveZ, seedPaintBitmap, seedVal, seedValB, seedValG, seedValR, SingleFrameEyetrackerMode, sizeLimit, slice, stringOverride, time, timeSlice, toppedColor, useBComp, useGComp, useRComp, useVOI, variableThresholds, visRect, voiManager, winLevel, winLevelSet, xMod, xPG, xStart, yMod, yPG, yStart, zPG
-
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, 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_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, VOI_3D, WAND, WIN_REGION, ZOOMING_IN, ZOOMING_OUT, zoomX, zoomY
-
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 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearProtractor()
void
computeTalairachVoxelPosition(int x, int y)
Computes the talairach grid voxel from a screen coordinate.private void
cornerToCrop()
Creates the four corners of the crop bounding box, based on the two corner crop points: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).WildMagic.LibFoundation.Mathematics.Vector3f
downSlice()
Decrements the current slice in local coordinates and returns the new position in the view-independent file coordinates.private void
drawAxes(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent().private void
drawBoundingRect(java.awt.Graphics graphics)
Draws the cropping rectangle.private void
drawCenterMark(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent().private void
drawCrosshairLines(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by drawCrosshairsXY().private void
drawCrosshairs(java.awt.Graphics2D offscreenGraphics2d)
Draws the crosshairs for this oriented tri-planar component.private void
drawCrosshairStubs(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by drawCrosshairs.private void
drawTalairachGrid_AXIAL(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent().private void
drawTalairachGrid_CORONAL(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent().private void
drawTalairachGrid_SAGITTAL(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent().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.private java.awt.BasicStroke
getDashedStroke()
Builds the dashed stroke used to render the minor talairach grid lines.int[]
getExtents()
Returns the extents of the tri planar component (in the component's order, not the image volume's).WildMagic.LibFoundation.Mathematics.Vector3f
getProtractorCommonVertex()
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.java.awt.Color
getXSliceHairColor()
Get the color for the crosshairPt.X crosshair.java.awt.Color
getYSliceHairColor()
Get the color for the ySlice crosshair.java.awt.Color
getZSliceHairColor()
Get the color for the zSlice crosshair.boolean
isShowBoundingRect()
Returns whether the bounding rectangle should be drawn.void
keyPressed(java.awt.event.KeyEvent e)
keyReleased event method for KeyListener.void
keyReleased(java.awt.event.KeyEvent e)
void
keyTyped(java.awt.event.KeyEvent e)
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
makeProtractor()
Constructs and initializes one of the 3 protractors, depending on which component this is.void
mouseClicked(java.awt.event.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(java.awt.event.MouseEvent mouseEvent)
A mouse-dragged event.void
mouseEntered(java.awt.event.MouseEvent mouseEvent)
Mouse entry handler: tells the parent tri-image frame about the current component orientation.void
mouseExited(java.awt.event.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(java.awt.event.MouseEvent mouseEvent)
A mouse event.void
mousePressed(java.awt.event.MouseEvent mouseEvent)
A mouse-pressed event.void
mouseReleased(java.awt.event.MouseEvent mouseEvent)
A mouse-released event.void
mouseWheelMoved(java.awt.event.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(java.awt.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(java.lang.String label)
Remove a talairach / ACPC reference point.boolean
screenToFile(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
boolean
screenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)
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
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
setXSliceHairColor(java.awt.Color c)
Change the color for the x crosshair.void
setYSliceHairColor(java.awt.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(java.awt.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.private boolean
showUsingOrientation(int tSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int _interpMode)
For generating the display of 1 or 2 RGB images.void
update(java.awt.Graphics g)
CallspaintComponent
- reduces flicker.private void
updateCrop(int index, WildMagic.LibFoundation.Mathematics.Vector2f mousePoint)
Updates the crop bounding volume when a point on the crop bounding box is dragged with the mouse.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.private void
updateSlice(int newSlice)
updates the slice value when the wheel is moved or the page_up, page_down keys are pressed.WildMagic.LibFoundation.Mathematics.Vector3f
upSlice()
Increments the current slice in local coordinates and returns the new position in the view-independent file coordinates.-
Methods inherited from class gov.nih.mipav.view.ViewJComponentEditImage
calcPaintedVolume, cine, commitMask, commitMask, commitMask, commitMask, commitPaintToMask, commitPaintToUbyteMask, createImg, createImg, ctMode, dispose, draw3DVOIs, drawGradicules, drawStringBW, eraseAllPaint, fileToScreen, fileToScreenVOI, getActiveImage, getActiveImageBuffer, getActiveImageSliceBuffer, getActiveLUT, getActiveRGB, getAlphaBlend, getBandSpacing, getBrushSize, getCleanImageBufferB, getCursorMode, getFrame, getGridColor, getGridLabeling, getGridLabelOrientation, getGridOverlay, getGridSpacingX, getGridSpacingY, getHBrushSize, getImageA, getImageB, getImageBufferA, getImageBufferB, getIntensityDropper, getLUTa, getLUTb, getMaxExtents, getModifyFlag, getNumPoints, getnVOI, getOpacity, getOrientation, getOverlayOn, getPaintBitmap, getPaintBuffer, getPaintMask, getPixBuffer, getPixBufferB, getRASScannerPositionLabels, getRGBPaintComponents, getRGBTA, getRGBTB, getScannerPositionLabels, getShowMagIntensityEnabled, getSlice, getTimeSlice, getVOIHandler, getVOIManager, getxMod, getxSep, getxStart, getyMod, getySep, getyStart, getZoomMagnitudeX, getZoomMagnitudeY, isCheckerboardAnimate, isCheckerboarded, isHighlight, isMakingCheckerboard, isZeroToOneLUTAdj, loadPaintBrush, loopBandSpacing, loopBandSpacingReverse, mousePressedPaint, openUDLUTandTransferFunct, paintComponentForPrinter, paintMagComponent, patientToScreen, patientToScreenVOI, performPaint, performPaint, processDefaultMouseDrag, quickSwitchBrush, readLUTandTFunctFrom, recordPanning, recordZoom, regionGrow, regionGrow, regionGrow, regionGrow, regionGrow, regionGrowColor, rememberPaintBrushSize, resetLUT, resetLUTs, resetPaintBrushSize, restartCheckerboardAnimateThread, saveLUTandTransferFunction, saveUDLUT, screenToFile, screenToFileVOI, screenToFileVOI, screenToFileVOI, setActiveImage, setAlphaBlend, setBandSpacing, setBuffers, setCenter, setCheckerboard, setCheckerboardAnimate, setCrosshairCursor, setDisplayFuzzy, setDrawVOIs, setEnabled, setEyetrackerRecordingMode, setEyetrackerRecordMode, setFrameControls, setFullScreenModeLocation, setFuzzyThreshold, setGridColor, setGridLabelingOn, setGridLabelOrientation, setGridOverlay, setGridSpacingX, setGridSpacingY, setGrowDialog, setHasThreshold1, setHasThreshold2, setHighlightColor, setImageA, setImageB, setImageBufferB, setImageColocalize, setImageExtents, setImageSlice, setIntensityDropper, setLess, setLessB, setLessG, setLessR, setLogMagDisplay, setLUTa, setLUTb, setMakingCheckerboard, setMaxDistance, setModifyFlag, setMore, setMoreB, setMoreG, setMoreR, setOverlay, setPaintBitmapSwitch, setPaintBrushSize, setPaintMask, setPixelInformationAtLocation, setRegionGrowVars, setRGBPaintComponents, setRGBTA, setRGBTB, setShowMagIntensity, setShowSliceNum, setSizeLimit, setSlice, setStringOverride, setThresholdColors, setThresholds, setTimeSlice, setUseVOI, setVariableThresholds, setVOIManager, setWindLevel, setxSep, setySep, setZeroToOneLUTAdj, show, show, show, showBlank, showGridOverlay, showOverlay, showRegionInfo, showRegionInfo, showRegionInfo, showStatisticsCalculator, undoLastPaint, updatePaint, updatePaintBrushCursor, useHighlight
-
Methods inherited from class gov.nih.mipav.view.ViewJComponentBase
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, 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, 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
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gov.nih.mipav.view.renderer.WildMagic.VOI.ScreenCoordinateListener
fileToScreenVOI, getHeight, getResolutionX, getResolutionY, getSlice, getWidth, getZoomX, getZoomY, patientToScreenVOI, screenToFileVOI, screenToFileVOI, screenToFileVOI, setCenter
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
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
-
dragCenterPt
protected boolean dragCenterPt
DOCUMENT ME!
-
axisLabels
private final java.lang.String[][] axisLabels
Labels for the axes:.
-
cornerCropPt
private final WildMagic.LibFoundation.Mathematics.Vector3f[] cornerCropPt
Crop Bounding Box Corners in Screen Coordinates:.
-
cropColor
private final java.awt.Color[] cropColor
Crop Bounding Box Colors:.
-
cropPoints
private final WildMagic.LibFoundation.Mathematics.Vector2f[] cropPoints
Crop Bounding Box in Screen Coordinates:.
-
crosshairPt
private final WildMagic.LibFoundation.Mathematics.Vector3f crosshairPt
The x and y coordinate of the cursor position in screen space of this component.
-
doCenter
private boolean doCenter
Whether to show the center of rotation point in the volume and allow the user to change it.doCenter
is set true by center command and set false by DEFAULT and CUBE_BOUNDS modes.
-
dragBBpt
private int dragBBpt
DOCUMENT ME!
-
hasOrientation
private boolean hasOrientation
true if the imageActive has an orientation, false if imageActive is of FileInfoBase.UNKNOWN_ORIENT.
-
horizontalTalGridPts
private int[] horizontalTalGridPts
DOCUMENT ME!
-
localImageExtents
private int[] localImageExtents
imageActive extents in the local (Patient) coordinate system:.
-
m_kLocalCropLower
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kLocalCropLower
Lower Crop Bounding Box in Patient Coordinates:.
-
m_kLocalCropUpper
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kLocalCropUpper
Upper Crop Bounding Box in Patient Coordinates:.
-
m_kVolumePoint
private WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumePoint
Cursor 3D point in FileCoordinates.
-
res
private float[] res
Reordered resolutions according to orientation. See ModelStorageBase.getResolutions( int index, int orientation ). The orientation parameter may be either: FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL for oriented slices, or FileInfoBase.UNKNOWN_ORIENT for the default slice orientation.
-
showAxes
protected boolean showAxes
If true, show XY, XZ, or ZY orientation axes in a corner of the component.
-
showBoundingRect
protected boolean showBoundingRect
Specifies whether the user wants to show the cropping / paint bounds rectangle.
-
showCrosshairs
protected boolean showCrosshairs
If true, show crosshairs indicating the currently position within the component.
-
showTalairachGrid
protected boolean showTalairachGrid
Whether to show the talairach grid on the component.
-
showTalairachGridmarkers
protected boolean showTalairachGridmarkers
Whether to show the talairach gridmarkers on the component.
-
talairachMajorLineColor
private final java.awt.Color talairachMajorLineColor
DOCUMENT ME!
-
talairachMinorLineColor
private final java.awt.Color talairachMinorLineColor
DOCUMENT ME!
-
triImageFrame
protected final ViewJFrameTriImage triImageFrame
The tri image frame of which this object is a component.
-
verticalTalGridPts
private int[] verticalTalGridPts
DOCUMENT ME!
-
voiProtractor
private VOIProtractor voiProtractor
The protractor VOI.
-
xColor
private final java.awt.Color[] xColor
color of the crosshairs.
-
yColor
private final java.awt.Color[] yColor
DOCUMENT ME!
-
zColor
private final java.awt.Color[] zColor
DOCUMENT ME!
-
crosshairPixelGap
private int crosshairPixelGap
the gap (in one direction) between the center of the crosshair and the actual crosshair line
-
axisOrientation
private int[] axisOrientation
-
xCursorAdjustment
private int xCursorAdjustment
-
yCursorAdjustment
private int yCursorAdjustment
-
-
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 imageAimgBufferA
- storage buffer used to display imageA_imageB
- Model of the image that will be displayed_LUTb
- LUT used to display imageBimgBufferB
- storage buffer used to display imageBpixelBuffer
- storage buffer used to build a displayable imagezoom
- initial magnification of the imageextents
- initial display dimensions of the imagelogMagDisplay
- display log magnitude of the image_orientation
- display orientation of the image
-
-
Method Detail
-
clearProtractor
public void clearProtractor()
-
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 xy
- screen y
-
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 classViewJComponentEditImage
- 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
-
getProtractorCommonVertex
public WildMagic.LibFoundation.Mathematics.Vector3f getProtractorCommonVertex()
-
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 componenty
- y value of the point within the componentz
- 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 componenty
- y value of the point within the componentz
- the z coordinate ( usually == slice ) (the out-of-component dimension)- Returns:
- the point translated into the image volume
-
getXSliceHairColor
public java.awt.Color getXSliceHairColor()
Get the color for the crosshairPt.X crosshair.- Returns:
- the x crosshair color
-
getYSliceHairColor
public java.awt.Color getYSliceHairColor()
Get the color for the ySlice crosshair.- Returns:
- the y crosshair color
-
getZSliceHairColor
public java.awt.Color getZSliceHairColor()
Get the color for the zSlice crosshair.- Returns:
- the z crosshair color
-
isShowBoundingRect
public boolean isShowBoundingRect()
Returns whether the bounding rectangle should be drawn.- Returns:
- whether the bounding rectangle should be drawn
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
keyReleased event method for KeyListener.- Specified by:
keyPressed
in interfacejava.awt.event.KeyListener
- Parameters:
e
- KeyEvent
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleased
in interfacejava.awt.event.KeyListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- Specified by:
keyTyped
in interfacejava.awt.event.KeyListener
-
makeProtractor
public void makeProtractor()
Constructs and initializes one of the 3 protractors, depending on which component this is.
-
mouseClicked
public void mouseClicked(java.awt.event.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 interfacejava.awt.event.MouseListener
- Overrides:
mouseClicked
in classViewJComponentEditImage
- Parameters:
mouseEvent
- mouse event
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
A mouse-dragged event.- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in classViewJComponentEditImage
- Parameters:
mouseEvent
- event that triggered function
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
Mouse entry handler: tells the parent tri-image frame about the current component orientation.- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
- Overrides:
mouseEntered
in classViewJComponentEditImage
- Parameters:
mouseEvent
- event that triggers this function
-
mouseExited
public void mouseExited(java.awt.event.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 interfacejava.awt.event.MouseListener
- Overrides:
mouseExited
in classViewJComponentEditImage
- Parameters:
mouseEvent
- event that triggered function
-
mouseMoved
public void mouseMoved(java.awt.event.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 interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseMoved
in classViewJComponentEditImage
- Parameters:
mouseEvent
- event that triggered the function
-
mousePressed
public void mousePressed(java.awt.event.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 interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classViewJComponentEditImage
- Parameters:
mouseEvent
- event that triggered this function
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
A mouse-released event. This function sets up and draws the VOI according to the mode.- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classViewJComponentEditImage
- Parameters:
mouseEvent
- event that triggered this function
-
mouseWheelMoved
public void mouseWheelMoved(java.awt.event.MouseWheelEvent event)
Mouse wheel movement handler, used to change the displayed slice in the component.- Specified by:
mouseWheelMoved
in interfacejava.awt.event.MouseWheelListener
- Overrides:
mouseWheelMoved
in classViewJComponentEditImage
- 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 componentmouseY
- the y component of the mouse click within the componentboundsX
- the x component of the bounds point to check againstboundsY
- the y component of the bounds point to check against- Returns:
- true if mouse point is close to bounds point
-
paintComponent
public void paintComponent(java.awt.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 classViewJComponentEditImage
- Parameters:
graphics
- graphics to draw with
-
removeReference
public boolean removeReference(java.lang.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
- FileCoordinatesj
- FileCoordinatesk
- 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 FileCoordinatesupper
- 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 classViewJComponentEditImage
- 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
-
setReferenceXY
public void setReferenceXY(int pointType, WildMagic.LibFoundation.Mathematics.Vector3f pt)
Set a talairach / ACPC reference point.- Parameters:
pointType
- the reference point typept
- 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
-
setXSliceHairColor
public void setXSliceHairColor(java.awt.Color c)
Change the color for the x crosshair.- Parameters:
c
- the new crosshair color
-
setYSliceHairColor
public void setYSliceHairColor(java.awt.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 classViewJComponentBase
- Parameters:
zX
- new zoom factor in XzY
- new zoom factor in Y
-
setZSliceHairColor
public void setZSliceHairColor(java.awt.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(java.awt.Graphics g)
CallspaintComponent
- reduces flicker.- Overrides:
update
in classViewJComponentBase
- 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 showy
- which y screen coordinate to show- See Also:
#xSlice
,#ySlice
,#zSlice
-
finalize
protected void finalize() throws java.lang.Throwable
Clean up memory used by the component.- Overrides:
finalize
in classViewJComponentEditImage
- Throws:
java.lang.Throwable
- if there is a problem encountered during memory clean-up- See Also:
disposeLocal(boolean)
-
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.- Overrides:
makePaintImage
in classViewJComponentBase
- 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
-
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 paintx
- the x position of the mouse, adjusted for zoom and resolutionsy
- the y position of the mouse, adjusted for zoom and resolutions
-
cornerToCrop
private void cornerToCrop()
Creates the four corners of the crop bounding box, based on the two corner crop points:
-
drawAxes
private void drawAxes(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d
- Graphics2D
-
drawBoundingRect
private void drawBoundingRect(java.awt.Graphics graphics)
Draws the cropping rectangle.- Parameters:
graphics
- the graphics object to draw with
-
drawCenterMark
private void drawCenterMark(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d
- Graphics2D
-
drawCrosshairLines
private void drawCrosshairLines(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by drawCrosshairsXY(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d
- Graphics2D
-
drawCrosshairs
private void drawCrosshairs(java.awt.Graphics2D offscreenGraphics2d)
Draws the crosshairs for this oriented tri-planar component.- Parameters:
offscreenGraphics2d
- the graphics context to draw with
-
drawCrosshairStubs
private void drawCrosshairStubs(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by drawCrosshairs. Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d
- Graphics2D
-
drawTalairachGrid_AXIAL
private void drawTalairachGrid_AXIAL(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d
- Graphics2D
-
drawTalairachGrid_CORONAL
private void drawTalairachGrid_CORONAL(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d
- Graphics2D
-
drawTalairachGrid_SAGITTAL
private void drawTalairachGrid_SAGITTAL(java.awt.Graphics2D offscreenGraphics2d)
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d
- Graphics2D
-
getDashedStroke
private java.awt.BasicStroke getDashedStroke()
Builds the dashed stroke used to render the minor talairach grid lines.- Returns:
- the BasicStroke object used to render the minor talairach grid lines
-
showUsingOrientation
private boolean showUsingOrientation(int tSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int _interpMode)
For generating the display of 1 or 2 RGB images.- Parameters:
tSlice
- t (time) slice to show_LUTa
- DOCUMENT ME!_LUTb
- DOCUMENT ME!forceShow
- forces this method to import image and recalculate java image_interpMode
- DOCUMENT ME!- Returns:
- boolean to indicate if the show was successful
-
updateCrop
private void updateCrop(int index, WildMagic.LibFoundation.Mathematics.Vector2f mousePoint)
Updates the crop bounding volume when a point on the crop bounding box is dragged with the mouse. Converts the mousePoint to the crop corners, converts from Screen space to PatientCoordinates (ScreenToLocal), then converts from PatientCoordinates to FileCoordinates and passes the new crop volume information to the ViewJFrameTriImage container class.- Parameters:
index
- the index of the bounding box that changedmousePoint
- the screen-space coordinats of the changed bounding box point.
-
updateSlice
private void updateSlice(int newSlice)
updates the slice value when the wheel is moved or the page_up, page_down keys are pressed. Does bounds checking and comparison with the current slice value. Sets the new position and updates the triImageFrame.- Parameters:
newSlice
- the new slice value
-
screenToFile
public boolean screenToFile(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
- Overrides:
screenToFile
in classViewJComponentEditImage
-
screenToFile
public boolean screenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)
- Overrides:
screenToFile
in classViewJComponentEditImage
-
upSlice
public WildMagic.LibFoundation.Mathematics.Vector3f upSlice()
Increments the current slice in local coordinates and returns the new position in the view-independent file coordinates.- Overrides:
upSlice
in classViewJComponentEditImage
- Returns:
-
downSlice
public WildMagic.LibFoundation.Mathematics.Vector3f downSlice()
Decrements the current slice in local coordinates and returns the new position in the view-independent file coordinates.- Overrides:
downSlice
in classViewJComponentEditImage
- Returns:
-
-