|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public class ViewJComponentTriImage
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.
ViewJFrameTriImage
,
ViewJComponentDualTriImage
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
ANOTHER_PT
AC-PC: Another midsagittal reference point. |
static int |
ANTERIOR_PT
Talairach: Anterior reference point. |
static String |
DELETE_INTENSITY_LINE
used in the popup menu when the user right-clicks over a voi intensity line. |
protected boolean |
dragCenterPt
DOCUMENT ME! |
static int |
FIRST_PT
AC-PC: First midsagittal reference point. |
static int |
INFERIOR_EDGE
AC-PC: Inferior Edge reference point. |
static int |
INFERIOR_PT
Talairach: Inferior reference point. |
protected boolean |
intensityLineVisible
DOCUMENT ME! |
static int |
LEFT_PT
Talairach: Left reference point. |
static int |
POSTERIOR_MARGIN
AC-PC: Posterior Margin reference point. |
static int |
POSTERIOR_PT
Talairach: Posterior reference point. |
protected boolean |
protractorVisible
DOCUMENT ME! |
static int |
RIGHT_PT
Talairach: Right reference point. |
static String |
SHOW_INTENSITY_GRAPH
DOCUMENT ME! |
static int |
SUPERIOR_EDGE
AC-PC: Superior Edge reference point. |
static int |
SUPERIOR_PT
Talairach: Superior reference point. |
Fields inherited from class gov.nih.mipav.view.ViewJComponentBase |
---|
ANNOTATION, BILINEAR, BOTH, CENTER_VOI, CUBE_BOUNDS, DEFAULT, DELETE_POINT, DROPPER_PAINT, ELLIPSE, ERASER_PAINT, IMAGE_A, IMAGE_B, imageDim, img, imgB, interpMode, INTERPOLATE_A, INTERPOLATE_B, INTERPOLATE_BOTH, lastMouseX, lastMouseY, LEVELSET, LINE, LIVEWIRE, MAG_REGION, memImageA, memImageB, MOVE, MOVE_INTERSECTION_POINT, MOVE_POINT, MOVE_VOIPOINT, NEAREST, NEAREST_BOTH, NEW_POINT, NEW_VOI, OUT_OF_BOUNDS, PAINT_CAN, PAINT_VASC, PAINT_VOI, POINT_VOI, POLYLINE, POLYLINE_SLICE_VOI, PROBE, PROTRACTOR, QUICK_LUT, RECTANGLE, RECTANGLE3D, resolutionX, resolutionY, RETRACE, ROTATE, SELECT, showSliceNumber, sliceString, SMOOTH, SPLIT_VOI, textColor, TRANSLATE, WAND, WIN_REGION, ZOOMING_IN, ZOOMING_OUT, zoomX, zoomY |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ViewJComponentTriImage(ViewJFrameBase _frame,
ModelImage _imageA,
ModelLUT _LUTa,
float[] imgBufferA,
ModelImage _imageB,
ModelLUT _LUTb,
float[] imgBufferB,
int[] pixelBuffer,
float zoom,
int[] extents,
boolean logMagDisplay,
int _orientation)
The TriImage component constructor. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent event)
DOCUMENT ME! |
void |
computeTalairachVoxelPosition(int x,
int y)
Computes the talairach grid voxel from a screen coordinate. |
void |
deleteAllVOIs()
Delete all VOIs in the active image. |
void |
displayAxes(boolean doShowAxes)
Sets whether axes (either anatomical or x,y,z if no orientation info) are shown or not in one of the corners of the component. |
void |
displayXHairs(boolean doShowCrosshairs)
Sets whether or not crosshairs are shown in the images. |
void |
disposeLocal(boolean flag)
Sets all variables to null, disposes, and garbage collects (sometimes). |
protected void |
finalize()
Clean up memory used by the component. |
WildMagic.LibFoundation.Mathematics.Vector3f |
getCenter()
Returns the current center point in FileCoordinates: |
WildMagic.LibFoundation.Mathematics.Vector2f |
getCrosshairPoint()
Returns the current cross hair position in screen coordinates. |
int[] |
getExtents()
Returns the extents of the tri planar component (in the component's order, not the image volume's). |
float[] |
getResolutions()
DOCUMENT ME! |
WildMagic.LibFoundation.Mathematics.Vector2f |
getScreenCoordinates(WildMagic.LibFoundation.Mathematics.Vector3f point3d)
Accepts a point in volume space and converts it to screen space. |
double |
getTheta()
Accessor that returns the protractor angle. |
WildMagic.LibFoundation.Mathematics.Vector3f |
getVolumePosition(float x,
float y,
float z)
Translate a point on the x-y tri-image component into image volume space. |
Point3D |
getVolumePosition(int x,
int y,
int z)
Translate a point on the x-y tri-image component into image volume space. |
Color |
getXSliceHairColor()
Get the color for the crosshairPt.X crosshair. |
Color |
getYSliceHairColor()
Get the color for the ySlice crosshair. |
Color |
getZSliceHairColor()
Get the color for the zSlice crosshair. |
boolean |
isIntensityLineVisible()
Returns a boolean indicating whether the intensity line is currently visible or invisible. |
boolean |
isProtractorVisible()
Gets the status of the protractor. |
boolean |
isShowBoundingRect()
Returns whether the bounding rectangle should be drawn. |
void |
keyPressed(KeyEvent e)
keyReleased event method for KeyListener. |
protected void |
makePaintImage(int[] paintImageBuffer,
BitSet paintBitmap,
int slice,
ViewJFrameBase frame,
boolean b2D)
This method creates a buffer that will be used to make an image of the painted area on-screen. |
void |
makeProtractor()
Constructs and initializes one of the 3 protractors, depending on which component this is. |
void |
mouseClicked(MouseEvent mouseEvent)
When an image is double-clicked with the right-mouse button, the slice of the parent image is updated to match the current volume slice. |
void |
mouseDragged(MouseEvent mouseEvent)
A mouse-dragged event. |
void |
mouseEntered(MouseEvent mouseEvent)
Mouse entry handler: tells the parent tri-image frame about the current component orientation. |
void |
mouseExited(MouseEvent mouseEvent)
Mouse exit handler: repaints the image to get rid of the cursor if we are in a mode that custom draws the mouse cursor. |
void |
mouseMoved(MouseEvent mouseEvent)
A mouse event. |
void |
mousePressed(MouseEvent mouseEvent)
A mouse-pressed event. |
void |
mouseReleased(MouseEvent mouseEvent)
A mouse-released event. |
void |
mouseWheelMoved(MouseWheelEvent event)
Mouse wheel movement handler, used to change the displayed slice in the component. |
boolean |
nearBoundsPoint(int mouseX,
int mouseY,
int boundsX,
int boundsY)
Returns true if mouse point is close to bounds point. |
void |
paintComponent(Graphics graphics)
Paints the image, optionally draws the axis, the center of rotation point, the talairach grid, etc., and calls drawSelf for all VOIs. |
boolean |
removeReference(String label)
Remove a talairach / ACPC reference point. |
void |
setCenter(int i,
int j,
int k)
setCenter, sets the crosshairPt and the local copies of the volumePosition (in FileCoordinates and PatientCoordinates). |
void |
setCrop(WildMagic.LibFoundation.Mathematics.Vector3f lower,
WildMagic.LibFoundation.Mathematics.Vector3f upper)
Sets the crop volume. |
void |
setCrosshairPixelGap(int newGap)
Sets the pixel gap to be used by the crosshair (in one direction away from the center) |
void |
setCursorMode(int newMode)
DOCUMENT ME! |
void |
setDoCenter(boolean doCenter)
Sets whether the center of rotation point should be displayed and the user should be allowed to change it. |
void |
setIntensityLineVisible(boolean visible)
Sets the intensity line to visible or invisible. |
void |
setProtractorVisible(boolean visible)
Sets the protractor to either a visible or invisible state. |
void |
setReferenceXY(int pointType,
WildMagic.LibFoundation.Mathematics.Vector3f pt)
Set a talairach / ACPC reference point. |
void |
setShowBoundingRect(boolean flag)
Sets whether the bounding rectangle should be drawn. |
void |
setSnapProtractor90(boolean snapProtractor90)
Accessor to set the snapProtractor90 variable. |
void |
setXSliceHairColor(Color c)
Change the color for the x crosshair. |
void |
setYSliceHairColor(Color c)
Change the color for the y crosshair. |
void |
setZoom(float zX,
float zY)
sets the screen scale variable when setZoom is called: |
void |
setZSliceHairColor(Color c)
Change the color for the z crosshair. |
boolean |
show(int tSlice,
ModelLUT _LUTa,
ModelLUT _LUTb,
boolean forceShow,
int _interpMode)
DOCUMENT ME! |
void |
showTalairachGrid(boolean doShowTalairachGrid)
Sets whether or not lines dividing the Talairach regions are shown. |
void |
showTalairachGridmarkers(boolean doShowTalairachGridmarkers)
Sets whether the talairach grid markers will be displayed. |
void |
update(Graphics g)
Calls paintComponent - reduces flicker. |
void |
updateCrosshairPosition(int x,
int y)
Changes the crosshair coordinate (screen coordinate) that this component should display. |
protected void |
updatePaintBitmap(boolean paintPixels,
int x,
int y)
Updates the image volume's paint bitmap based on the current position of the mouse in the component, called after a mouse action indicates the user wants part of the image either painted or erased. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.event.KeyListener |
---|
keyReleased, keyTyped |
Field Detail |
---|
public static final int SUPERIOR_EDGE
public static final int POSTERIOR_MARGIN
public static final int INFERIOR_EDGE
public static final int FIRST_PT
public static final int ANOTHER_PT
public static final int ANTERIOR_PT
public static final int POSTERIOR_PT
public static final int SUPERIOR_PT
public static final int INFERIOR_PT
public static final int LEFT_PT
public static final int RIGHT_PT
public static final String DELETE_INTENSITY_LINE
public static final String SHOW_INTENSITY_GRAPH
protected boolean dragCenterPt
protected boolean intensityLineVisible
protected boolean protractorVisible
Constructor Detail |
---|
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)
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.
_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 imageMethod Detail |
---|
public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
event
- DOCUMENT ME!public void computeTalairachVoxelPosition(int x, int y)
x
- screen xy
- screen ypublic void deleteAllVOIs()
public void displayAxes(boolean doShowAxes)
doShowAxes
- whether to show the axespublic void displayXHairs(boolean doShowCrosshairs)
doShowCrosshairs
- whether to show the tri-image crosshairspublic void disposeLocal(boolean flag)
disposeLocal
in class ViewJComponentEditImage
flag
- if true garbage collector should be called.public WildMagic.LibFoundation.Mathematics.Vector3f getCenter()
public WildMagic.LibFoundation.Mathematics.Vector2f getCrosshairPoint()
public int[] getExtents()
public float[] getResolutions()
public WildMagic.LibFoundation.Mathematics.Vector2f getScreenCoordinates(WildMagic.LibFoundation.Mathematics.Vector3f point3d)
point3d
- Point3D the point in volume space
public double getTheta()
public final Point3D getVolumePosition(int x, int y, int z)
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)
public final WildMagic.LibFoundation.Mathematics.Vector3f getVolumePosition(float x, float y, float z)
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)
public Color getXSliceHairColor()
public Color getYSliceHairColor()
public Color getZSliceHairColor()
public boolean isIntensityLineVisible()
public boolean isProtractorVisible()
public boolean isShowBoundingRect()
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
keyPressed
in class ViewJComponentEditImage
e
- KeyEventpublic void makeProtractor()
public void mouseClicked(MouseEvent mouseEvent)
mouseClicked
in interface MouseListener
mouseClicked
in class ViewJComponentEditImage
mouseEvent
- mouse eventpublic void mouseDragged(MouseEvent mouseEvent)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class ViewJComponentEditImage
mouseEvent
- event that triggered functionpublic void mouseEntered(MouseEvent mouseEvent)
mouseEntered
in interface MouseListener
mouseEntered
in class ViewJComponentEditImage
mouseEvent
- event that triggers this functionpublic void mouseExited(MouseEvent mouseEvent)
mouseExited
in interface MouseListener
mouseExited
in class ViewJComponentEditImage
mouseEvent
- event that triggered functionpublic void mouseMoved(MouseEvent mouseEvent)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class ViewJComponentEditImage
mouseEvent
- event that triggered the functionpublic void mousePressed(MouseEvent mouseEvent)
mousePressed
in interface MouseListener
mousePressed
in class ViewJComponentEditImage
mouseEvent
- event that triggered this functionpublic void mouseReleased(MouseEvent mouseEvent)
mouseReleased
in interface MouseListener
mouseReleased
in class ViewJComponentEditImage
mouseEvent
- event that triggered this functionpublic void mouseWheelMoved(MouseWheelEvent event)
mouseWheelMoved
in interface MouseWheelListener
mouseWheelMoved
in class ViewJComponentEditImage
event
- the mouse wheel rotation eventpublic boolean nearBoundsPoint(int mouseX, int mouseY, int boundsX, int boundsY)
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
public void paintComponent(Graphics graphics)
paintComponent
in class ViewJComponentEditImage
graphics
- graphics to draw withpublic boolean removeReference(String label)
label
- the label of the reference point to remove
public void setCenter(int i, int j, int k)
i
- FileCoordinatesj
- FileCoordinatesk
- FileCoordinatespublic void setCrop(WildMagic.LibFoundation.Mathematics.Vector3f lower, WildMagic.LibFoundation.Mathematics.Vector3f upper)
lower
- the lower corner of the crop volume in FileCoordinatesupper
- the upper corner of the crop volume in FileCoordinatespublic void setCrosshairPixelGap(int newGap)
newGap
- the new gap valuepublic void setCursorMode(int newMode)
setCursorMode
in class ViewJComponentEditImage
newMode
- DOCUMENT ME!public void setDoCenter(boolean doCenter)
doCenter
- whether the center of rotation point should be displayed and the user should be allowed to
change itpublic void setIntensityLineVisible(boolean visible)
visible
- true if the intensity line should be made visible, false otherwisepublic void setProtractorVisible(boolean visible)
visible
- true to set the protractor visible, false to set it invisiblepublic void setReferenceXY(int pointType, WildMagic.LibFoundation.Mathematics.Vector3f pt)
pointType
- the reference point typept
- the point position (in image volume space)public void setShowBoundingRect(boolean flag)
flag
- whether the bounding rectangle should be drawnpublic void setSnapProtractor90(boolean snapProtractor90)
snapProtractor90
- DOCUMENT ME!public void setXSliceHairColor(Color c)
c
- the new crosshair colorpublic void setYSliceHairColor(Color c)
c
- the new crosshair colorpublic void setZoom(float zX, float zY)
setZoom
in class ViewJComponentBase
zX
- new zoom factor in XzY
- new zoom factor in Ypublic void setZSliceHairColor(Color c)
c
- the new crosshair colorpublic boolean show(int tSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int _interpMode)
tSlice
- DOCUMENT ME!_LUTa
- DOCUMENT ME!_LUTb
- DOCUMENT ME!forceShow
- DOCUMENT ME!_interpMode
- DOCUMENT ME!
public void showTalairachGrid(boolean doShowTalairachGrid)
doShowTalairachGrid
- whether to show the talairach region gridpublic void showTalairachGridmarkers(boolean doShowTalairachGridmarkers)
doShowTalairachGridmarkers
- boolean show talairach grid markerspublic void update(Graphics g)
paintComponent
- reduces flicker.
update
in class ViewJComponentBase
g
- graphics to draw withpublic void updateCrosshairPosition(int x, int y)
x
- which x screen coordinate to showy
- which y screen coordinate to show#xSlice
,
#ySlice
,
#zSlice
protected void finalize() throws Throwable
finalize
in class ViewJComponentEditImage
Throwable
- if there is a problem encountered during memory clean-updisposeLocal(boolean)
protected void makePaintImage(int[] paintImageBuffer, BitSet paintBitmap, int slice, ViewJFrameBase frame, boolean b2D)
makePaintImage
in class ViewJComponentBase
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 2Dprotected void updatePaintBitmap(boolean paintPixels, int x, int y)
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |