Class ViewJComponentEditImage
- All Implemented Interfaces:
PaintGrowListener,ScreenCoordinateListener,MouseListener,MouseMotionListener,MouseWheelListener,ImageObserver,MenuContainer,Serializable,EventListener
- Direct Known Subclasses:
ViewJComponentDTIImage,ViewJComponentPedsAtlasIconImage,ViewJComponentRegistration,ViewJComponentSingleRegistration,ViewJComponentTriImage
- Version:
- 0.1 Nov 18, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ColorColor used in the rectangle indicating the image is active.protected booleanSet to true when all contours of a VOI are active.protected floatValue used to control the display when compositing two images.protected floatValue used to control the display when compositing two images.private int[]Dialog used to set properties of the checkerboard display:(Image A displayed in alternating squares with Image B.private ImageDOCUMENT ME!protected int[]Buffer used to store ARGB images of the image presently being displayed.protected int[]Buffer used to store ARGB images of the image presently being displayed.protected CursorCrosshair cursor that can be changed per user preference (in Mipav Options).protected intUsed to describe the cursor mode.protected booleanDOCUMENT ME!private booleanprotected booleanFlag used to prohibit VOI drawing.private intprotected ViewJFrameBaseFrame where the component image is displayed.protected ViewControlsImageControls having color and opacity.protected floatRegion grow parameters fuzzyConnectedness is not used if fuzzyThreshold is less than 0.static final intUsed to indicte geometric zoom steps (2x, 4x, 8x, 16x ...).protected Colorcolor of grid.protected booleanif number/lettering should be displayed for grid boxes.protected booleanboolean to determine the orientation: true is x-axis numbered false is x-axis lettered.protected booleanFlag to indicate if NEI grid overlay should be displayed.protected floatspacing of the grid (horizontal) in terms of resolution.protected floatspacing of the grid (vertical) in terms of resolution.Dialog used to control region growing of the paint tool.protected ModelImageModel for image A.protected ModelImageActive image.protected ModelImageModel for image B.protected float[]Buffer for image A, raw intensity.protected float[]Buffer for active image.protected float[]Buffer for image B, raw intensity.protected int[]The dimensionality of the image.protected JDialogVOIStatisticsDOCUMENT ME!floatUsed in paint to indicate intensity painted into the image.private booleanIf true then the x,y location and pixel/voxel intensity should be displayed (x,y: intensity).private longprivate intLast 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 floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!static final intUsed to indicte linear zoom steps (2x, 3x, 4x, 5x ...).protected booleanFlag for displaying logMag.protected ModelLUTLookup table for image A.protected ModelLUTLookup table for image B.protected PatientSlicePatientSlice contains all the Patient Coordinate system view-specific data for rendering this component:.protected WindowLevelwindow / level mouse control:.intDefault size of magnifier window = 120 pixels.floatMagnification value of magnifier window -- default = 4.0.intdefault = 120 pixels.protected JDialogMagnificationControlsDialog used to control the magnification of the image.private booleanprotected floatDOCUMENT ME!protected int[]DOCUMENT ME!protected booleanUsed to "lock" display when an algorithm is in the calculation process.protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected booleanKeep track of state of shift for mouse Pressed events.static intprotected intThe number columns when two images are displayed in the checker board mode.protected intCheckerboard display parameters.private ImageDOCUMENT ME!protected booleanfor the use of the user-notifier.protected intorientation of the slice, may be AXIAL, CORONAL, SAGITTAL, or UNKNOWN_ORIENT.protected booleanFlag to indicate if DICOM overlay should be displayed.protected BitSetBuffer used to indicate if the pixel location is painted (true) or unpainted (false).protected BitSetBackup of paint buffer for undo.protected booleanif true do not getMask on a setActiveImage command so as to keep the mask from the old active image.protected BitSetBitSet used for painting (brushes on/off).protected DimensionDimension of the paint.protected DimensionDOCUMENT ME!protected BitSetDOCUMENT ME!protected intPaint brush size.protected int[]protected BufferedImagebuffered image that is transparent to show the paintbrush cursor.private int[]This image indicates which images have been painted.protected BufferedImageDOCUMENT ME!protected int[]The buffer used to store the ARGB image of the image presently being displayed.protected int[]Buffer used to store ARGB image of the windowed imageB.static intprotected intThe 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 Stringprotected StringString representing RGB components used in applied paintprotected ModelRGBDOCUMENT ME!protected ModelRGBDOCUMENT ME!protected floatUsed with commitMask(int imagesDone), to save the value.protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected shortUsed with commitMask(int imagesDone), to save positions.protected shortUsed with commitMask(int imagesDone), to save positions.protected shortUsed with commitMask(int imagesDone), to save positions.protected BitSetBuffer used to remember the area painted around the last seed point for region growing.protected floatSeed value to start the region grow.protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!private static final longUse serialVersionUID for interoperability.private booleanFlag used to indicate if the shift key is depressed.private booleanFlag used to indicate that the intensity values of the image should be displayed in the magnified portion of the image.static intprotected intDOCUMENT ME!protected intDOCUMENT ME!protected StringString used to override the slice number in the lower left corner.protected longDOCUMENT ME!protected intDOCUMENT ME!protected ColorDOCUMENT ME!protected booleanprotected booleanprotected booleanprotected booleanThis flag is used by the fuzzy connectedness to indicate that a VOI should be used to calculate certain values to initialize the process.protected booleanDOCUMENT ME!protected RectangleVisible rectangle to draw topped.protected VOIManagerprivate booleanBoolean to determine if the mouse had been dragging before mouse release (for moving and setting active).private intThe window region size of used when two images are displayed in the same frame.protected JDialogWinLevelprotected booleanUser invokes window and level adjustment with right mouse drag in DEFAULT mode.(package private) intprotected shortX coord of seed point.private int(package private) int[](package private) intprotected shortY coord of seed point.private int(package private) int[]private booleanflag indicating whether there is 0 to 1 LUT Adjustment *protected shortZ 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, zoomYFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionViewJComponentEditImage(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
Modifier and TypeMethodDescriptionprivate void>>>>>>> .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 voidBacks up the paintBitmap into the paintBitmapBU variable.private StringbuildOverlayStrings(FileInfoBase inf, String name, String attribString) Builds the overlay Strings from the tag's value.voidcalcPaintedVolume(String str) Calculates the volume of the painted voxels.voidcine(int ms) Loops through the images and displays them.private voidcleanBuffer(int buffer) DOCUMENT ME!voidcommitMask(int imagesDone, boolean clearPaintMask, boolean polarity, boolean commitMasksAs4D) Replace intensities in the image using painted mask.voidcommitMask(int imagesDone, boolean clearPaintMask, boolean polarity, Vector<Integer> intensityLockVector, boolean commitMasksAs4D) Replace intensities in the image using painted mask.voidcommitMask(int imagesDone, boolean clearPaintMask, boolean polarity, Vector<Integer> intensityLockVector, boolean showProgressBar, boolean commitMasksAs4D) Replace intensities in the image using painted mask.voidcommitMask(ModelImage affectedImage, boolean clearPaintMask, boolean polarity, Vector<Integer> intensityLockVector, boolean showProgressBar, boolean commitMasksAs4D) Replace intensities in the image using painted mask.Creates a new short image from the paint mask.Creates a new ubyte image from the paint mask.booleancreateImg(int slice) Creates the Java image to be displayed from the model image.booleancreateImg(int timeSlice, int slice) Creates the Java image to be displayed from the model image.voidctMode(int preset1, int preset2) Sets mode to CT and sets range to CT presets.voiddispose(boolean flag) Sets all variables to null, disposes, and garbage collects.voiddisposeLocal(boolean flag) Deprecated.Old method that does not match up with signature from VJCBase.WildMagic.LibFoundation.Mathematics.Vector3fDecrements the current slice in local coordinates and returns the new position in the view-independent file coordinates.protected voiddraw3DVOIs(Graphics offscreenGraphics2d, boolean bBlend) voiddrawGradicules(Graphics g, float xRes, float yRes) Draws the gradicules (the half-image lines which demarcate lengths in the image).private voiddrawImageText(Graphics2D offscreenGraphics2d) Draws text onto the image, such as the slice number.final voiddrawStringBW(String str, Graphics g, int x, int y) Draws a white character on a black surround.voideraseAllPaint(boolean onlyCurrent) Erases all paint.WildMagic.LibFoundation.Mathematics.Vector3ffileToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kFile) WildMagic.LibFoundation.Mathematics.Vector3ffileToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kFile) Converts image file X,Y,Z coordinates into local screen coordinates.protected voidfinalize()Calls dispose to dump this instance.Returns the active image.float[]Returns the active image buffer.float[]Returns the active image buffer for this slice.Returns the active image.Returns the active image.floatReturns float alphaBlend.int[]protected intDOCUMENT ME!int[]intReturns the VOI mode.getFrame()Returns the frame.get the color of the grid.booleanWhether or not labels should be drawn on the grid overlay.booleanDOCUMENT ME!booleanreturns whether grid overlay is being displayed.floatreturns the grid spacing in terms of resolution.floatreturns the grid spacing in terms of resolution.protected intDOCUMENT ME!Returns the imageA.Returns the imageB.float[]Gets imageA's image buffer of intensities.float[]Gets imageB's image buffer of intensities.private StringGet the system timestamp.floatGets the intensityDropper intensity.getLUTa()Returns the model lut for the imageA.getLUTb()Returns the model lut for the imageB.int[]booleanDOCUMENT ME!intFinds the number of points in the active VOI contour.intgetnVOI()Returns the number of VOIs in the active image.floatReturns float opacity.intReturns the image's orientation.booleanReturns if image/dicom overlay should be shown.Returns BitSet paintBitmap.int[]Gets the paint buffer.Gets the paint mask.int[]Gets the buffer used to store ARGB images of the image presently being displayed.int[]Gets the buffer used to store ARGB images of the image presently being displayed.static final 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.getRGBTA()Returns the ModelRGB RGBTA for imageA.getRGBTB()Returns the ModelRGB for imageB.static final 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.booleangetShowMagIntensityEnabled(int width, int height, float mag) Determines whether to enable the showIntensity checkbox for magnification box.intgetSlice()Returns the slice of the image.private StringgetTime()Get the system timestamp.intGets the time slice of the image.DOCUMENT ME!intgetxMod()intgetxSep()int[]intgetyMod()intgetySep()int[]private floatgetZoomMagnitude(float zoom, boolean reverse) Returns the magnitude zoom depending on the zoom mode.protected floatgetZoomMagnitudeX(boolean reverse) DOCUMENT ME!protected floatgetZoomMagnitudeY(boolean reverse) DOCUMENT ME!booleanbooleanTells whether or not the image is being displayed in checkerboard mode.booleanbooleanbooleanprivate BufferedImageloadImageFile(String imageName) Reads in an image icon from either the set of mipav icons or the user's $HOME/mipav/brushes/ directory.voidloadPaintBrush(String paintName, boolean isQuick) Loads built-in (.gif) or custom (.png) paint brushes based on the last-used paint brush in preferences.voidvoidprivate voidSets the number of checkers in a row and a column.voidmouseClicked(MouseEvent mouseEvent) A mouse event.voidmouseDragged(MouseEvent mouseEvent) A mouse event.voidmouseEntered(MouseEvent mouseEvent) Store the lastMouse position.voidmouseExited(MouseEvent mouseEvent) Resets the level set stack.voidmouseMoved(MouseEvent mouseEvent) A mouse event.voidmousePressed(MouseEvent mouseEvent) A mouse event.protected voidmousePressedPaint(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.voidmouseReleased(MouseEvent mouseEvent) A mouse event.voidmouseWheelMoved(MouseWheelEvent mouseWheelEvent) ************************************************************************ ************************** Mouse Wheel Events *************************voidOpen the user defined LUT table and transfer function.voidpaintComponent(Graphics graphics) Paints the image and calls drawSelf for all VOIs.voidpaintComponentForPrinter(int tx, int ty, Graphics g) Paints the image and calls drawSelf for all VOIs and also resizes the image if it is too big for printer.voidpaintMagComponent(Graphics2D graphics2d) Paints a magnified window over the image centered about the cursor.WildMagic.LibFoundation.Mathematics.Vector3fpatientToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kPt) WildMagic.LibFoundation.Mathematics.Vector3fpatientToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kPt) Converts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.protected voidperformPaint(MouseEvent event) DOCUMENT ME!protected voidperformPaint(MouseEvent mouseEvent, boolean erase) This method will set or clear the paint bitmap as the user paints on-screen.protected voidprocessDefaultMouseDrag(MouseEvent mouseEvent, int xS, int yS) processDefaultMouseDrag performs the mouseDrag operations when in DEFAULT mode.voidBackups up ( and swaps if not null) the current and previously used paintBrush.voidreadLUTandTFunctFrom(String filename, String dirName) This method reads a LUT and Transfer function from a file diretory specified.private voidvoidvoidrecordZoom(boolean zoomIn) voidregionGrow(short x, short y, short z, float valueR, float valueG, float valueB, ModelImage image, String leadString, boolean click) Grows a region based on a starting supplied.voidregionGrow(short x, short y, short z, float valueR, float valueG, float valueB, String str, boolean click) Grows a region based on a starting supplied.voidregionGrow(short x, short y, short z, float value, ModelImage image, String leadString, boolean click) Grows a region based on a starting supplied.voidregionGrow(short x, short y, short z, float value, String str, boolean click) Grows a region based on a starting supplied.voidregionGrow(String str) Grows a region based on a starting supplied.voidregionGrowColor(String str) Grows a region based on a starting supplied.voidRemembers the current paint brush size so that it can be reset later.private voidrepaintImageIntensityLabelFast(Graphics2D graphics2d) Repaints the image intensity label.private voidrepaintPaintBrushCursorFast(Graphics2D graphics2d) Repaints the paint brush cursor without repainting the entire image.voidresetLUT(ModelLUT LUT, ModelImage image) DOCUMENT ME!voidResets the LUTs.voidResets the paint brush size to the remembered value.private voidDOCUMENT ME!voidvoidsaveLUTandTransferFunction(String filename, String dirName) This method saves the LUT for the active image.voidSave user defined LUT table.booleanscreenToFile(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt) WildMagic.LibFoundation.Mathematics.Vector3fscreenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen) booleanscreenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile) booleanscreenToFileVOI(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.Vector3fscreenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen) Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.booleanscreenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile) Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.voidsetActiveImage(int active) Sets the active image for drawing VOIs.voidsetAlphaBlend(int value) Sets the alpha blending of parameter for two image displaying.voidsetBandSpacing(int[] bandSpacing) voidsetBuffers(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.voidsetCenter(WildMagic.LibFoundation.Mathematics.Vector3f center) Sets the currently displayed image slice.voidsetCheckerboard(int rowCheckers, int columnCheckers) Sets the image to display in "Checkerboard" mode with the given numbers of rows and columns.voidsetCheckerboardAnimate(boolean doCheckerboardAnimate) voidsetCrosshairCursor(Cursor curs) Changes the Crosshair cursor to be either the default crosshair or a pre-existing gif.voidsetCursorMode(int mode) Switches modes based on the variable mode.voidsetDisplayFuzzy(boolean val) Sets whether a fuzzy image is displayed.voidsetDrawVOIs(boolean drawVOIs) voidsetEnabled(boolean flag) Enables or disables the component for modification.voidsetEyetrackerRecordingMode(int modeType) Set the eye tracking recording mode typevoidsetEyetrackerRecordMode(int modeType) voidsetFrameControls(ViewControlsImage controls) Sets the frameControls.voidsetFullScreenModeLocation(String _location) voidsetFuzzyThreshold(float val) Sets whether fuzzy connectedness is used and the fuzzy threshold.voidsetGridColor(Color color) set the color of the grid.voidsetGridLabelingOn(boolean doLabel) Tells the grid overlay (if on) to show abc/123 labeling.voidsetGridLabelOrientation(boolean or) Sets the axis orientation of abc and 123 labeling of the grid overlay.voidsetGridOverlay(boolean flag) Sets whether or not to show the NEI grid overlay.voidsetGridSpacingX(float spacing) sets the grid spacing (horizontal) in terms of resolution.voidsetGridSpacingY(float spacing) sets the grid spacing (horizontal) in terms of resolution.voidsetGrowDialog(RegionGrowDialog dialog) Sets the RegionGrowDialog for this class (usually used to set it to null).voidsetHasThreshold1(boolean hasThreshold1) Sets the hasThreshold1 for setPaintBuffers.voidsetHasThreshold2(boolean hasThreshold2) Sets the hasThreshold2 for setPaintBuffers.voidChanges the color used to highlight the currently on-top image.voidsetImageA(ModelImage image) Sets component's ImageA. assumes dimensionality same as image B's for now.voidsetImageB(ModelImage image) Sets component's ImageB. !!!!!!voidsetImageBufferB(float[] buffer) Sets component's ImageB buffer.voidsetImageColocalize(ModelImage imageColocalize) Sets the colocalize image.voidsetImageExtents(int[] imageExtents) DOCUMENT ME!voidsetImageSlice(int slice) Set the image slice number, and recording the action as slider changes on single eye tracker viewer.voidsetIntensityDropper(float intensityDropper) Sets the intensityDropper intensity.voidsetLess(float val) Sets less for regionGrow.voidsetLessB(float val) Sets lessB for regionGrow.voidsetLessG(float val) Sets lessG for regionGrow.voidsetLessR(float val) Sets lessR for regionGrow.voidsetLogMagDisplay(boolean flag) Sets the log magnitude display flag.voidaccessor that sets the model LUT for the imageA.voidSets the model LUTb for the imageB.voidsetMakingCheckerboard(boolean makingCheckerboard) voidsetMaxDistance(int val) Sets maxDistance for regionGrow.voidsetModifyFlag(boolean flag) DOCUMENT ME!voidsetMore(float val) Sets more for regionGrow.voidsetMoreB(float val) Sets moreB for regionGrow.voidsetMoreG(float val) Sets moreG for regionGrow.voidsetMoreR(float val) Sets moreR for regionGrow.voidsetOverlay(boolean flag) Sets whether or not to show the overlay.voidsetPaintBitmapSwitch(boolean paintBitmapSwitch) If true do not getMask on a setActiveImage command so as to keep the mask from the old active image.voidsetPaintBrushSize(int paintBrushSize) Switches modes based on the variable mode.voidsetPaintMask(BitSet mask) Sets the paint mask.voidsetPixelInformationAtLocation(int xS, int yS, boolean isControlDown) Prints ModelImage information at the mouse location.voidsetRegionGrowVars(short x, short y, short z, float val) Sets the variables used to remember the point where the last region grow was started from.voidvoidSets the RGB table for ARGB image A.voidSets the RGB table for ARGB image B.voidsetShowMagIntensity(boolean flag) Sets whether to show intensity in mag. boxvoidsetShowSliceNum(boolean flag) Sets whether the slice number will be shown in the lower left hand corner of the image.voidsetSizeLimit(int val) Sets sizeLimit for regionGrow.voidsetSlice(int _slice) Sets the slice of the image.voidsetStringOverride(String str) Sets the string painted on the lower left.voidsetThresholdColors(boolean useRedThreshold, boolean useGreenThreshold, boolean useBlueThreshold) Sets the booleans for using thresholds in setColorPaintBuffers.voidsetThresholds(float threshold1, float threshold2) Sets the thresholds.voidsetTimeSlice(int _slice) Sets the time slice of the image.voidsetUseVOI(boolean val) Sets whether a selected VOI is used to calculate the initial variance.voidsetVariableThresholds(boolean variableThresholds) If true varies thresholds with region growth.voidsetVOIManager(VOIManager kManager) voidsetWindLevel(int window, int level) Set the window level value from the eye trackervoidsetxSep(int xSep) voidsetySep(int ySep) voidsetZeroToOneLUTAdj(boolean zeroToOneLUTAdj) booleanshow(int tSlice, int zSlice, boolean forceShow) For generating the display of 1 or 2 images.booleanShows the image and the VOI(s).booleanShows the image and the VOI(s).booleanResets the buffer to 0s and displays a blank image.protected voidDraws a grid on top of the image according to the gridSpacingX and gridSpacingY.voidDisplays Image overlays (DICOM or image attributes).voidshowRegionInfo(int count, double[] total, double[] mean, double[] stdDev, String leadString) Display statistics about the grown region.voidshowRegionInfo(int count, float[] total, float[] mean, float[] stdDev, String leadString) Display statistics about the grown region.voidshowRegionInfo(int count, String leadString) Display statistics about the grown region.voidOpens a JDialogStatistics to allow computation ofROI statistics.voidUndoes the last paint.voidupdatePaint(BitSet region, boolean backup, boolean isGrower) Causes the image to update its paint bit mask and redisplay itself.voidUpdates the Paint Cursor's BufferedImage with the correct color/opacity.WildMagic.LibFoundation.Mathematics.Vector3fupSlice()Increments the current slice in local coordinates and returns the new position in the view-independent file coordinates.voiduseHighlight(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, updateMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gov.nih.mipav.view.renderer.WildMagic.VOI.ScreenCoordinateListener
getHeight, getResolutionX, getResolutionY, getWidth, getZoomX, getZoomY
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
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_ZOOMUsed to indicte geometric zoom steps (2x, 4x, 8x, 16x ...).- See Also:
-
LINEAR_ZOOM
public static final int LINEAR_ZOOMUsed to indicte linear zoom steps (2x, 3x, 4x, 5x ...).- See Also:
-
checkerDialog
Dialog used to set properties of the checkerboard display:(Image A displayed in alternating squares with Image B. -
growDialog
Dialog used to control region growing of the paint tool. -
intensityDropper
public float intensityDropperUsed in paint to indicate intensity painted into the image. -
MAGR_HEIGHT
public int MAGR_HEIGHTDefault size of magnifier window = 120 pixels. -
MAGR_MAG
public float MAGR_MAGMagnification value of magnifier window -- default = 4.0. -
MAGR_WIDTH
public int MAGR_WIDTHdefault = 120 pixels. -
allActive
protected boolean allActiveSet to true when all contours of a VOI are active. -
alphaBlend
protected float alphaBlendValue used to control the display when compositing two images. Usually = 1 - alphaPrime. -
alphaPrime
protected float alphaPrimeValue 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
String representing RGB components used in applied paint -
cleanImageBufferA
protected int[] cleanImageBufferABuffer used to store ARGB images of the image presently being displayed. -
cleanImageBufferB
protected int[] cleanImageBufferBBuffer used to store ARGB images of the image presently being displayed. -
crosshairCursor
Crosshair cursor that can be changed per user preference (in Mipav Options). -
cursorMode
protected int cursorModeUsed to describe the cursor mode. -
displayFuzzy
protected boolean displayFuzzyDOCUMENT ME! -
drawVOIs
protected boolean drawVOIsFlag used to prohibit VOI drawing. -
frame
Frame where the component image is displayed. -
frameControls
Controls having color and opacity. -
fuzzyThreshold
protected float fuzzyThresholdRegion grow parameters fuzzyConnectedness is not used if fuzzyThreshold is less than 0. When fuzzyConnectedness is used, fuzzyThreshold ranges from 0 to 1. -
imageA
Model for image A. -
imageActive
Active image. -
imageB
Model for image B. -
imageBufferA
protected float[] imageBufferABuffer for image A, raw intensity. -
imageBufferActive
protected float[] imageBufferActiveBuffer for active image. -
imageBufferB
protected float[] imageBufferBBuffer for image B, raw intensity. -
imageExtents
protected int[] imageExtentsThe dimensionality of the image. -
imageStatList
DOCUMENT ME! -
less
protected float lessDOCUMENT ME! -
lessB
protected float lessBDOCUMENT ME! -
lessG
protected float lessGDOCUMENT ME! -
lessR
protected float lessRDOCUMENT ME! -
logMagDisplay
protected boolean logMagDisplayFlag for displaying logMag. -
LUTa
Lookup table for image A. -
LUTb
Lookup table for image B. -
m_kPatientSlice
PatientSlice contains all the Patient Coordinate system view-specific data for rendering this component:. -
magSettings
Dialog used to control the magnification of the image. -
maxDistance
protected float maxDistanceDOCUMENT ME! -
maxExtents
protected int[] maxExtentsDOCUMENT ME! -
modifyFlag
protected boolean modifyFlagUsed to "lock" display when an algorithm is in the calculation process. -
more
protected float moreDOCUMENT ME! -
moreB
protected float moreBDOCUMENT ME! -
moreG
protected float moreGDOCUMENT ME! -
moreR
protected float moreRDOCUMENT ME! -
mousePressIsShiftDown
protected boolean mousePressIsShiftDownKeep track of state of shift for mouse Pressed events. -
nColumnCheckers
protected int nColumnCheckersThe number columns when two images are displayed in the checker board mode. -
nRowCheckers
protected int nRowCheckersCheckerboard display parameters. The number of rows to display. -
onTop
protected boolean onTopfor the use of the user-notifier. -
orientation
protected int orientationorientation of the slice, may be AXIAL, CORONAL, SAGITTAL, or UNKNOWN_ORIENT. -
paintBitmap
Buffer used to indicate if the pixel location is painted (true) or unpainted (false). -
paintBitmapBU
Backup of paint buffer for undo. -
paintBitmapSwitch
protected boolean paintBitmapSwitchif true do not getMask on a setActiveImage command so as to keep the mask from the old active image. -
paintBrush
BitSet used for painting (brushes on/off). -
paintBrushDim
Dimension of the paint. -
paintBrushDimPrevious
DOCUMENT ME! -
paintBrushPrevious
DOCUMENT ME! -
paintBrushSize
protected int paintBrushSizePaint brush size. -
paintImage
buffered image that is transparent to show the paintbrush cursor. -
paintImagePrevious
DOCUMENT ME! -
pixBuffer
protected int[] pixBufferThe buffer used to store the ARGB image of the image presently being displayed. -
pixBufferB
protected int[] pixBufferBBuffer used to store ARGB image of the windowed imageB. -
previousPaintBrush
protected int previousPaintBrushThe 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
DOCUMENT ME! -
RGBTB
DOCUMENT ME! -
saveValue
protected float saveValueUsed with commitMask(int imagesDone), to save the value. -
saveValueB
protected float saveValueBDOCUMENT ME! -
saveValueG
protected float saveValueGDOCUMENT ME! -
saveValueR
protected float saveValueRDOCUMENT ME! -
saveX
protected short saveXUsed with commitMask(int imagesDone), to save positions. -
saveY
protected short saveYUsed with commitMask(int imagesDone), to save positions. -
saveZ
protected short saveZUsed with commitMask(int imagesDone), to save positions. -
seedPaintBitmap
Buffer used to remember the area painted around the last seed point for region growing. -
seedVal
protected float seedValSeed value to start the region grow. -
seedValB
protected float seedValBDOCUMENT ME! -
seedValG
protected float seedValGDOCUMENT ME! -
seedValR
protected float seedValRDOCUMENT ME! -
sizeLimit
protected int sizeLimitDOCUMENT ME! -
slice
protected int sliceDOCUMENT ME! -
stringOverride
String used to override the slice number in the lower left corner. -
time
protected long timeDOCUMENT ME! -
timeSlice
protected int timeSliceDOCUMENT ME! -
toppedColor
DOCUMENT ME! -
useVOI
protected boolean useVOIThis 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 variableThresholdsDOCUMENT ME! -
visRect
Visible rectangle to draw topped. -
winLevelSet
protected boolean winLevelSetUser invokes window and level adjustment with right mouse drag in DEFAULT mode. -
xPG
protected short xPGX coord of seed point. -
yPG
protected short yPGY coord of seed point. -
zPG
protected short zPGZ coord of seed point. -
cleanImageB
DOCUMENT ME! -
intensityLabel
private boolean intensityLabelIf true then the x,y location and pixel/voxel intensity should be displayed (x,y: intensity). -
lastWinRegionSlice
private int lastWinRegionSliceLast 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
window / level mouse control:. -
offscreenImage
DOCUMENT ME! -
paintImageBuffer
private int[] paintImageBufferThis image indicates which images have been painted. -
shiftDown
private boolean shiftDownFlag used to indicate if the shift key is depressed. True indicates the shift key is depressed. -
showMagIntensity
private boolean showMagIntensityFlag 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 wasDraggingBoolean to determine if the mouse had been dragging before mouse release (for moving and setting active). -
windowedRegionSize
private int windowedRegionSizeThe 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 zeroToOneLUTAdjflag indicating whether there is 0 to 1 LUT Adjustment * -
paintBuffer
protected int[] paintBuffer -
gridColor
color of grid. -
gridLabelingOn
protected boolean gridLabelingOnif number/lettering should be displayed for grid boxes. -
gridLabelOrientation
protected boolean gridLabelOrientationboolean to determine the orientation: true is x-axis numbered false is x-axis lettered. -
gridOverlayOn
protected boolean gridOverlayOnFlag to indicate if NEI grid overlay should be displayed. -
gridSpacingX
protected float gridSpacingXspacing of the grid (horizontal) in terms of resolution. -
gridSpacingY
protected float gridSpacingYspacing of the grid (vertical) in terms of resolution. -
overlayOn
protected boolean overlayOnFlag to indicate if DICOM overlay should be displayed. -
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
-
eyeTrackerRecordingMode
private int eyeTrackerRecordingMode -
SingleFrameEyetrackerMode
public static int SingleFrameEyetrackerMode -
MultiFrameEyetrackerMode
public static int MultiFrameEyetrackerMode -
PluginEyetrackerMode
public static int PluginEyetrackerMode -
winLevel
-
-
Constructor Details
-
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 Details
-
getScannerPositionLabels
public static final 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 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
Calculates the volume of the painted voxels.- Parameters:
str- string in showRegionGrowinvalid reference
#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, Vector<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, Vector<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, Vector<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
Creates a new ubyte image from the paint mask.- Returns:
- the name of the new ubyte image
-
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:
disposein 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
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
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
Returns the active image.- Specified by:
getActiveImagein 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
Returns the active image.- Returns:
- active image
-
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
Returns the frame.- Returns:
- frame
-
getImageA
Returns the imageA.- Returns:
- imageA
-
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
Returns the model lut for the imageA.- Returns:
- the model LUT for imageA
-
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
Returns BitSet paintBitmap.- Returns:
- paintBitmap
-
getPaintBuffer
public int[] getPaintBuffer()Gets the paint buffer.- Returns:
- int[] paint buffer
-
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
Returns the ModelRGB RGBTA for imageA.- Returns:
- RGBTA for imageA
-
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:
getSlicein interfaceScreenCoordinateListener- Returns:
- the slice
-
getTimeSlice
public int getTimeSlice()Gets the time slice of the image.- Returns:
- the current time slice
-
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
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:
IOException
-
loadPaintBrush
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
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:
mouseClickedin interfaceMouseListener- Parameters:
mouseEvent- event that triggers function; contains click count
-
mouseDragged
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:
mouseDraggedin interfaceMouseMotionListener- Parameters:
mouseEvent- event that triggered function
-
mouseEntered
Store the lastMouse position.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
mouseEvent- event
-
mouseExited
Resets the level set stack.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
mouseEvent- event that triggered function
-
mouseMoved
A mouse event. If the mode is level set, draws level sets as user moves mouse. Otherwise, changes the cursor depending on where the mouse is in relation to the VOI.- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
mouseEvent- event that triggered the function
-
setFullScreenModeLocation
-
mousePressed
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:
mousePressedin interfaceMouseListener- Parameters:
mouseEvent- event that triggered function
-
mouseReleased
A mouse event. This function sets up and draws the VOI according to the mode.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
mouseEvent- event that triggered function
-
mouseWheelMoved
************************************************************************ ************************** Mouse Wheel Events *************************.************************************************************************- Specified by:
mouseWheelMovedin interfaceMouseWheelListener- Parameters:
mouseWheelEvent- DOCUMENT ME!
-
restartCheckerboardAnimateThread
public void restartCheckerboardAnimateThread() -
openUDLUTandTransferFunct
public void openUDLUTandTransferFunct()Open the user defined LUT table and transfer function. -
getRGBPaintComponents
-
setRGBPaintComponents
-
paintComponent
Paints the image and calls drawSelf for all VOIs.- Overrides:
paintComponentin classViewJComponentBase- Parameters:
graphics- graphics
-
setDrawVOIs
public void setDrawVOIs(boolean drawVOIs) -
paintComponentForPrinter
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
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
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:
regionGrowin interfacePaintGrowListener- Parameters:
str- the string to prepend to message containing region growth statistics
-
regionGrow
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, 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, 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, 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
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
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
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
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:
setDisplayFuzzyin interfacePaintGrowListener- Parameters:
val- whether to show the fuzzy connectedness image
-
setEnabled
public void setEnabled(boolean flag) Enables or disables the component for modification.- Overrides:
setEnabledin classJComponent- Parameters:
flag- true = modify, and false = locked
-
setFrameControls
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:
setFuzzyThresholdin interfacePaintGrowListener- Parameters:
val- the fuzzy connectedness threshold value
-
setGrowDialog
Sets the RegionGrowDialog for this class (usually used to set it to null).- Specified by:
setGrowDialogin 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
Changes the color used to highlight the currently on-top image.- Parameters:
c- the new color to use.
-
setImageA
Sets component's ImageA. assumes dimensionality same as image B's for now.- Parameters:
image- imageA
-
setImageB
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
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:
setLessin 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
accessor that sets the model LUT for the imageA.- Parameters:
LUT- the model LUT
-
setLUTb
Sets the model LUTb for the imageB.- Parameters:
LUT- the model LUT
-
setMaxDistance
public void setMaxDistance(int val) Sets maxDistance for regionGrow.- Specified by:
setMaxDistancein 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:
setMorein 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
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
Sets the RGB table for ARGB image A.- Parameters:
RGBT- RGB table
-
setRGBTB
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:
setSizeLimitin 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
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:
setUseVOIin 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
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
Display statistics about the grown region.- Specified by:
showRegionInfoin 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, 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, 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
Causes the image to update its paint bit mask and redisplay itself.- Specified by:
updatePaintin 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-truewill 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
-
finalize
Calls dispose to dump this instance.- Overrides:
finalizein classViewJComponentBase- Throws:
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
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
DOCUMENT ME!- Parameters:
event- DOCUMENT ME!
-
performPaint
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
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
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
Repaints the image intensity label.- Parameters:
graphics2d- Graphics2D the graphics context to draw in
-
repaintPaintBrushCursorFast
Repaints the paint brush cursor without repainting the entire image.- Parameters:
graphics2d- Graphics2D the graphics context to draw in
-
resetLUT
DOCUMENT ME!- Parameters:
LUT- DOCUMENT ME!image- DOCUMENT ME!
-
resetRGB
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
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
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
-
setVOIManager
-
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
Draws a grid on top of the image according to the gridSpacingX and gridSpacingY.- Parameters:
g- Graphics the graphics used to draw
-
showOverlay
Displays Image overlays (DICOM or image attributes).- Parameters:
g- Graphics object used to paint and display the strings.
-
buildOverlayStrings
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:ScreenCoordinateListenerConverts image file X,Y,Z coordinates into local screen coordinates.- Specified by:
fileToScreenVOIin 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:ScreenCoordinateListenerConverts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.- Specified by:
patientToScreenVOIin 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:ScreenCoordinateListenerConverts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOIin 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:ScreenCoordinateListenerConverts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOIin 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:ScreenCoordinateListenerConverts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOIin 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:ScreenCoordinateListenerSets the currently displayed image slice.- Specified by:
setCenterin interfaceScreenCoordinateListener
-
getImageTimeStamp
Get the system timestamp.- Returns:
-
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
-