Class ViewJComponentEditImage
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- gov.nih.mipav.view.ViewJComponentBase
-
- gov.nih.mipav.view.ViewJComponentEditImage
-
- All Implemented Interfaces:
PaintGrowListener
,ScreenCoordinateListener
,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
- Direct Known Subclasses:
ViewJComponentDTIImage
,ViewJComponentPedsAtlasIconImage
,ViewJComponentRegistration
,ViewJComponentSingleRegistration
,ViewJComponentTriImage
public class ViewJComponentEditImage extends ViewJComponentBase implements java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.MouseListener, PaintGrowListener, ScreenCoordinateListener
Basic displayable image object in MIPAV. Contains the viewable objects such as VOIs and carries listeners to most any action that can happen in a window.- Version:
- 0.1 Nov 18, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.awt.Color
ACTIVE_IMAGE_COLOR
Color used in the rectangle indicating the image is active.protected boolean
allActive
Set to true when all contours of a VOI are active.protected float
alphaBlend
Value used to control the display when compositing two images.protected float
alphaPrime
Value used to control the display when compositing two images.private int[]
bandSpacing
JDialogCheckerBoard
checkerDialog
Dialog used to set properties of the checkerboard display:(Image A displayed in alternating squares with Image B.private java.awt.Image
cleanImageB
DOCUMENT ME!protected int[]
cleanImageBufferA
Buffer used to store ARGB images of the image presently being displayed.protected int[]
cleanImageBufferB
Buffer used to store ARGB images of the image presently being displayed.protected java.awt.Cursor
crosshairCursor
Crosshair cursor that can be changed per user preference (in Mipav Options).protected int
cursorMode
Used to describe the cursor mode.protected boolean
displayFuzzy
DOCUMENT ME!private boolean
doCheckerboardAnimate
protected boolean
drawVOIs
Flag used to prohibit VOI drawing.private int
eyeTrackerRecordingMode
protected ViewJFrameBase
frame
Frame where the component image is displayed.protected ViewControlsImage
frameControls
Controls having color and opacity.protected float
fuzzyThreshold
Region grow parameters fuzzyConnectedness is not used if fuzzyThreshold is less than 0.static int
GEOMETRIC_ZOOM
Used to indicte geometric zoom steps (2x, 4x, 8x, 16x ...).protected java.awt.Color
gridColor
color of grid.protected boolean
gridLabelingOn
if number/lettering should be displayed for grid boxes.protected boolean
gridLabelOrientation
boolean to determine the orientation: true is x-axis numbered false is x-axis lettered.protected boolean
gridOverlayOn
Flag to indicate if NEI grid overlay should be displayed.protected float
gridSpacingX
spacing of the grid (horizontal) in terms of resolution.protected float
gridSpacingY
spacing of the grid (vertical) in terms of resolution.RegionGrowDialog
growDialog
Dialog used to control region growing of the paint tool.protected ModelImage
imageA
Model for image A.protected ModelImage
imageActive
Active image.protected ModelImage
imageB
Model for image B.protected float[]
imageBufferA
Buffer for image A, raw intensity.protected float[]
imageBufferActive
Buffer for active image.protected float[]
imageBufferB
Buffer for image B, raw intensity.protected int[]
imageExtents
The dimensionality of the image.protected JDialogVOIStatistics
imageStatList
DOCUMENT ME!float
intensityDropper
Used in paint to indicate intensity painted into the image.private boolean
intensityLabel
If true then the x,y location and pixel/voxel intensity should be displayed (x,y: intensity).private long
lastMouseEvent
private int
lastWinRegionSlice
Last slice the image was at when win region was ON. its necessary because otherwise, a new cleanImageB would have to be created upon every repaint. should be initialized to a negative numberprotected float
less
DOCUMENT ME!protected float
lessB
DOCUMENT ME!protected float
lessG
DOCUMENT ME!protected float
lessR
DOCUMENT ME!static int
LINEAR_ZOOM
Used to indicte linear zoom steps (2x, 3x, 4x, 5x ...).protected boolean
logMagDisplay
Flag for displaying logMag.protected ModelLUT
LUTa
Lookup table for image A.protected ModelLUT
LUTb
Lookup table for image B.protected PatientSlice
m_kPatientSlice
PatientSlice contains all the Patient Coordinate system view-specific data for rendering this component:.protected WindowLevel
m_kWinLevel
window / level mouse control:.int
MAGR_HEIGHT
Default size of magnifier window = 120 pixels.float
MAGR_MAG
Magnification value of magnifier window -- default = 4.0.int
MAGR_WIDTH
default = 120 pixels.protected JDialogMagnificationControls
magSettings
Dialog used to control the magnification of the image.private boolean
makingCheckerboard
protected float
maxDistance
DOCUMENT ME!protected int[]
maxExtents
DOCUMENT ME!protected boolean
modifyFlag
Used to "lock" display when an algorithm is in the calculation process.protected float
more
DOCUMENT ME!protected float
moreB
DOCUMENT ME!protected float
moreG
DOCUMENT ME!protected float
moreR
DOCUMENT ME!protected boolean
mousePressIsShiftDown
Keep track of state of shift for mouse Pressed events.static int
MultiFrameEyetrackerMode
protected int
nColumnCheckers
The number columns when two images are displayed in the checker board mode.protected int
nRowCheckers
Checkerboard display parameters.private java.awt.Image
offscreenImage
DOCUMENT ME!protected boolean
onTop
for the use of the user-notifier.protected int
orientation
orientation of the slice, may be AXIAL, CORONAL, SAGITTAL, or UNKNOWN_ORIENT.protected boolean
overlayOn
Flag to indicate if DICOM overlay should be displayed.protected java.util.BitSet
paintBitmap
Buffer used to indicate if the pixel location is painted (true) or unpainted (false).protected java.util.BitSet
paintBitmapBU
Backup of paint buffer for undo.protected boolean
paintBitmapSwitch
if true do not getMask on a setActiveImage command so as to keep the mask from the old active image.protected java.util.BitSet
paintBrush
BitSet used for painting (brushes on/off).protected java.awt.Dimension
paintBrushDim
Dimension of the paint.protected java.awt.Dimension
paintBrushDimPrevious
DOCUMENT ME!protected java.util.BitSet
paintBrushPrevious
DOCUMENT ME!protected int
paintBrushSize
Paint brush size.protected int[]
paintBuffer
protected java.awt.image.BufferedImage
paintImage
buffered image that is transparent to show the paintbrush cursor.private int[]
paintImageBuffer
This image indicates which images have been painted.protected java.awt.image.BufferedImage
paintImagePrevious
DOCUMENT ME!protected int[]
pixBuffer
The buffer used to store the ARGB image of the image presently being displayed.protected int[]
pixBufferB
Buffer used to store ARGB image of the windowed imageB.static int
PluginEyetrackerMode
protected int
previousPaintBrush
The previous paint brush we were using when the user temporarily changes the paint brush size using keyboard shortcuts (by pressing 1, 2, 3, 4).private java.lang.String
refPtsLocation
protected java.lang.String
rgbString
String representing RGB components used in applied paintprotected ModelRGB
RGBTA
DOCUMENT ME!protected ModelRGB
RGBTB
DOCUMENT ME!protected float
saveValue
Used with commitMask(int imagesDone), to save the value.protected float
saveValueB
DOCUMENT ME!protected float
saveValueG
DOCUMENT ME!protected float
saveValueR
DOCUMENT ME!protected short
saveX
Used with commitMask(int imagesDone), to save positions.protected short
saveY
Used with commitMask(int imagesDone), to save positions.protected short
saveZ
Used with commitMask(int imagesDone), to save positions.protected java.util.BitSet
seedPaintBitmap
Buffer used to remember the area painted around the last seed point for region growing.protected float
seedVal
Seed value to start the region grow.protected float
seedValB
DOCUMENT ME!protected float
seedValG
DOCUMENT ME!protected float
seedValR
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.private boolean
shiftDown
Flag used to indicate if the shift key is depressed.private boolean
showMagIntensity
Flag used to indicate that the intensity values of the image should be displayed in the magnified portion of the image.static int
SingleFrameEyetrackerMode
protected int
sizeLimit
DOCUMENT ME!protected int
slice
DOCUMENT ME!protected java.lang.String
stringOverride
String used to override the slice number in the lower left corner.protected long
time
DOCUMENT ME!protected int
timeSlice
DOCUMENT ME!protected java.awt.Color
toppedColor
DOCUMENT ME!protected boolean
useBComp
protected boolean
useGComp
protected boolean
useRComp
protected boolean
useVOI
This flag is used by the fuzzy connectedness to indicate that a VOI should be used to calculate certain values to initialize the process.protected boolean
variableThresholds
DOCUMENT ME!protected java.awt.Rectangle
visRect
Visible rectangle to draw topped.protected VOIManager
voiManager
private boolean
wasDragging
Boolean to determine if the mouse had been dragging before mouse release (for moving and setting active).private int
windowedRegionSize
The window region size of used when two images are displayed in the same frame.protected JDialogWinLevel
winLevel
protected boolean
winLevelSet
User invokes window and level adjustment with right mouse drag in DEFAULT mode.(package private) int
xMod
protected short
xPG
X coord of seed point.private int
xSep
(package private) int[]
xStart
(package private) int
yMod
protected short
yPG
Y coord of seed point.private int
ySep
(package private) int[]
yStart
private boolean
zeroToOneLUTAdj
flag indicating whether there is 0 to 1 LUT Adjustment *protected short
zPG
Z coord of seed point.-
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 ViewJComponentEditImage(ViewJFrameBase _frame, ModelImage _imageA, ModelLUT _LUTa, float[] imgBufferA, ModelImage _imageB, ModelLUT _LUTb, float[] imgBufferB, int[] pixelBuffer, float zoom, int[] extents, boolean logMagDisplay, int _orientation)
Constructor: ImageA and ImageB are expected to be of the same dimensionality !!
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private void
adjustOpacityFor000Color()
>>>>>>> .r533 The purpose of this method is to examine both LUTs to determine if they are zero-based, that is, if they map values of zero to the color R=0, G=0, B=0.private void
backupPaintBitmap()
Backs up the paintBitmap into the paintBitmapBU variable.private java.lang.String
buildOverlayStrings(FileInfoBase inf, java.lang.String name, java.lang.String attribString)
Builds the overlay Strings from the tag's value.void
calcPaintedVolume(java.lang.String str)
Calculates the volume of the painted voxels.void
cine(int ms)
Loops through the images and displays them.private void
cleanBuffer(int buffer)
DOCUMENT ME!void
commitMask(int imagesDone, boolean clearPaintMask, boolean polarity, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.void
commitMask(int imagesDone, boolean clearPaintMask, boolean polarity, java.util.Vector<java.lang.Integer> intensityLockVector, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.void
commitMask(int imagesDone, boolean clearPaintMask, boolean polarity, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.void
commitMask(ModelImage affectedImage, boolean clearPaintMask, boolean polarity, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.java.lang.String
commitPaintToMask()
Creates a new short image from the paint mask.java.lang.String
commitPaintToUbyteMask()
Creates a new ubyte image from the paint mask.boolean
createImg(int slice)
Creates the Java image to be displayed from the model image.boolean
createImg(int timeSlice, int slice)
Creates the Java image to be displayed from the model image.void
ctMode(int preset1, int preset2)
Sets mode to CT and sets range to CT presets.void
dispose(boolean flag)
Sets all variables to null, disposes, and garbage collects.void
disposeLocal(boolean flag)
Deprecated.Old method that does not match up with signature from VJCBase.WildMagic.LibFoundation.Mathematics.Vector3f
downSlice()
Decrements the current slice in local coordinates and returns the new position in the view-independent file coordinates.protected void
draw3DVOIs(java.awt.Graphics offscreenGraphics2d, boolean bBlend)
void
drawGradicules(java.awt.Graphics g, float xRes, float yRes)
Draws the gradicules (the half-image lines which demarcate lengths in the image).private void
drawImageText(java.awt.Graphics2D offscreenGraphics2d)
Draws text onto the image, such as the slice number.void
drawStringBW(java.lang.String str, java.awt.Graphics g, int x, int y)
Draws a white character on a black surround.void
eraseAllPaint(boolean onlyCurrent)
Erases all paint.WildMagic.LibFoundation.Mathematics.Vector3f
fileToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kFile)
WildMagic.LibFoundation.Mathematics.Vector3f
fileToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kFile)
Converts image file X,Y,Z coordinates into local screen coordinates.protected void
finalize()
Calls dispose to dump this instance.ModelImage
getActiveImage()
Returns the active image.float[]
getActiveImageBuffer()
Returns the active image buffer.float[]
getActiveImageSliceBuffer()
Returns the active image buffer for this slice.ModelLUT
getActiveLUT()
Returns the active image.ModelRGB
getActiveRGB()
Returns the active image.float
getAlphaBlend()
Returns float alphaBlend.int[]
getBandSpacing()
protected int
getBrushSize()
DOCUMENT ME!int[]
getCleanImageBufferB()
int
getCursorMode()
Returns the VOI mode.ViewJFrameBase
getFrame()
Returns the frame.java.awt.Color
getGridColor()
get the color of the grid.boolean
getGridLabeling()
Whether or not labels should be drawn on the grid overlay.boolean
getGridLabelOrientation()
DOCUMENT ME!boolean
getGridOverlay()
returns whether grid overlay is being displayed.float
getGridSpacingX()
returns the grid spacing in terms of resolution.float
getGridSpacingY()
returns the grid spacing in terms of resolution.protected int
getHBrushSize()
DOCUMENT ME!ModelImage
getImageA()
Returns the imageA.ModelImage
getImageB()
Returns the imageB.float[]
getImageBufferA()
Gets imageA's image buffer of intensities.float[]
getImageBufferB()
Gets imageB's image buffer of intensities.private java.lang.String
getImageTimeStamp()
Get the system timestamp.float
getIntensityDropper()
Gets the intensityDropper intensity.ModelLUT
getLUTa()
Returns the model lut for the imageA.ModelLUT
getLUTb()
Returns the model lut for the imageB.int[]
getMaxExtents()
boolean
getModifyFlag()
DOCUMENT ME!int
getNumPoints()
Finds the number of points in the active VOI contour.int
getnVOI()
Returns the number of VOIs in the active image.float
getOpacity()
Returns float opacity.int
getOrientation()
Returns the image's orientation.boolean
getOverlayOn()
Returns if image/dicom overlay should be shown.java.util.BitSet
getPaintBitmap()
Returns BitSet paintBitmap.int[]
getPaintBuffer()
Gets the paint buffer.java.util.BitSet
getPaintMask()
Gets the paint mask.int[]
getPixBuffer()
Gets the buffer used to store ARGB images of the image presently being displayed.int[]
getPixBufferB()
Gets the buffer used to store ARGB images of the image presently being displayed.static java.lang.String[]
getRASScannerPositionLabels(ModelImage image, WildMagic.LibFoundation.Mathematics.Vector3f position)
Gets position data to display in message bar - for DICOM and MINC images, gives patient position as well.java.lang.String
getRGBPaintComponents()
ModelRGB
getRGBTA()
Returns the ModelRGB RGBTA for imageA.ModelRGB
getRGBTB()
Returns the ModelRGB for imageB.static java.lang.String[]
getScannerPositionLabels(ModelImage image, WildMagic.LibFoundation.Mathematics.Vector3f position)
Gets position data to display in message bar - for DICOM and MINC images, gives patient position as well.boolean
getShowMagIntensityEnabled(int width, int height, float mag)
Determines whether to enable the showIntensity checkbox for magnification box.int
getSlice()
Returns the slice of the image.private java.lang.String
getTime()
Get the system timestamp.int
getTimeSlice()
Gets the time slice of the image.VOIHandlerInterface
getVOIHandler()
DOCUMENT ME!VOIManager
getVOIManager()
int
getxMod()
int
getxSep()
int[]
getxStart()
int
getyMod()
int
getySep()
int[]
getyStart()
private float
getZoomMagnitude(float zoom, boolean reverse)
Returns the magnitude zoom depending on the zoom mode.protected float
getZoomMagnitudeX(boolean reverse)
DOCUMENT ME!protected float
getZoomMagnitudeY(boolean reverse)
DOCUMENT ME!boolean
isCheckerboardAnimate()
boolean
isCheckerboarded()
Tells whether or not the image is being displayed in checkerboard mode.boolean
isHighlight()
boolean
isMakingCheckerboard()
boolean
isZeroToOneLUTAdj()
private java.awt.image.BufferedImage
loadImageFile(java.lang.String imageName)
Reads in an image icon from either the set of mipav icons or the user's $HOME/mipav/brushes/ directory.void
loadPaintBrush(java.lang.String paintName, boolean isQuick)
Loads built-in (.gif) or custom (.png) paint brushes based on the last-used paint brush in preferences.void
loopBandSpacing()
void
loopBandSpacingReverse()
private void
makeCheckerboard()
Sets the number of checkers in a row and a column.void
mouseClicked(java.awt.event.MouseEvent mouseEvent)
A mouse event.void
mouseDragged(java.awt.event.MouseEvent mouseEvent)
A mouse event.void
mouseEntered(java.awt.event.MouseEvent mouseEvent)
Store the lastMouse position.void
mouseExited(java.awt.event.MouseEvent mouseEvent)
Resets the level set stack.void
mouseMoved(java.awt.event.MouseEvent mouseEvent)
A mouse event.void
mousePressed(java.awt.event.MouseEvent mouseEvent)
A mouse event.protected void
mousePressedPaint(java.awt.event.MouseEvent mouseEvent)
When a mousePressed event is triggered and the mode is DROPPER_PAINT, ERASER_PAINT, PAINT_VOI, or MAG_REGION this function is called.void
mouseReleased(java.awt.event.MouseEvent mouseEvent)
A mouse event.void
mouseWheelMoved(java.awt.event.MouseWheelEvent mouseWheelEvent)
************************************************************************ ************************** Mouse Wheel Events *************************void
openUDLUTandTransferFunct()
Open the user defined LUT table and transfer function.void
paintComponent(java.awt.Graphics graphics)
Paints the image and calls drawSelf for all VOIs.void
paintComponentForPrinter(int tx, int ty, java.awt.Graphics g)
Paints the image and calls drawSelf for all VOIs and also resizes the image if it is too big for printer.void
paintMagComponent(java.awt.Graphics2D graphics2d)
Paints a magnified window over the image centered about the cursor.WildMagic.LibFoundation.Mathematics.Vector3f
patientToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
WildMagic.LibFoundation.Mathematics.Vector3f
patientToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
Converts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.protected void
performPaint(java.awt.event.MouseEvent event)
DOCUMENT ME!protected void
performPaint(java.awt.event.MouseEvent mouseEvent, boolean erase)
This method will set or clear the paint bitmap as the user paints on-screen.protected void
processDefaultMouseDrag(java.awt.event.MouseEvent mouseEvent, int xS, int yS)
processDefaultMouseDrag performs the mouseDrag operations when in DEFAULT mode.void
quickSwitchBrush()
Backups up ( and swaps if not null) the current and previously used paintBrush.void
readLUTandTFunctFrom(java.lang.String filename, java.lang.String dirName)
This method reads a LUT and Transfer function from a file diretory specified.private void
recordLineMeasure()
void
recordPanning()
void
recordZoom(boolean zoomIn)
void
regionGrow(short x, short y, short z, float valueR, float valueG, float valueB, ModelImage image, java.lang.String leadString, boolean click)
Grows a region based on a starting supplied.void
regionGrow(short x, short y, short z, float valueR, float valueG, float valueB, java.lang.String str, boolean click)
Grows a region based on a starting supplied.void
regionGrow(short x, short y, short z, float value, ModelImage image, java.lang.String leadString, boolean click)
Grows a region based on a starting supplied.void
regionGrow(short x, short y, short z, float value, java.lang.String str, boolean click)
Grows a region based on a starting supplied.void
regionGrow(java.lang.String str)
Grows a region based on a starting supplied.void
regionGrowColor(java.lang.String str)
Grows a region based on a starting supplied.void
rememberPaintBrushSize()
Remembers the current paint brush size so that it can be reset later.private void
repaintImageIntensityLabelFast(java.awt.Graphics2D graphics2d)
Repaints the image intensity label.private void
repaintPaintBrushCursorFast(java.awt.Graphics2D graphics2d)
Repaints the paint brush cursor without repainting the entire image.void
resetLUT(ModelLUT LUT, ModelImage image)
DOCUMENT ME!void
resetLUTs()
Resets the LUTs.void
resetPaintBrushSize()
Resets the paint brush size to the remembered value.private void
resetRGB(ModelRGB RGBT)
DOCUMENT ME!void
restartCheckerboardAnimateThread()
void
saveLUTandTransferFunction(java.lang.String filename, java.lang.String dirName)
This method saves the LUT for the active image.void
saveUDLUT()
Save user defined LUT table.boolean
screenToFile(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
WildMagic.LibFoundation.Mathematics.Vector3f
screenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
boolean
screenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)
boolean
screenToFileVOI(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.WildMagic.LibFoundation.Mathematics.Vector3f
screenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.boolean
screenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)
Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.void
setActiveImage(int active)
Sets the active image for drawing VOIs.void
setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.void
setBandSpacing(int[] bandSpacing)
void
setBuffers(float[] imgBufferA, float[] imgBufferB, int[] pixBuff, int[] pixBuffB)
The frame in which the image(s) is displayed, allocates the memory and uses this method to pass the references to the buffers.void
setCenter(WildMagic.LibFoundation.Mathematics.Vector3f center)
Sets the currently displayed image slice.void
setCheckerboard(int rowCheckers, int columnCheckers)
Sets the image to display in "Checkerboard" mode with the given numbers of rows and columns.void
setCheckerboardAnimate(boolean doCheckerboardAnimate)
void
setCrosshairCursor(java.awt.Cursor curs)
Changes the Crosshair cursor to be either the default crosshair or a pre-existing gif.void
setCursorMode(int mode)
Switches modes based on the variable mode.void
setDisplayFuzzy(boolean val)
Sets whether a fuzzy image is displayed.void
setDrawVOIs(boolean drawVOIs)
void
setEnabled(boolean flag)
Enables or disables the component for modification.void
setEyetrackerRecordingMode(int modeType)
Set the eye tracking recording mode typevoid
setEyetrackerRecordMode(int modeType)
void
setFrameControls(ViewControlsImage controls)
Sets the frameControls.void
setFullScreenModeLocation(java.lang.String _location)
void
setFuzzyThreshold(float val)
Sets whether fuzzy connectedness is used and the fuzzy threshold.void
setGridColor(java.awt.Color color)
set the color of the grid.void
setGridLabelingOn(boolean doLabel)
Tells the grid overlay (if on) to show abc/123 labeling.void
setGridLabelOrientation(boolean or)
Sets the axis orientation of abc and 123 labeling of the grid overlay.void
setGridOverlay(boolean flag)
Sets whether or not to show the NEI grid overlay.void
setGridSpacingX(float spacing)
sets the grid spacing (horizontal) in terms of resolution.void
setGridSpacingY(float spacing)
sets the grid spacing (horizontal) in terms of resolution.void
setGrowDialog(RegionGrowDialog dialog)
Sets the RegionGrowDialog for this class (usually used to set it to null).void
setHasThreshold1(boolean hasThreshold1)
Sets the hasThreshold1 for setPaintBuffers.void
setHasThreshold2(boolean hasThreshold2)
Sets the hasThreshold2 for setPaintBuffers.void
setHighlightColor(java.awt.Color c)
Changes the color used to highlight the currently on-top image.void
setImageA(ModelImage image)
Sets component's ImageA. assumes dimensionality same as image B's for now.void
setImageB(ModelImage image)
Sets component's ImageB. !!!!!!void
setImageBufferB(float[] buffer)
Sets component's ImageB buffer.void
setImageColocalize(ModelImage imageColocalize)
Sets the colocalize image.void
setImageExtents(int[] imageExtents)
DOCUMENT ME!void
setImageSlice(int slice)
Set the image slice number, and recording the action as slider changes on single eye tracker viewer.void
setIntensityDropper(float intensityDropper)
Sets the intensityDropper intensity.void
setLess(float val)
Sets less for regionGrow.void
setLessB(float val)
Sets lessB for regionGrow.void
setLessG(float val)
Sets lessG for regionGrow.void
setLessR(float val)
Sets lessR for regionGrow.void
setLogMagDisplay(boolean flag)
Sets the log magnitude display flag.void
setLUTa(ModelLUT LUT)
accessor that sets the model LUT for the imageA.void
setLUTb(ModelLUT LUT)
Sets the model LUTb for the imageB.void
setMakingCheckerboard(boolean makingCheckerboard)
void
setMaxDistance(int val)
Sets maxDistance for regionGrow.void
setModifyFlag(boolean flag)
DOCUMENT ME!void
setMore(float val)
Sets more for regionGrow.void
setMoreB(float val)
Sets moreB for regionGrow.void
setMoreG(float val)
Sets moreG for regionGrow.void
setMoreR(float val)
Sets moreR for regionGrow.void
setOverlay(boolean flag)
Sets whether or not to show the overlay.void
setPaintBitmapSwitch(boolean paintBitmapSwitch)
If true do not getMask on a setActiveImage command so as to keep the mask from the old active image.void
setPaintBrushSize(int paintBrushSize)
Switches modes based on the variable mode.void
setPaintMask(java.util.BitSet mask)
Sets the paint mask.void
setPixelInformationAtLocation(int xS, int yS, boolean isControlDown)
Prints ModelImage information at the mouse location.void
setRegionGrowVars(short x, short y, short z, float val)
Sets the variables used to remember the point where the last region grow was started from.void
setRGBPaintComponents(java.lang.String rgb)
void
setRGBTA(ModelRGB RGBT)
Sets the RGB table for ARGB image A.void
setRGBTB(ModelRGB RGBT)
Sets the RGB table for ARGB image B.void
setShowMagIntensity(boolean flag)
Sets whether to show intensity in mag. boxvoid
setShowSliceNum(boolean flag)
Sets whether the slice number will be shown in the lower left hand corner of the image.void
setSizeLimit(int val)
Sets sizeLimit for regionGrow.void
setSlice(int _slice)
Sets the slice of the image.void
setStringOverride(java.lang.String str)
Sets the string painted on the lower left.void
setThresholdColors(boolean useRedThreshold, boolean useGreenThreshold, boolean useBlueThreshold)
Sets the booleans for using thresholds in setColorPaintBuffers.void
setThresholds(float threshold1, float threshold2)
Sets the thresholds.void
setTimeSlice(int _slice)
Sets the time slice of the image.void
setUseVOI(boolean val)
Sets whether a selected VOI is used to calculate the initial variance.void
setVariableThresholds(boolean variableThresholds)
If true varies thresholds with region growth.void
setVOIManager(VOIManager kManager)
void
setWindLevel(int window, int level)
Set the window level value from the eye trackervoid
setxSep(int xSep)
void
setySep(int ySep)
void
setZeroToOneLUTAdj(boolean zeroToOneLUTAdj)
boolean
show(int tSlice, int zSlice, boolean forceShow)
For generating the display of 1 or 2 images.boolean
show(int tSlice, int zSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow)
Shows the image and the VOI(s).boolean
show(int tSlice, int zSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)
Shows the image and the VOI(s).boolean
showBlank()
Resets the buffer to 0s and displays a blank image.protected void
showGridOverlay(java.awt.Graphics g)
Draws a grid on top of the image according to the gridSpacingX and gridSpacingY.void
showOverlay(java.awt.Graphics g)
Displays Image overlays (DICOM or image attributes).void
showRegionInfo(int count, double[] total, double[] mean, double[] stdDev, java.lang.String leadString)
Display statistics about the grown region.void
showRegionInfo(int count, float[] total, float[] mean, float[] stdDev, java.lang.String leadString)
Display statistics about the grown region.void
showRegionInfo(int count, java.lang.String leadString)
Display statistics about the grown region.void
showStatisticsCalculator()
Opens a JDialogStatistics to allow computation ofROI statistics.void
undoLastPaint()
Undoes the last paint.void
updatePaint(java.util.BitSet region, boolean backup, boolean isGrower)
Causes the image to update its paint bit mask and redisplay itself.void
updatePaintBrushCursor()
Updates the Paint Cursor's BufferedImage with the correct color/opacity.WildMagic.LibFoundation.Mathematics.Vector3f
upSlice()
Increments the current slice in local coordinates and returns the new position in the view-independent file coordinates.void
useHighlight(boolean hilite)
Sets this component to paint the "on top" high-light.-
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, makePaintImage, paintCursorBoxComponent, paintWindowComponent, paintWindowComponent, ScreenToLocal, setInterpolationMode, setResolutions, setShowSliceNumber, setSliceString, setTextColor, setZoom, setZoomExact, update
-
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
getHeight, getResolutionX, getResolutionY, getWidth, getZoomX, getZoomY
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
ACTIVE_IMAGE_COLOR
public static java.awt.Color ACTIVE_IMAGE_COLOR
Color used in the rectangle indicating the image is active. Images which are not active will not have the recangle drawn.
-
GEOMETRIC_ZOOM
public static final int GEOMETRIC_ZOOM
Used to indicte geometric zoom steps (2x, 4x, 8x, 16x ...).- See Also:
- Constant Field Values
-
LINEAR_ZOOM
public static final int LINEAR_ZOOM
Used to indicte linear zoom steps (2x, 3x, 4x, 5x ...).- See Also:
- Constant Field Values
-
checkerDialog
public JDialogCheckerBoard checkerDialog
Dialog used to set properties of the checkerboard display:(Image A displayed in alternating squares with Image B.
-
growDialog
public RegionGrowDialog growDialog
Dialog used to control region growing of the paint tool.
-
intensityDropper
public float intensityDropper
Used in paint to indicate intensity painted into the image.
-
MAGR_HEIGHT
public int MAGR_HEIGHT
Default size of magnifier window = 120 pixels.
-
MAGR_MAG
public float MAGR_MAG
Magnification value of magnifier window -- default = 4.0.
-
MAGR_WIDTH
public int MAGR_WIDTH
default = 120 pixels.
-
allActive
protected boolean allActive
Set to true when all contours of a VOI are active.
-
alphaBlend
protected float alphaBlend
Value used to control the display when compositing two images. Usually = 1 - alphaPrime.
-
alphaPrime
protected float alphaPrime
Value used to control the display when compositing two images. It is the amount of image A to display and is has a range of [0,1]
-
rgbString
protected java.lang.String rgbString
String representing RGB components used in applied paint
-
cleanImageBufferA
protected int[] cleanImageBufferA
Buffer used to store ARGB images of the image presently being displayed.
-
cleanImageBufferB
protected int[] cleanImageBufferB
Buffer used to store ARGB images of the image presently being displayed.
-
crosshairCursor
protected java.awt.Cursor crosshairCursor
Crosshair cursor that can be changed per user preference (in Mipav Options).
-
cursorMode
protected int cursorMode
Used to describe the cursor mode.
-
displayFuzzy
protected boolean displayFuzzy
DOCUMENT ME!
-
drawVOIs
protected boolean drawVOIs
Flag used to prohibit VOI drawing.
-
frame
protected ViewJFrameBase frame
Frame where the component image is displayed.
-
frameControls
protected ViewControlsImage frameControls
Controls having color and opacity.
-
fuzzyThreshold
protected float fuzzyThreshold
Region grow parameters fuzzyConnectedness is not used if fuzzyThreshold is less than 0. When fuzzyConnectedness is used, fuzzyThreshold ranges from 0 to 1.
-
imageA
protected ModelImage imageA
Model for image A.
-
imageActive
protected ModelImage imageActive
Active image.
-
imageB
protected ModelImage imageB
Model for image B.
-
imageBufferA
protected float[] imageBufferA
Buffer for image A, raw intensity.
-
imageBufferActive
protected float[] imageBufferActive
Buffer for active image.
-
imageBufferB
protected float[] imageBufferB
Buffer for image B, raw intensity.
-
imageExtents
protected int[] imageExtents
The dimensionality of the image.
-
imageStatList
protected JDialogVOIStatistics imageStatList
DOCUMENT ME!
-
less
protected float less
DOCUMENT ME!
-
lessB
protected float lessB
DOCUMENT ME!
-
lessG
protected float lessG
DOCUMENT ME!
-
lessR
protected float lessR
DOCUMENT ME!
-
logMagDisplay
protected boolean logMagDisplay
Flag for displaying logMag.
-
LUTa
protected ModelLUT LUTa
Lookup table for image A.
-
LUTb
protected ModelLUT LUTb
Lookup table for image B.
-
m_kPatientSlice
protected PatientSlice m_kPatientSlice
PatientSlice contains all the Patient Coordinate system view-specific data for rendering this component:.
-
magSettings
protected JDialogMagnificationControls magSettings
Dialog used to control the magnification of the image.
-
maxDistance
protected float maxDistance
DOCUMENT ME!
-
maxExtents
protected int[] maxExtents
DOCUMENT ME!
-
modifyFlag
protected boolean modifyFlag
Used to "lock" display when an algorithm is in the calculation process.
-
more
protected float more
DOCUMENT ME!
-
moreB
protected float moreB
DOCUMENT ME!
-
moreG
protected float moreG
DOCUMENT ME!
-
moreR
protected float moreR
DOCUMENT ME!
-
mousePressIsShiftDown
protected boolean mousePressIsShiftDown
Keep track of state of shift for mouse Pressed events.
-
nColumnCheckers
protected int nColumnCheckers
The number columns when two images are displayed in the checker board mode.
-
nRowCheckers
protected int nRowCheckers
Checkerboard display parameters. The number of rows to display.
-
onTop
protected boolean onTop
for the use of the user-notifier.
-
orientation
protected int orientation
orientation of the slice, may be AXIAL, CORONAL, SAGITTAL, or UNKNOWN_ORIENT.
-
paintBitmap
protected java.util.BitSet paintBitmap
Buffer used to indicate if the pixel location is painted (true) or unpainted (false).
-
paintBitmapBU
protected java.util.BitSet paintBitmapBU
Backup of paint buffer for undo.
-
paintBitmapSwitch
protected boolean paintBitmapSwitch
if true do not getMask on a setActiveImage command so as to keep the mask from the old active image.
-
paintBrush
protected java.util.BitSet paintBrush
BitSet used for painting (brushes on/off).
-
paintBrushDim
protected java.awt.Dimension paintBrushDim
Dimension of the paint.
-
paintBrushDimPrevious
protected java.awt.Dimension paintBrushDimPrevious
DOCUMENT ME!
-
paintBrushPrevious
protected java.util.BitSet paintBrushPrevious
DOCUMENT ME!
-
paintBrushSize
protected int paintBrushSize
Paint brush size.
-
paintImage
protected java.awt.image.BufferedImage paintImage
buffered image that is transparent to show the paintbrush cursor.
-
paintImagePrevious
protected java.awt.image.BufferedImage paintImagePrevious
DOCUMENT ME!
-
pixBuffer
protected int[] pixBuffer
The buffer used to store the ARGB image of the image presently being displayed.
-
pixBufferB
protected int[] pixBufferB
Buffer used to store ARGB image of the windowed imageB.
-
previousPaintBrush
protected int previousPaintBrush
The previous paint brush we were using when the user temporarily changes the paint brush size using keyboard shortcuts (by pressing 1, 2, 3, 4).
-
RGBTA
protected ModelRGB RGBTA
DOCUMENT ME!
-
RGBTB
protected ModelRGB RGBTB
DOCUMENT ME!
-
saveValue
protected float saveValue
Used with commitMask(int imagesDone), to save the value.
-
saveValueB
protected float saveValueB
DOCUMENT ME!
-
saveValueG
protected float saveValueG
DOCUMENT ME!
-
saveValueR
protected float saveValueR
DOCUMENT ME!
-
saveX
protected short saveX
Used with commitMask(int imagesDone), to save positions.
-
saveY
protected short saveY
Used with commitMask(int imagesDone), to save positions.
-
saveZ
protected short saveZ
Used with commitMask(int imagesDone), to save positions.
-
seedPaintBitmap
protected java.util.BitSet seedPaintBitmap
Buffer used to remember the area painted around the last seed point for region growing.
-
seedVal
protected float seedVal
Seed value to start the region grow.
-
seedValB
protected float seedValB
DOCUMENT ME!
-
seedValG
protected float seedValG
DOCUMENT ME!
-
seedValR
protected float seedValR
DOCUMENT ME!
-
sizeLimit
protected int sizeLimit
DOCUMENT ME!
-
slice
protected int slice
DOCUMENT ME!
-
stringOverride
protected java.lang.String stringOverride
String used to override the slice number in the lower left corner.
-
time
protected long time
DOCUMENT ME!
-
timeSlice
protected int timeSlice
DOCUMENT ME!
-
toppedColor
protected java.awt.Color toppedColor
DOCUMENT ME!
-
useVOI
protected boolean useVOI
This flag is used by the fuzzy connectedness to indicate that a VOI should be used to calculate certain values to initialize the process.
-
variableThresholds
protected boolean variableThresholds
DOCUMENT ME!
-
visRect
protected java.awt.Rectangle visRect
Visible rectangle to draw topped.
-
winLevelSet
protected boolean winLevelSet
User invokes window and level adjustment with right mouse drag in DEFAULT mode.
-
xPG
protected short xPG
X coord of seed point.
-
yPG
protected short yPG
Y coord of seed point.
-
zPG
protected short zPG
Z coord of seed point.
-
cleanImageB
private java.awt.Image cleanImageB
DOCUMENT ME!
-
intensityLabel
private boolean intensityLabel
If true then the x,y location and pixel/voxel intensity should be displayed (x,y: intensity).
-
lastWinRegionSlice
private int lastWinRegionSlice
Last slice the image was at when win region was ON. its necessary because otherwise, a new cleanImageB would have to be created upon every repaint. should be initialized to a negative number
-
m_kWinLevel
protected WindowLevel m_kWinLevel
window / level mouse control:.
-
offscreenImage
private java.awt.Image offscreenImage
DOCUMENT ME!
-
paintImageBuffer
private int[] paintImageBuffer
This image indicates which images have been painted.
-
shiftDown
private boolean shiftDown
Flag used to indicate if the shift key is depressed. True indicates the shift key is depressed.
-
showMagIntensity
private boolean showMagIntensity
Flag used to indicate that the intensity values of the image should be displayed in the magnified portion of the image. The intensity values can only be shown if the magnification is high enough to fit the text representation of the value in the magnified voxel/pixel.
-
wasDragging
private boolean wasDragging
Boolean to determine if the mouse had been dragging before mouse release (for moving and setting active).
-
windowedRegionSize
private int windowedRegionSize
The window region size of used when two images are displayed in the same frame. The size of the window indicates how much of image B is displayed.
-
useRComp
protected boolean useRComp
-
useGComp
protected boolean useGComp
-
useBComp
protected boolean useBComp
-
zeroToOneLUTAdj
private boolean zeroToOneLUTAdj
flag indicating whether there is 0 to 1 LUT Adjustment *
-
paintBuffer
protected int[] paintBuffer
-
gridColor
protected java.awt.Color gridColor
color of grid.
-
gridLabelingOn
protected boolean gridLabelingOn
if number/lettering should be displayed for grid boxes.
-
gridLabelOrientation
protected boolean gridLabelOrientation
boolean to determine the orientation: true is x-axis numbered false is x-axis lettered.
-
gridOverlayOn
protected boolean gridOverlayOn
Flag to indicate if NEI grid overlay should be displayed.
-
gridSpacingX
protected float gridSpacingX
spacing of the grid (horizontal) in terms of resolution.
-
gridSpacingY
protected float gridSpacingY
spacing of the grid (vertical) in terms of resolution.
-
overlayOn
protected boolean overlayOn
Flag to indicate if DICOM overlay should be displayed.
-
voiManager
protected VOIManager voiManager
-
lastMouseEvent
private long lastMouseEvent
-
doCheckerboardAnimate
private boolean doCheckerboardAnimate
-
xSep
private int xSep
-
ySep
private int ySep
-
xMod
int xMod
-
yMod
int yMod
-
xStart
int[] xStart
-
yStart
int[] yStart
-
makingCheckerboard
private boolean makingCheckerboard
-
bandSpacing
private int[] bandSpacing
-
refPtsLocation
private java.lang.String refPtsLocation
-
eyeTrackerRecordingMode
private int eyeTrackerRecordingMode
-
SingleFrameEyetrackerMode
public static int SingleFrameEyetrackerMode
-
MultiFrameEyetrackerMode
public static int MultiFrameEyetrackerMode
-
PluginEyetrackerMode
public static int PluginEyetrackerMode
-
winLevel
protected JDialogWinLevel winLevel
-
-
Constructor Detail
-
ViewJComponentEditImage
public ViewJComponentEditImage(ViewJFrameBase _frame, ModelImage _imageA, ModelLUT _LUTa, float[] imgBufferA, ModelImage _imageB, ModelLUT _LUTb, float[] imgBufferB, int[] pixelBuffer, float zoom, int[] extents, boolean logMagDisplay, int _orientation)
Constructor: ImageA and ImageB are expected to be of the same dimensionality !!- Parameters:
_frame
- frame where image(s) will be displayed_imageA
- Model of the image that will be displayed_LUTa
- LUT used to display imageAimgBufferA
- storage buffer used to display image A_imageB
- Model of the image that will be displayed_LUTb
- LUT used to display imageBimgBufferB
- storage buffer used to display image BpixelBuffer
- storage buffer used to build a displayable imagezoom
- initial magnification of imageextents
- initial display dimensions of the imagelogMagDisplay
- display log magnitude of image_orientation
- orientation of the image
-
-
Method Detail
-
getScannerPositionLabels
public static final java.lang.String[] getScannerPositionLabels(ModelImage image, WildMagic.LibFoundation.Mathematics.Vector3f position)
Gets position data to display in message bar - for DICOM and MINC images, gives patient position as well. The image's associated transformation must be FileInfoBase.TRANSFORM_SCANNER_ANATOMICAL, or the orientations must be set up correctly, or else the function returns null.- Parameters:
image
- The image the point lies within.position
- (x,y,z(slice)) position in FileCoordinates- Returns:
- An array of strings that represent patient position.
-
getRASScannerPositionLabels
public static final java.lang.String[] getRASScannerPositionLabels(ModelImage image, WildMagic.LibFoundation.Mathematics.Vector3f position)
Gets position data to display in message bar - for DICOM and MINC images, gives patient position as well. The image's associated transformation must be FileInfoBase.TRANSFORM_SCANNER_ANATOMICAL, or the orientations must be set up correctly, or else the function returns null.- Parameters:
image
- The image the point lies within.position
- (x,y,z(slice)) position in FileCoordinates- Returns:
- An array of strings that represent patient position.
-
calcPaintedVolume
public void calcPaintedVolume(java.lang.String str)
Calculates the volume of the painted voxels.- Parameters:
str
- string in showRegionGrow#showRegionGrow(int, String)
-
cine
public void cine(int ms)
Loops through the images and displays them.- Parameters:
ms
- how long to wait between each image
-
commitMask
public void commitMask(int imagesDone, boolean clearPaintMask, boolean polarity, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.- Parameters:
imagesDone
- IMAGE_A, IMAGE_B, or BseedVOTHclearPaintMask
- if true clear paint maskpolarity
- DOCUMENT ME!
-
commitMask
public void commitMask(int imagesDone, boolean clearPaintMask, boolean polarity, java.util.Vector<java.lang.Integer> intensityLockVector, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.- Parameters:
imagesDone
- IMAGE_A, IMAGE_B, or BseedVOTHclearPaintMask
- if true clear paint maskpolarity
- DOCUMENT ME!intensityLockVector
- Vector containing Integers values which are indexed to the locked intensity values in the image
-
commitMask
public void commitMask(ModelImage affectedImage, boolean clearPaintMask, boolean polarity, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.- Parameters:
affectedImage
- IMAGE_A, IMAGE_B, or BseedVOTHclearPaintMask
- if true clear paint maskpolarity
- DOCUMENT ME!intensityLockVector
- Vector containing Integers values which are indexed to the locked intensity values in the imageshowProgressBar
- if true, shows the progress bar for this algorithm
-
commitMask
public void commitMask(int imagesDone, boolean clearPaintMask, boolean polarity, java.util.Vector<java.lang.Integer> intensityLockVector, boolean showProgressBar, boolean commitMasksAs4D)
Replace intensities in the image using painted mask.- Parameters:
imagesDone
- IMAGE_A, IMAGE_B, or BseedVOTHclearPaintMask
- if true clear paint maskpolarity
- DOCUMENT ME!intensityLockVector
- Vector containing Integers values which are indexed to the locked intensity values in the imageshowProgressBar
- if true, shows the progress bar for this algorithm
-
commitPaintToUbyteMask
public java.lang.String commitPaintToUbyteMask()
Creates a new ubyte image from the paint mask.- Returns:
- the name of the new ubyte image
-
commitPaintToMask
public java.lang.String commitPaintToMask()
Creates a new short image from the paint mask.- Returns:
- the name of the new short image
-
dispose
public void dispose(boolean flag)
Sets all variables to null, disposes, and garbage collects.- Overrides:
dispose
in classViewJComponentBase
- Parameters:
flag
- if true garbage collector should be called.
-
disposeLocal
public void disposeLocal(boolean flag)
Deprecated.Old method that does not match up with signature from VJCBase.Sets all variables to null, disposes, and garbage collects. Old method that does not match up with signature from VJCBase.- Parameters:
flag
- if true garbage collector should be called.
-
drawGradicules
public void drawGradicules(java.awt.Graphics g, float xRes, float yRes)
Draws the gradicules (the half-image lines which demarcate lengths in the image).- Parameters:
g
- The graphics object which will do the painting.xRes
- The resolutions in the x-direction.yRes
- The resolutions in the y-direction.
-
drawStringBW
public final void drawStringBW(java.lang.String str, java.awt.Graphics g, int x, int y)
Draws a white character on a black surround.- Parameters:
str
- string to be displayedg
- graphics contexts (where to draw the string)x
- x coordinate of where the string is to be drawny
- y coordinate of where the string is to be drawn
-
eraseAllPaint
public void eraseAllPaint(boolean onlyCurrent)
Erases all paint.- Parameters:
onlyCurrent
- DOCUMENT ME!
-
getActiveImage
public ModelImage getActiveImage()
Returns the active image.- Specified by:
getActiveImage
in interfacePaintGrowListener
- Returns:
- active image
-
getActiveImageBuffer
public float[] getActiveImageBuffer()
Returns the active image buffer.- Returns:
- active image buffer
-
getActiveImageSliceBuffer
public float[] getActiveImageSliceBuffer()
Returns the active image buffer for this slice.- Returns:
- active image buffer for this slice
-
getActiveLUT
public ModelLUT getActiveLUT()
Returns the active image.- Returns:
- active image
-
getActiveRGB
public ModelRGB getActiveRGB()
Returns the active image.- Returns:
- active image
-
getAlphaBlend
public float getAlphaBlend()
Returns float alphaBlend. The value used to blend two images displayed in the same frame.- Returns:
- alphaBlend
-
getCursorMode
public int getCursorMode()
Returns the VOI mode.- Returns:
- drawing mode for the VOI tools (i.e. ELLIPSE, LINE ...)
-
getFrame
public ViewJFrameBase getFrame()
Returns the frame.- Returns:
- frame
-
getImageA
public ModelImage getImageA()
Returns the imageA.- Returns:
- imageA
-
getImageB
public ModelImage getImageB()
Returns the imageB.- Returns:
- imageB
-
getImageBufferA
public float[] getImageBufferA()
Gets imageA's image buffer of intensities.- Returns:
- float[] imageA's intensity buffer
-
getImageBufferB
public float[] getImageBufferB()
Gets imageB's image buffer of intensities.- Returns:
- float[] imageB's intensity buffer
-
getIntensityDropper
public float getIntensityDropper()
Gets the intensityDropper intensity.- Returns:
- the intensity dropper
-
getLUTa
public ModelLUT getLUTa()
Returns the model lut for the imageA.- Returns:
- the model LUT for imageA
-
getLUTb
public ModelLUT getLUTb()
Returns the model lut for the imageB.- Returns:
- the model LUT for imageB
-
getModifyFlag
public boolean getModifyFlag()
DOCUMENT ME!- Returns:
- boolean
-
getNumPoints
public int getNumPoints()
Finds the number of points in the active VOI contour.- Returns:
- the number of points in the selected VOI
-
getnVOI
public int getnVOI()
Returns the number of VOIs in the active image.- Returns:
- int number of VOIs
-
getOpacity
public float getOpacity()
Returns float opacity.- Returns:
- opacity
-
getOrientation
public int getOrientation()
Returns the image's orientation.- Returns:
- image orientation
-
getPaintBitmap
public java.util.BitSet getPaintBitmap()
Returns BitSet paintBitmap.- Returns:
- paintBitmap
-
getPaintBuffer
public int[] getPaintBuffer()
Gets the paint buffer.- Returns:
- int[] paint buffer
-
getPaintMask
public java.util.BitSet getPaintMask()
Gets the paint mask.- Returns:
- the current paint mask
-
getPixBuffer
public int[] getPixBuffer()
Gets the buffer used to store ARGB images of the image presently being displayed.- Returns:
- int[] buffer of ARGB image A
-
getPixBufferB
public int[] getPixBufferB()
Gets the buffer used to store ARGB images of the image presently being displayed.- Returns:
- int[] buffer of ARGB image A
-
getRGBTA
public ModelRGB getRGBTA()
Returns the ModelRGB RGBTA for imageA.- Returns:
- RGBTA for imageA
-
getRGBTB
public ModelRGB getRGBTB()
Returns the ModelRGB for imageB.- Returns:
- RGBTB for imageB
-
getShowMagIntensityEnabled
public boolean getShowMagIntensityEnabled(int width, int height, float mag)
Determines whether to enable the showIntensity checkbox for magnification box.- Returns:
- whether to enable showIntensity checkbox
-
getSlice
public int getSlice()
Returns the slice of the image.- Specified by:
getSlice
in interfaceScreenCoordinateListener
- Returns:
- the slice
-
getTimeSlice
public int getTimeSlice()
Gets the time slice of the image.- Returns:
- the current time slice
-
getVOIHandler
public VOIHandlerInterface getVOIHandler()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
isCheckerboarded
public boolean isCheckerboarded()
Tells whether or not the image is being displayed in checkerboard mode.- Returns:
- boolean
-
loadImageFile
private java.awt.image.BufferedImage loadImageFile(java.lang.String imageName) throws java.io.IOException
Reads in an image icon from either the set of mipav icons or the user's $HOME/mipav/brushes/ directory.- Parameters:
imageName
- The- Returns:
- Throws:
java.io.IOException
-
loadPaintBrush
public void loadPaintBrush(java.lang.String paintName, boolean isQuick)
Loads built-in (.gif) or custom (.png) paint brushes based on the last-used paint brush in preferences.- Parameters:
paintName
- the name of the brush to loadisQuick
- DOCUMENT ME!
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
A mouse event. When the mouse is clicked in the image, several different things may happen. If a Volume of Interest (VOI) is selected and the click count is 2, a VOI dialog should pop up. If the click count is 1 and the mouse is in an VOI, it should select the VOI. In all other cases, a click within the image but not in an VOI should deselect all VOIs.- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
- Parameters:
mouseEvent
- event that triggers function; contains click count
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
A mouse event. Drags a VOI real time by calling a series of translations and draws. Once the mouse is released, the positions are reset permenantly. Also rubberbands points if the cursor indicates it by calling rubberbandVOI.- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Parameters:
mouseEvent
- event that triggered function
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
Store the lastMouse position.- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
- Parameters:
mouseEvent
- event
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent mouseEvent)
Resets the level set stack.- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
- 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
- Parameters:
mouseEvent
- event that triggered the function
-
setFullScreenModeLocation
public void setFullScreenModeLocation(java.lang.String _location)
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
A mouse 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
- Parameters:
mouseEvent
- event that triggered function
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
A mouse event. This function sets up and draws the VOI according to the mode.- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Parameters:
mouseEvent
- event that triggered function
-
mouseWheelMoved
public void mouseWheelMoved(java.awt.event.MouseWheelEvent mouseWheelEvent)
************************************************************************ ************************** Mouse Wheel Events *************************.************************************************************************- Specified by:
mouseWheelMoved
in interfacejava.awt.event.MouseWheelListener
- Parameters:
mouseWheelEvent
- DOCUMENT ME!
-
restartCheckerboardAnimateThread
public void restartCheckerboardAnimateThread()
-
openUDLUTandTransferFunct
public void openUDLUTandTransferFunct()
Open the user defined LUT table and transfer function.
-
getRGBPaintComponents
public java.lang.String getRGBPaintComponents()
-
setRGBPaintComponents
public void setRGBPaintComponents(java.lang.String rgb)
-
paintComponent
public void paintComponent(java.awt.Graphics graphics)
Paints the image and calls drawSelf for all VOIs.- Overrides:
paintComponent
in classViewJComponentBase
- Parameters:
graphics
- graphics
-
setDrawVOIs
public void setDrawVOIs(boolean drawVOIs)
-
paintComponentForPrinter
public void paintComponentForPrinter(int tx, int ty, java.awt.Graphics g)
Paints the image and calls drawSelf for all VOIs and also resizes the image if it is too big for printer.- Parameters:
tx
- x translationty
- y translationg
- graphics
-
paintMagComponent
public void paintMagComponent(java.awt.Graphics2D graphics2d)
Paints a magnified window over the image centered about the cursor.- Parameters:
graphics2d
- graphics component
-
quickSwitchBrush
public void quickSwitchBrush()
Backups up ( and swaps if not null) the current and previously used paintBrush.
-
regionGrow
public void regionGrow(java.lang.String str)
Grows a region based on a starting supplied. A voxel is added to the the paintBitmap mask if its intensity is between previously supplied bounds.- Specified by:
regionGrow
in interfacePaintGrowListener
- Parameters:
str
- the string to prepend to message containing region growth statistics
-
regionGrow
public void regionGrow(short x, short y, short z, float value, java.lang.String str, boolean click)
Grows a region based on a starting supplied. A voxel is added to the the paintBitmap mask if its intensity is between the the bounds which are also supplied. Used on black and white images.when click
false
, adds points in the newly grown region which weren't in the old one remove points which were in the old region but aren't in the new one (and which weren't in the region painted before the last click), otherwise, the regions are simply added into the new set.- Parameters:
x
- x coordinate of the seed pointy
- y coordinate of the seed pointz
- z coordinate of the seed pointvalue
- Intensity value at the seed pointstr
- String to start line withclick
- whether this region grow was initiated by a click on the image
-
regionGrow
public void regionGrow(short x, short y, short z, float value, ModelImage image, java.lang.String leadString, boolean click)
Grows a region based on a starting supplied. A voxel is added to the the paintBitmap mask if its intensity is between the the bounds which are also supplied. Used for black and white images.When click is
false
, adds points in the newly grown region which weren't in the old one remove points which were in the old region but aren't in the new one (and which weren't in the region painted before the last click), otherwise, the regions are simply added into the new set.- Parameters:
x
- x coordinate of the seed pointy
- y coordinate of the seed pointz
- z coordinate of the seed pointvalue
- Intensity value at the seed pointimage
- the image to perform the region grow inleadString
- the string to append to the region grow outputclick
- whether this region grow was initiated by a click on the image
-
regionGrow
public void regionGrow(short x, short y, short z, float valueR, float valueG, float valueB, java.lang.String str, boolean click)
Grows a region based on a starting supplied. A voxel is added to the the paintBitmap mask if its intensity is between the the bounds which are also supplied. Used on color images.when click
false
, adds points in the newly grown region which weren't in the old one remove points which were in the old region but aren't in the new one (and which weren't in the region painted before the last click), otherwise, the regions are simply added into the new set.- Parameters:
x
- x coordinate of the seed pointy
- y coordinate of the seed pointz
- z coordinate of the seed pointvalueR
- Red intensity value at the seed pointvalueG
- Green intensity value at the seed pointvalueB
- Blue intensity value at the seed pointstr
- String to start line withclick
- whether this region grow was initiated by a click on the image
-
regionGrow
public void regionGrow(short x, short y, short z, float valueR, float valueG, float valueB, ModelImage image, java.lang.String leadString, boolean click)
Grows a region based on a starting supplied. A voxel is added to the the paintBitmap mask if its intensity is between the the bounds which are also supplied. Used for color images.When click is
false
, adds points in the newly grown region which weren't in the old one remove points which were in the old region but aren't in the new one (and which weren't in the region painted before the last click), otherwise, the regions are simply added into the new set.- Parameters:
x
- x coordinate of the seed pointy
- y coordinate of the seed pointz
- z coordinate of the seed pointvalueR
- Red value at the seed pointvalueG
- Green value at the seed pointvalueB
- Blue value at the seed pointimage
- the image to perform the region grow inleadString
- the string to append to the region grow outputclick
- whether this region grow was initiated by a click on the image
-
regionGrowColor
public void regionGrowColor(java.lang.String str)
Grows a region based on a starting supplied. A voxel is added to the the paintBitmap mask if its intensity is between previously supplied bounds.- Parameters:
str
- the string to prepend to message containing region growth statistics
-
rememberPaintBrushSize
public void rememberPaintBrushSize()
Remembers the current paint brush size so that it can be reset later.
-
resetLUTs
public void resetLUTs()
Resets the LUTs.
-
resetPaintBrushSize
public void resetPaintBrushSize()
Resets the paint brush size to the remembered value.
-
saveLUTandTransferFunction
public void saveLUTandTransferFunction(java.lang.String filename, java.lang.String dirName)
This method saves the LUT for the active image. If the image is not a color image then both the functions and the LUT data are saved. If this is a color image, then only the functions are saved.- Parameters:
filename
- filename to save LUT asdirName
- directory to save LUT to
-
readLUTandTFunctFrom
public void readLUTandTFunctFrom(java.lang.String filename, java.lang.String dirName)
This method reads a LUT and Transfer function from a file diretory specified.- Parameters:
filename
- filename of LUTdirName
- directory of LUT
-
saveUDLUT
public void saveUDLUT()
Save user defined LUT table.
-
setActiveImage
public void setActiveImage(int active)
Sets the active image for drawing VOIs.- Parameters:
active
- IMAGE_A or IMAGE_B
-
setAlphaBlend
public void setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displaying.- Parameters:
value
- amount [0,100] that is the percentage of Image A to be displayed
-
setBuffers
public void setBuffers(float[] imgBufferA, float[] imgBufferB, int[] pixBuff, int[] pixBuffB)
The frame in which the image(s) is displayed, allocates the memory and uses this method to pass the references to the buffers.- Parameters:
imgBufferA
- storage buffer used to display image AimgBufferB
- storage buffer used to display image BpixBuff
- storage buffer used to build a displayable imagepixBuffB
- storage buffer used to build a displayable imageB for the window
-
setCheckerboard
public void setCheckerboard(int rowCheckers, int columnCheckers)
Sets the image to display in "Checkerboard" mode with the given numbers of rows and columns.- Parameters:
rowCheckers
- int # of rowscolumnCheckers
- int # of columns
-
setCrosshairCursor
public void setCrosshairCursor(java.awt.Cursor curs)
Changes the Crosshair cursor to be either the default crosshair or a pre-existing gif.- Parameters:
curs
- the new crosshair cursor
-
setCursorMode
public void setCursorMode(int mode)
Switches modes based on the variable mode. Sets voiHandler.getRubberband() activity and the cursor.- Parameters:
mode
- the integer mode
-
setDisplayFuzzy
public void setDisplayFuzzy(boolean val)
Sets whether a fuzzy image is displayed.- Specified by:
setDisplayFuzzy
in interfacePaintGrowListener
- Parameters:
val
- whether to show the fuzzy connectedness image
-
setEnabled
public void setEnabled(boolean flag)
Enables or disables the component for modification.- Overrides:
setEnabled
in classjavax.swing.JComponent
- Parameters:
flag
- true = modify, and false = locked
-
setFrameControls
public void setFrameControls(ViewControlsImage controls)
Sets the frameControls.- Parameters:
controls
- the controls with color and opacity information
-
setFuzzyThreshold
public void setFuzzyThreshold(float val)
Sets whether fuzzy connectedness is used and the fuzzy threshold.- Specified by:
setFuzzyThreshold
in interfacePaintGrowListener
- Parameters:
val
- the fuzzy connectedness threshold value
-
setGrowDialog
public void setGrowDialog(RegionGrowDialog dialog)
Sets the RegionGrowDialog for this class (usually used to set it to null).- Specified by:
setGrowDialog
in interfacePaintGrowListener
- Parameters:
dialog
- the paint grow dialog
-
setHasThreshold1
public void setHasThreshold1(boolean hasThreshold1)
Sets the hasThreshold1 for setPaintBuffers.- Parameters:
hasThreshold1
- whether the paint buffer has a threshold1
-
setHasThreshold2
public void setHasThreshold2(boolean hasThreshold2)
Sets the hasThreshold2 for setPaintBuffers.- Parameters:
hasThreshold2
- whether the paint buffer has a threshold2
-
setHighlightColor
public void setHighlightColor(java.awt.Color c)
Changes the color used to highlight the currently on-top image.- Parameters:
c
- the new color to use.
-
setImageA
public void setImageA(ModelImage image)
Sets component's ImageA. assumes dimensionality same as image B's for now.- Parameters:
image
- imageA
-
setImageB
public void setImageB(ModelImage image)
Sets component's ImageB. !!!!!! assumes dimensionality same as image A's for now will fix soon.- Parameters:
image
- imageB
-
setImageBufferB
public void setImageBufferB(float[] buffer)
Sets component's ImageB buffer.- Parameters:
buffer
- image buffer to put in the buffer for Image B
-
setImageColocalize
public void setImageColocalize(ModelImage imageColocalize)
Sets the colocalize image.- Parameters:
imageColocalize
- the colocalization image
-
setImageExtents
public void setImageExtents(int[] imageExtents)
DOCUMENT ME!- Parameters:
imageExtents
- int[]
-
setIntensityDropper
public void setIntensityDropper(float intensityDropper)
Sets the intensityDropper intensity.- Parameters:
intensityDropper
- the dropper intensity
-
setLess
public void setLess(float val)
Sets less for regionGrow.- Specified by:
setLess
in interfacePaintGrowListener
- Parameters:
val
- lower region grow delta
-
setLessB
public void setLessB(float val)
Sets lessB for regionGrow.- Parameters:
val
- lower region grow delta
-
setLessG
public void setLessG(float val)
Sets lessG for regionGrow.- Parameters:
val
- lower region grow delta
-
setLessR
public void setLessR(float val)
Sets lessR for regionGrow.- Parameters:
val
- lower region grow delta
-
setLogMagDisplay
public void setLogMagDisplay(boolean flag)
Sets the log magnitude display flag.- Parameters:
flag
- if true display log of the Magnitude of the complex image
-
setLUTa
public void setLUTa(ModelLUT LUT)
accessor that sets the model LUT for the imageA.- Parameters:
LUT
- the model LUT
-
setLUTb
public void setLUTb(ModelLUT LUT)
Sets the model LUTb for the imageB.- Parameters:
LUT
- the model LUT
-
setMaxDistance
public void setMaxDistance(int val)
Sets maxDistance for regionGrow.- Specified by:
setMaxDistance
in interfacePaintGrowListener
- Parameters:
val
- the maximum region grow distance
-
setModifyFlag
public void setModifyFlag(boolean flag)
DOCUMENT ME!- Parameters:
flag
- DOCUMENT ME!
-
setMore
public void setMore(float val)
Sets more for regionGrow.- Specified by:
setMore
in interfacePaintGrowListener
- Parameters:
val
- upper region grow delta
-
setMoreB
public void setMoreB(float val)
Sets moreB for regionGrow.- Parameters:
val
- upper region grow delta
-
setMoreG
public void setMoreG(float val)
Sets moreG for regionGrow.- Parameters:
val
- upper region grow delta
-
setMoreR
public void setMoreR(float val)
Sets moreR for regionGrow.- Parameters:
val
- upper region grow delta
-
setPaintBitmapSwitch
public void setPaintBitmapSwitch(boolean paintBitmapSwitch)
If true do not getMask on a setActiveImage command so as to keep the mask from the old active image.- Parameters:
paintBitmapSwitch
- if true do not getMask on a setActiveImage command
-
setPaintBrushSize
public void setPaintBrushSize(int paintBrushSize)
Switches modes based on the variable mode. Sets the number of pixels to be drawn when painting.- Parameters:
paintBrushSize
- the integer mode
-
setPaintMask
public void setPaintMask(java.util.BitSet mask)
Sets the paint mask.- Parameters:
mask
- the new paint mask
-
setPixelInformationAtLocation
public void setPixelInformationAtLocation(int xS, int yS, boolean isControlDown)
Prints ModelImage information at the mouse location.- Parameters:
xS
- mouse x locationyS
- mouse y location
-
isCheckerboardAnimate
public boolean isCheckerboardAnimate()
-
setCheckerboardAnimate
public void setCheckerboardAnimate(boolean doCheckerboardAnimate)
-
isMakingCheckerboard
public boolean isMakingCheckerboard()
-
setMakingCheckerboard
public void setMakingCheckerboard(boolean makingCheckerboard)
-
getCleanImageBufferB
public int[] getCleanImageBufferB()
-
getMaxExtents
public int[] getMaxExtents()
-
getxSep
public int getxSep()
-
setxSep
public void setxSep(int xSep)
-
getySep
public int getySep()
-
setySep
public void setySep(int ySep)
-
setRegionGrowVars
public void setRegionGrowVars(short x, short y, short z, float val)
Sets the variables used to remember the point where the last region grow was started from.- Parameters:
x
- x coordinatey
- y coordinatez
- z coordinateval
- intensity at the point (x,y,z)
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
Sets the RGB table for ARGB image A.- Parameters:
RGBT
- RGB table
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
Sets the RGB table for ARGB image B.- Parameters:
RGBT
- RGB table
-
setShowMagIntensity
public void setShowMagIntensity(boolean flag)
Sets whether to show intensity in mag. box- Parameters:
flag
- whether to show intensity in mag. box
-
setShowSliceNum
public void setShowSliceNum(boolean flag)
Sets whether the slice number will be shown in the lower left hand corner of the image.- Parameters:
flag
- whether to display the slice number
-
setSizeLimit
public void setSizeLimit(int val)
Sets sizeLimit for regionGrow.- Specified by:
setSizeLimit
in interfacePaintGrowListener
- Parameters:
val
- the maximum region grow size
-
setSlice
public void setSlice(int _slice)
Sets the slice of the image.- Parameters:
_slice
- image slice to be displayed
-
setStringOverride
public void setStringOverride(java.lang.String str)
Sets the string painted on the lower left.- Parameters:
str
- str that is painted on the lower left of image
-
setThresholdColors
public void setThresholdColors(boolean useRedThreshold, boolean useGreenThreshold, boolean useBlueThreshold)
Sets the booleans for using thresholds in setColorPaintBuffers.- Parameters:
useRedThreshold
- whether to threshold the red paint bufferuseGreenThreshold
- whether to threshold the green paint bufferuseBlueThreshold
- whether to threshold the blue paint buffer
-
setThresholds
public void setThresholds(float threshold1, float threshold2)
Sets the thresholds.- Parameters:
threshold1
- the first thresholdthreshold2
- the second threshold
-
setTimeSlice
public void setTimeSlice(int _slice)
Sets the time slice of the image.- Parameters:
_slice
- the time slice to be displayed
-
setUseVOI
public void setUseVOI(boolean val)
Sets whether a selected VOI is used to calculate the initial variance.- Specified by:
setUseVOI
in interfacePaintGrowListener
- Parameters:
val
- whether to use the selected VOI to get the initial variance for the fuzzy regionGrow
-
setVariableThresholds
public void setVariableThresholds(boolean variableThresholds)
If true varies thresholds with region growth.- Parameters:
variableThresholds
- boolean
-
show
public boolean show(int tSlice, int zSlice, boolean forceShow)
For generating the display of 1 or 2 images.- Parameters:
tSlice
- t (time) slice to showzSlice
- z slice to showforceShow
- forces this method to import image and recalculate java image- Returns:
- boolean to indicate if the show was successful
-
show
public boolean show(int tSlice, int zSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow)
Shows the image and the VOI(s).- Parameters:
tSlice
- t (time) slice to showzSlice
- z slice to show_LUTa
- LUTa - to change to new LUT for imageA else null_LUTb
- LUTb - to change to new LUT for imageB else nullforceShow
- forces this method to import image and recalculate java image- Returns:
- boolean to indicate if the show was successful
-
show
public boolean show(int tSlice, int zSlice, ModelLUT _LUTa, ModelLUT _LUTb, boolean forceShow, int interpMode)
Shows the image and the VOI(s).- Parameters:
tSlice
- t (time) slice to showzSlice
- z slice to show_LUTa
- LUTa - to change to new LUT for imageA else null_LUTb
- LUTb - to change to new LUT for imageB else nullforceShow
- forces this method to import image and recalculate java imageinterpMode
- image interpolation method (Nearest or Smooth)- Returns:
- boolean to indicate if the show was successful
-
showBlank
public boolean showBlank()
Resets the buffer to 0s and displays a blank image.- Returns:
- boolean to indicate that the show was successful
-
showRegionInfo
public void showRegionInfo(int count, java.lang.String leadString)
Display statistics about the grown region.- Specified by:
showRegionInfo
in interfacePaintGrowListener
- Parameters:
count
- Number of pixels (voxels)leadString
- the string to prepend to message containing region growth statistics
-
showRegionInfo
public void showRegionInfo(int count, float[] total, float[] mean, float[] stdDev, java.lang.String leadString)
Display statistics about the grown region.- Parameters:
count
- Number of pixels (voxels)total
- Sum of pixel intensitiesmean
- Average pixel intensitystdDev
- Standard deviation of pixel intensitiesleadString
- the string to prepend to message containing region growth statistics
-
showRegionInfo
public void showRegionInfo(int count, double[] total, double[] mean, double[] stdDev, java.lang.String leadString)
Display statistics about the grown region.- Parameters:
count
- Number of pixels (voxels)total
- Sum of pixel intensitiesmean
- Average pixel intensitystdDev
- Standard deviation of pixel intensitiesleadString
- the string to prepend to message containing region growth statistics
-
showStatisticsCalculator
public void showStatisticsCalculator()
Opens a JDialogStatistics to allow computation ofROI statistics.
-
undoLastPaint
public void undoLastPaint()
Undoes the last paint.
-
updatePaint
public void updatePaint(java.util.BitSet region, boolean backup, boolean isGrower)
Causes the image to update its paint bit mask and redisplay itself.- Specified by:
updatePaint
in interfacePaintGrowListener
- Parameters:
region
- new paint region bit setbackup
- whether to save the previous paint mask to allow the update to be un-doneisGrower
- whether this paint listener is the one that did the region grow
-
updatePaintBrushCursor
public void updatePaintBrushCursor()
Updates the Paint Cursor's BufferedImage with the correct color/opacity.
-
useHighlight
public void useHighlight(boolean hilite)
Sets this component to paint the "on top" high-light. It is not required to use the coloured rectangle to high-light the on-top component, but the component is not aware of its position in the user-interface, and thus, that the user-interface controls point to it.- Parameters:
hilite
-true
will set this component to paint the 'on-top' high-light the next time it is redrawn.false
, of course, will not let the component paint the coloured rectangle when repainted.
-
isHighlight
public boolean isHighlight()
-
draw3DVOIs
protected void draw3DVOIs(java.awt.Graphics offscreenGraphics2d, boolean bBlend)
-
finalize
protected void finalize() throws java.lang.Throwable
Calls dispose to dump this instance.- Overrides:
finalize
in classViewJComponentBase
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
getBrushSize
protected int getBrushSize()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getHBrushSize
protected int getHBrushSize()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getZoomMagnitudeX
protected float getZoomMagnitudeX(boolean reverse)
DOCUMENT ME!- Parameters:
reverse
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getZoomMagnitudeY
protected float getZoomMagnitudeY(boolean reverse)
DOCUMENT ME!- Parameters:
reverse
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
mousePressedPaint
protected void mousePressedPaint(java.awt.event.MouseEvent mouseEvent)
When a mousePressed event is triggered and the mode is DROPPER_PAINT, ERASER_PAINT, PAINT_VOI, or MAG_REGION this function is called. It is shared with the derived classes.- Parameters:
mouseEvent
- the mouseEvent that triggered this function call.
-
createImg
public boolean createImg(int slice)
Creates the Java image to be displayed from the model image. Makes it from the appropriate slice.- Parameters:
slice
- Slice of image to create java image from.- Returns:
- Flag indicating success or failure.
-
createImg
public boolean createImg(int timeSlice, int slice)
Creates the Java image to be displayed from the model image. Makes it from the appropriate slice.- Parameters:
slice
- Slice of image to create java image from.- Returns:
- Flag indicating success or failure.
-
performPaint
protected void performPaint(java.awt.event.MouseEvent event)
DOCUMENT ME!- Parameters:
event
- DOCUMENT ME!
-
performPaint
protected void performPaint(java.awt.event.MouseEvent mouseEvent, boolean erase)
This method will set or clear the paint bitmap as the user paints on-screen.- Parameters:
mouseEvent
- MouseEvent the mouseEvent associated with this paint actionerase
- boolean if true, paintBitmap is cleared (erased), otherwise paintBitmap is set (painted)
-
processDefaultMouseDrag
protected void processDefaultMouseDrag(java.awt.event.MouseEvent mouseEvent, int xS, int yS)
processDefaultMouseDrag performs the mouseDrag operations when in DEFAULT mode. The default operation when the right mouse button is held down is the window-level image adjustment, and setting the ModelImage information at the pixel location. This function in shared with the deried classes.- Parameters:
mouseEvent
- the mouse eventxS
- the mouse x location on screenyS
- the mouse y location on screen
-
adjustOpacityFor000Color
private void adjustOpacityFor000Color()
>>>>>>> .r533 The purpose of this method is to examine both LUTs to determine if they are zero-based, that is, if they map values of zero to the color R=0, G=0, B=0. If the LUT does, in fact, do this, then this method ensures that those pixels are completely transparent so that no blending takes place for those pixels.
-
backupPaintBitmap
private void backupPaintBitmap()
Backs up the paintBitmap into the paintBitmapBU variable.
-
cleanBuffer
private void cleanBuffer(int buffer)
DOCUMENT ME!- Parameters:
buffer
- DOCUMENT ME!
-
drawImageText
private void drawImageText(java.awt.Graphics2D offscreenGraphics2d)
Draws text onto the image, such as the slice number.- Parameters:
offscreenGraphics2d
- Graphics2D graphics context to draw in
-
getZoomMagnitude
private float getZoomMagnitude(float zoom, boolean reverse)
Returns the magnitude zoom depending on the zoom mode.- Parameters:
zoom
- the zoom factor (x or y)reverse
- for reverse zoom- Returns:
- the calculated zoom factor
-
makeCheckerboard
private void makeCheckerboard()
Sets the number of checkers in a row and a column.
-
loopBandSpacing
public void loopBandSpacing()
-
loopBandSpacingReverse
public void loopBandSpacingReverse()
-
getBandSpacing
public int[] getBandSpacing()
-
setBandSpacing
public void setBandSpacing(int[] bandSpacing)
-
getxStart
public int[] getxStart()
-
getyStart
public int[] getyStart()
-
getyMod
public int getyMod()
-
getxMod
public int getxMod()
-
repaintImageIntensityLabelFast
private void repaintImageIntensityLabelFast(java.awt.Graphics2D graphics2d)
Repaints the image intensity label.- Parameters:
graphics2d
- Graphics2D the graphics context to draw in
-
repaintPaintBrushCursorFast
private void repaintPaintBrushCursorFast(java.awt.Graphics2D graphics2d)
Repaints the paint brush cursor without repainting the entire image.- Parameters:
graphics2d
- Graphics2D the graphics context to draw in
-
resetLUT
public void resetLUT(ModelLUT LUT, ModelImage image)
DOCUMENT ME!- Parameters:
LUT
- DOCUMENT ME!image
- DOCUMENT ME!
-
resetRGB
private void resetRGB(ModelRGB RGBT)
DOCUMENT ME!- Parameters:
RGBT
- DOCUMENT ME!
-
setZeroToOneLUTAdj
public void setZeroToOneLUTAdj(boolean zeroToOneLUTAdj)
- Parameters:
zeroToOneLUTAdj
-
-
isZeroToOneLUTAdj
public boolean isZeroToOneLUTAdj()
- Returns:
-
fileToScreen
public WildMagic.LibFoundation.Mathematics.Vector3f fileToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kFile)
-
patientToScreen
public WildMagic.LibFoundation.Mathematics.Vector3f patientToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
-
screenToFile
public boolean screenToFile(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
-
screenToFile
public boolean screenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)
-
screenToFile
public WildMagic.LibFoundation.Mathematics.Vector3f screenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
-
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.- 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.- Returns:
-
getGridColor
public java.awt.Color getGridColor()
get the color of the grid.- Returns:
- Color grid color
-
getGridLabeling
public boolean getGridLabeling()
Whether or not labels should be drawn on the grid overlay.- Returns:
- boolean
-
getGridLabelOrientation
public boolean getGridLabelOrientation()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getGridOverlay
public boolean getGridOverlay()
returns whether grid overlay is being displayed.- Returns:
- boolean is grid overlay on?
-
getGridSpacingX
public float getGridSpacingX()
returns the grid spacing in terms of resolution.- Returns:
- float grid spacing
-
getGridSpacingY
public float getGridSpacingY()
returns the grid spacing in terms of resolution.- Returns:
- float grid spacing
-
setGridColor
public void setGridColor(java.awt.Color color)
set the color of the grid.- Parameters:
color
- Color
-
setGridLabelingOn
public void setGridLabelingOn(boolean doLabel)
Tells the grid overlay (if on) to show abc/123 labeling.- Parameters:
doLabel
- boolean
-
setGridLabelOrientation
public void setGridLabelOrientation(boolean or)
Sets the axis orientation of abc and 123 labeling of the grid overlay.- Parameters:
or
- boolean true = x-axis numbered, false = x-axis lettered
-
setGridOverlay
public void setGridOverlay(boolean flag)
Sets whether or not to show the NEI grid overlay.- Parameters:
flag
- boolean show grid overlay (or not!)
-
setGridSpacingX
public void setGridSpacingX(float spacing)
sets the grid spacing (horizontal) in terms of resolution.- Parameters:
spacing
- float new grid spacing
-
setGridSpacingY
public void setGridSpacingY(float spacing)
sets the grid spacing (horizontal) in terms of resolution.- Parameters:
spacing
- float new grid spacing
-
getVOIManager
public VOIManager getVOIManager()
-
setVOIManager
public void setVOIManager(VOIManager kManager)
-
getOverlayOn
public boolean getOverlayOn()
Returns if image/dicom overlay should be shown.- Returns:
- boolean is the overlay shown
-
setOverlay
public void setOverlay(boolean flag)
Sets whether or not to show the overlay.- Parameters:
flag
- boolean that tells whether or not to show the overlay
-
showGridOverlay
protected void showGridOverlay(java.awt.Graphics g)
Draws a grid on top of the image according to the gridSpacingX and gridSpacingY.- Parameters:
g
- Graphics the graphics used to draw
-
showOverlay
public void showOverlay(java.awt.Graphics g)
Displays Image overlays (DICOM or image attributes).- Parameters:
g
- Graphics object used to paint and display the strings.
-
buildOverlayStrings
private java.lang.String buildOverlayStrings(FileInfoBase inf, java.lang.String name, java.lang.String attribString)
Builds the overlay Strings from the tag's value. Concatenates the output strings from the tags and ensures that any properly read-in string has usable (if empty) values.- Parameters:
inf
- The FileInfo with DICOM tags to display.name
- DOCUMENT ME!attribString
- Key of tag to display.- Returns:
- null when value is not a String or when the tag does not exist.
-
fileToScreenVOI
public WildMagic.LibFoundation.Mathematics.Vector3f fileToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kFile)
Description copied from interface:ScreenCoordinateListener
Converts image file X,Y,Z coordinates into local screen coordinates.- Specified by:
fileToScreenVOI
in interfaceScreenCoordinateListener
- Parameters:
kFile
- image file coordinates.- Returns:
- local screen coordinates.
-
patientToScreenVOI
public WildMagic.LibFoundation.Mathematics.Vector3f patientToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
Description copied from interface:ScreenCoordinateListener
Converts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.- Specified by:
patientToScreenVOI
in interfaceScreenCoordinateListener
- Parameters:
kPt
- local patient (Axial, Coronal, Sagittal) coordinates.- Returns:
- screen coordinate representation of the input point.
-
screenToFileVOI
public boolean screenToFileVOI(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
Description copied from interface:ScreenCoordinateListener
Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOI
in interfaceScreenCoordinateListener
- Parameters:
iX
- input X position in local screen coordinates.iY
- input Y position in local screen coordinates.iZ
- input slice position in the local image orientation, or z=0 for 2D images.kVolumePt
- image file coordinates return value.- Returns:
- returns true if the screen coordinate is clipped (is outside the displayed image space).
-
screenToFileVOI
public WildMagic.LibFoundation.Mathematics.Vector3f screenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
Description copied from interface:ScreenCoordinateListener
Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOI
in interfaceScreenCoordinateListener
- Parameters:
kScreen
- input X,Y,Z position in local screen coordinates, where z = local image slice or 0 for 2D images.- Returns:
- image file coordinates.
-
screenToFileVOI
public boolean screenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)
Description copied from interface:ScreenCoordinateListener
Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOI
in interfaceScreenCoordinateListener
- Parameters:
kScreen
- input X,Y,Z position in local screen coordinates, where z = local image slice or 0 for 2D images.kFile
- image file coordinates return value.- Returns:
- true if the screen coordinate is clipped (is outside the displayed image space).
-
setCenter
public void setCenter(WildMagic.LibFoundation.Mathematics.Vector3f center)
Description copied from interface:ScreenCoordinateListener
Sets the currently displayed image slice.- Specified by:
setCenter
in interfaceScreenCoordinateListener
-
getImageTimeStamp
private java.lang.String getImageTimeStamp()
Get the system timestamp.- Returns:
-
getTime
private java.lang.String getTime()
Get the system timestamp.- Returns:
-
setEyetrackerRecordingMode
public void setEyetrackerRecordingMode(int modeType)
Set the eye tracking recording mode type- Parameters:
modeType
-
-
setEyetrackerRecordMode
public void setEyetrackerRecordMode(int modeType)
-
recordZoom
public void recordZoom(boolean zoomIn)
-
recordPanning
public void recordPanning()
-
recordLineMeasure
private void recordLineMeasure()
-
setImageSlice
public void setImageSlice(int slice)
Set the image slice number, and recording the action as slider changes on single eye tracker viewer.- Parameters:
slice
-
-
setWindLevel
public void setWindLevel(int window, int level)
Set the window level value from the eye tracker- Parameters:
window
-level
-
-
ctMode
public void ctMode(int preset1, int preset2)
Sets mode to CT and sets range to CT presets.- Parameters:
preset1
- first CT presetpreset2
- second CT preset
-
-