Class ViewJComponentTriImage
- All Implemented Interfaces:
PaintGrowListener,ScreenCoordinateListener,KeyListener,MouseListener,MouseMotionListener,MouseWheelListener,ImageObserver,MenuContainer,Serializable,EventListener
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAC-PC: Another midsagittal reference point.static final intTalairach: Anterior reference point.private final String[][]Labels for the axes:.private int[]private final WildMagic.LibFoundation.Mathematics.Vector3f[]Crop Bounding Box Corners in Screen Coordinates:.private final Color[]Crop Bounding Box Colors:.private final WildMagic.LibFoundation.Mathematics.Vector2f[]Crop Bounding Box in Screen Coordinates:.private intthe gap (in one direction) between the center of the crosshair and the actual crosshair lineprivate final WildMagic.LibFoundation.Mathematics.Vector3fThe x and y coordinate of the cursor position in screen space of this component.private booleanWhether to show the center of rotation point in the volume and allow the user to change it.private intDOCUMENT ME!protected booleanDOCUMENT ME!static final intAC-PC: First midsagittal reference point.private booleantrue if the imageActive has an orientation, false if imageActive is of FileInfoBase.UNKNOWN_ORIENT.private int[]DOCUMENT ME!static final intAC-PC: Inferior Edge reference point.static final intTalairach: Inferior reference point.static final intTalairach: Left reference point.private int[]imageActive extents in the local (Patient) coordinate system:.private final WildMagic.LibFoundation.Mathematics.Vector3fLower Crop Bounding Box in Patient Coordinates:.private final WildMagic.LibFoundation.Mathematics.Vector3fUpper Crop Bounding Box in Patient Coordinates:.private WildMagic.LibFoundation.Mathematics.Vector3fCursor 3D point in FileCoordinates.static final intAC-PC: Posterior Margin reference point.static final intTalairach: Posterior reference point.private float[]Reordered resolutions according to orientation.static final intTalairach: Right reference point.private static final longUse serialVersionUID for interoperability.protected booleanIf true, show XY, XZ, or ZY orientation axes in a corner of the component.protected booleanSpecifies whether the user wants to show the cropping / paint bounds rectangle.protected booleanIf true, show crosshairs indicating the currently position within the component.protected booleanWhether to show the talairach grid on the component.protected booleanWhether to show the talairach gridmarkers on the component.static final intAC-PC: Superior Edge reference point.static final intTalairach: Superior reference point.private final ColorDOCUMENT ME!private final ColorDOCUMENT ME!protected final ViewJFrameTriImageThe tri image frame of which this object is a component.private int[]DOCUMENT ME!private VOIProtractorThe protractor VOI.private final Color[]color of the crosshairs.private intprivate final Color[]DOCUMENT ME!private intprivate final Color[]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, zPGFields 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, zoomYFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionViewJComponentTriImage(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
Modifier and TypeMethodDescriptionvoidvoidcomputeTalairachVoxelPosition(int x, int y) Computes the talairach grid voxel from a screen coordinate.private voidCreates the four corners of the crop bounding box, based on the two corner crop points:voiddisplayAxes(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.voiddisplayXHairs(boolean doShowCrosshairs) Sets whether or not crosshairs are shown in the images.voiddisposeLocal(boolean flag) Sets all variables to null, disposes, and garbage collects (sometimes).WildMagic.LibFoundation.Mathematics.Vector3fDecrements the current slice in local coordinates and returns the new position in the view-independent file coordinates.private voiddrawAxes(Graphics2D offscreenGraphics2d) Convenience method called by paintComponent().private voiddrawBoundingRect(Graphics graphics) Draws the cropping rectangle.private voiddrawCenterMark(Graphics2D offscreenGraphics2d) Convenience method called by paintComponent().private voiddrawCrosshairLines(Graphics2D offscreenGraphics2d) Convenience method called by drawCrosshairsXY().private voiddrawCrosshairs(Graphics2D offscreenGraphics2d) Draws the crosshairs for this oriented tri-planar component.private voiddrawCrosshairStubs(Graphics2D offscreenGraphics2d) Convenience method called by drawCrosshairs.private voiddrawTalairachGrid_AXIAL(Graphics2D offscreenGraphics2d) Convenience method called by paintComponent().private voiddrawTalairachGrid_CORONAL(Graphics2D offscreenGraphics2d) Convenience method called by paintComponent().private voiddrawTalairachGrid_SAGITTAL(Graphics2D offscreenGraphics2d) Convenience method called by paintComponent().protected voidfinalize()Clean up memory used by the component.WildMagic.LibFoundation.Mathematics.Vector3fReturns the current center point in FileCoordinates:WildMagic.LibFoundation.Mathematics.Vector2fReturns the current cross hair position in screen coordinates.private BasicStrokeBuilds the dashed stroke used to render the minor talairach grid lines.int[]Returns the extents of the tri planar component (in the component's order, not the image volume's).WildMagic.LibFoundation.Mathematics.Vector3ffloat[]DOCUMENT ME!WildMagic.LibFoundation.Mathematics.Vector2fgetScreenCoordinates(WildMagic.LibFoundation.Mathematics.Vector3f point3d) Accepts a point in volume space and converts it to screen space.doublegetTheta()Accessor that returns the protractor angle.final WildMagic.LibFoundation.Mathematics.Vector3fgetVolumePosition(float x, float y, float z) Translate a point on the x-y tri-image component into image volume space.final Point3DgetVolumePosition(int x, int y, int z) Translate a point on the x-y tri-image component into image volume space.Get the color for the crosshairPt.X crosshair.Get the color for the ySlice crosshair.Get the color for the zSlice crosshair.booleanReturns whether the bounding rectangle should be drawn.voidkeyReleased event method for KeyListener.voidvoidprotected voidmakePaintImage(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.voidConstructs and initializes one of the 3 protractors, depending on which component this is.voidmouseClicked(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.voidmouseDragged(MouseEvent mouseEvent) A mouse-dragged event.voidmouseEntered(MouseEvent mouseEvent) Mouse entry handler: tells the parent tri-image frame about the current component orientation.voidmouseExited(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.voidmouseMoved(MouseEvent mouseEvent) A mouse event.voidmousePressed(MouseEvent mouseEvent) A mouse-pressed event.voidmouseReleased(MouseEvent mouseEvent) A mouse-released event.voidmouseWheelMoved(MouseWheelEvent event) Mouse wheel movement handler, used to change the displayed slice in the component.booleannearBoundsPoint(int mouseX, int mouseY, int boundsX, int boundsY) Returns true if mouse point is close to bounds point.voidpaintComponent(Graphics graphics) Paints the image, optionally draws the axis, the center of rotation point, the talairach grid, etc., and calls drawSelf for all VOIs.booleanremoveReference(String label) Remove a talairach / ACPC reference point.booleanscreenToFile(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt) booleanscreenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile) voidsetCenter(int i, int j, int k) setCenter, sets the crosshairPt and the local copies of the volumePosition (in FileCoordinates and PatientCoordinates).voidsetCrop(WildMagic.LibFoundation.Mathematics.Vector3f lower, WildMagic.LibFoundation.Mathematics.Vector3f upper) Sets the crop volume.voidsetCrosshairPixelGap(int newGap) Sets the pixel gap to be used by the crosshair (in one direction away from the center)voidsetCursorMode(int newMode) DOCUMENT ME!voidsetDoCenter(boolean doCenter) Sets whether the center of rotation point should be displayed and the user should be allowed to change it.voidsetReferenceXY(int pointType, WildMagic.LibFoundation.Mathematics.Vector3f pt) Set a talairach / ACPC reference point.voidsetShowBoundingRect(boolean flag) Sets whether the bounding rectangle should be drawn.voidChange the color for the x crosshair.voidChange the color for the y crosshair.voidsetZoom(float zX, float zY) sets the screen scale variable when setZoom is called:voidChange the color for the z crosshair.booleanDOCUMENT ME!voidshowTalairachGrid(boolean doShowTalairachGrid) Sets whether or not lines dividing the Talairach regions are shown.voidshowTalairachGridmarkers(boolean doShowTalairachGridmarkers) Sets whether the talairach grid markers will be displayed.private booleanshowUsingOrientation(int tSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int _interpMode) For generating the display of 1 or 2 RGB images.voidCallspaintComponent- reduces flicker.private voidupdateCrop(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.voidupdateCrosshairPosition(int x, int y) Changes the crosshair coordinate (screen coordinate) that this component should display.protected voidupdatePaintBitmap(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 voidupdateSlice(int newSlice) updates the slice value when the wheel is moved or the page_up, page_down keys are pressed.WildMagic.LibFoundation.Mathematics.Vector3fupSlice()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, useHighlightMethods 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, setZoomExactMethods 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, updateUIMethods 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, validateTreeMethods 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, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
SUPERIOR_EDGE
public static final int SUPERIOR_EDGEAC-PC: Superior Edge reference point. Used for conversions by the dialogs that create new AC-PC images.- See Also:
-
POSTERIOR_MARGIN
public static final int POSTERIOR_MARGINAC-PC: Posterior Margin reference point. Used for conversions by the dialogs that create new AC-PC images.- See Also:
-
INFERIOR_EDGE
public static final int INFERIOR_EDGEAC-PC: Inferior Edge reference point. Used for conversions by the dialogs that create new AC-PC images.- See Also:
-
FIRST_PT
public static final int FIRST_PTAC-PC: First midsagittal reference point. Used for conversions by the dialogs that create new AC-PC images.- See Also:
-
ANOTHER_PT
public static final int ANOTHER_PTAC-PC: Another midsagittal reference point. Used for conversions by the dialogs that create new AC-PC images.- See Also:
-
ANTERIOR_PT
public static final int ANTERIOR_PTTalairach: Anterior reference point. Used for conversions by the dialogs that create new Talairach images.- See Also:
-
POSTERIOR_PT
public static final int POSTERIOR_PTTalairach: Posterior reference point. Used for conversions by the dialogs that create new Talairach images.- See Also:
-
SUPERIOR_PT
public static final int SUPERIOR_PTTalairach: Superior reference point. Used for conversions by the dialogs that create new Talairach images.- See Also:
-
INFERIOR_PT
public static final int INFERIOR_PTTalairach: Inferior reference point. Used for conversions by the dialogs that create new Talairach images.- See Also:
-
LEFT_PT
public static final int LEFT_PTTalairach: Left reference point. Used for conversions by the dialogs that create new Talairach images.- See Also:
-
RIGHT_PT
public static final int RIGHT_PTTalairach: Right reference point. Used for conversions by the dialogs that create new Talairach images.- See Also:
-
dragCenterPt
protected boolean dragCenterPtDOCUMENT ME! -
axisLabels
Labels for the axes:. -
cornerCropPt
private final WildMagic.LibFoundation.Mathematics.Vector3f[] cornerCropPtCrop Bounding Box Corners in Screen Coordinates:. -
cropColor
Crop Bounding Box Colors:. -
cropPoints
private final WildMagic.LibFoundation.Mathematics.Vector2f[] cropPointsCrop Bounding Box in Screen Coordinates:. -
crosshairPt
private final WildMagic.LibFoundation.Mathematics.Vector3f crosshairPtThe x and y coordinate of the cursor position in screen space of this component. -
doCenter
private boolean doCenterWhether to show the center of rotation point in the volume and allow the user to change it.doCenteris set true by center command and set false by DEFAULT and CUBE_BOUNDS modes. -
dragBBpt
private int dragBBptDOCUMENT ME! -
hasOrientation
private boolean hasOrientationtrue if the imageActive has an orientation, false if imageActive is of FileInfoBase.UNKNOWN_ORIENT. -
horizontalTalGridPts
private int[] horizontalTalGridPtsDOCUMENT ME! -
localImageExtents
private int[] localImageExtentsimageActive extents in the local (Patient) coordinate system:. -
m_kLocalCropLower
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kLocalCropLowerLower Crop Bounding Box in Patient Coordinates:. -
m_kLocalCropUpper
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kLocalCropUpperUpper Crop Bounding Box in Patient Coordinates:. -
m_kVolumePoint
private WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumePointCursor 3D point in FileCoordinates. -
res
private float[] resReordered 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 showAxesIf true, show XY, XZ, or ZY orientation axes in a corner of the component. -
showBoundingRect
protected boolean showBoundingRectSpecifies whether the user wants to show the cropping / paint bounds rectangle. -
showCrosshairs
protected boolean showCrosshairsIf true, show crosshairs indicating the currently position within the component. -
showTalairachGrid
protected boolean showTalairachGridWhether to show the talairach grid on the component. -
showTalairachGridmarkers
protected boolean showTalairachGridmarkersWhether to show the talairach gridmarkers on the component. -
talairachMajorLineColor
DOCUMENT ME! -
talairachMinorLineColor
DOCUMENT ME! -
triImageFrame
The tri image frame of which this object is a component. -
verticalTalGridPts
private int[] verticalTalGridPtsDOCUMENT ME! -
voiProtractor
The protractor VOI. -
xColor
color of the crosshairs. -
yColor
DOCUMENT ME! -
zColor
DOCUMENT ME! -
crosshairPixelGap
private int crosshairPixelGapthe 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 Details
-
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 Details
-
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:
disposeLocalin 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
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
Get the color for the crosshairPt.X crosshair.- Returns:
- the x crosshair color
-
getYSliceHairColor
Get the color for the ySlice crosshair.- Returns:
- the y crosshair 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
keyReleased event method for KeyListener.- Specified by:
keyPressedin interfaceKeyListener- Parameters:
e- KeyEvent
-
keyReleased
- Specified by:
keyReleasedin interfaceKeyListener
-
keyTyped
- Specified by:
keyTypedin interfaceKeyListener
-
makeProtractor
public void makeProtractor()Constructs and initializes one of the 3 protractors, depending on which component this is. -
mouseClicked
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:
mouseClickedin interfaceMouseListener- Overrides:
mouseClickedin classViewJComponentEditImage- Parameters:
mouseEvent- mouse event
-
mouseDragged
A mouse-dragged event.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classViewJComponentEditImage- Parameters:
mouseEvent- event that triggered function
-
mouseEntered
Mouse entry handler: tells the parent tri-image frame about the current component orientation.- Specified by:
mouseEnteredin interfaceMouseListener- Overrides:
mouseEnteredin classViewJComponentEditImage- Parameters:
mouseEvent- event that triggers this function
-
mouseExited
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:
mouseExitedin interfaceMouseListener- Overrides:
mouseExitedin classViewJComponentEditImage- Parameters:
mouseEvent- event that triggered function
-
mouseMoved
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:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classViewJComponentEditImage- Parameters:
mouseEvent- event that triggered the function
-
mousePressed
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:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classViewJComponentEditImage- Parameters:
mouseEvent- event that triggered this function
-
mouseReleased
A mouse-released event. This function sets up and draws the VOI according to the mode.- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classViewJComponentEditImage- Parameters:
mouseEvent- event that triggered this function
-
mouseWheelMoved
Mouse wheel movement handler, used to change the displayed slice in the component.- Specified by:
mouseWheelMovedin interfaceMouseWheelListener- Overrides:
mouseWheelMovedin 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
Paints the image, optionally draws the axis, the center of rotation point, the talairach grid, etc., and calls drawSelf for all VOIs.- Overrides:
paintComponentin classViewJComponentEditImage- Parameters:
graphics- graphics to draw with
-
removeReference
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:
setCursorModein 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
Change the color for the x crosshair.- Parameters:
c- the new crosshair color
-
setYSliceHairColor
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:
setZoomin classViewJComponentBase- Parameters:
zX- new zoom factor in XzY- new zoom factor in Y
-
setZSliceHairColor
Change the color for the z crosshair.- Parameters:
c- the new crosshair color
-
show
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
CallspaintComponent- reduces flicker.- Overrides:
updatein 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:
-
finalize
Clean up memory used by the component.- Overrides:
finalizein classViewJComponentEditImage- Throws:
Throwable- if there is a problem encountered during memory clean-up- See Also:
-
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:
makePaintImagein 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
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d- Graphics2D
-
drawBoundingRect
Draws the cropping rectangle.- Parameters:
graphics- the graphics object to draw with
-
drawCenterMark
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d- Graphics2D
-
drawCrosshairLines
Convenience method called by drawCrosshairsXY(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d- Graphics2D
-
drawCrosshairs
Draws the crosshairs for this oriented tri-planar component.- Parameters:
offscreenGraphics2d- the graphics context to draw with
-
drawCrosshairStubs
Convenience method called by drawCrosshairs. Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d- Graphics2D
-
drawTalairachGrid_AXIAL
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d- Graphics2D
-
drawTalairachGrid_CORONAL
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d- Graphics2D
-
drawTalairachGrid_SAGITTAL
Convenience method called by paintComponent(). Inserted here for simplicity's sake.- Parameters:
offscreenGraphics2d- Graphics2D
-
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:
screenToFilein classViewJComponentEditImage
-
screenToFile
public boolean screenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile) - Overrides:
screenToFilein 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:
upSlicein 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:
downSlicein classViewJComponentEditImage- Returns:
-