Class ViewJComponentEditImage

All Implemented Interfaces:
PaintGrowListener, ScreenCoordinateListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener
Direct Known Subclasses:
ViewJComponentDTIImage, ViewJComponentPedsAtlasIconImage, ViewJComponentRegistration, ViewJComponentSingleRegistration, ViewJComponentTriImage

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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • ACTIVE_IMAGE_COLOR

      public static 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:
    • LINEAR_ZOOM

      public static final int LINEAR_ZOOM
      Used to indicte linear zoom steps (2x, 3x, 4x, 5x ...).
      See Also:
    • 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 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 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 BitSet paintBitmap
      Buffer used to indicate if the pixel location is painted (true) or unpainted (false).
    • paintBitmapBU

      protected 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 BitSet paintBrush
      BitSet used for painting (brushes on/off).
    • paintBrushDim

      protected Dimension paintBrushDim
      Dimension of the paint.
    • paintBrushDimPrevious

      protected Dimension paintBrushDimPrevious
      DOCUMENT ME!
    • paintBrushPrevious

      protected BitSet paintBrushPrevious
      DOCUMENT ME!
    • paintBrushSize

      protected int paintBrushSize
      Paint brush size.
    • paintImage

      protected BufferedImage paintImage
      buffered image that is transparent to show the paintbrush cursor.
    • paintImagePrevious

      protected 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 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 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 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 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 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 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 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 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 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 imageA
      imgBufferA - storage buffer used to display image A
      _imageB - Model of the image that will be displayed
      _LUTb - LUT used to display imageB
      imgBufferB - storage buffer used to display image B
      pixelBuffer - storage buffer used to build a displayable image
      zoom - initial magnification of image
      extents - initial display dimensions of the image
      logMagDisplay - 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

      public void calcPaintedVolume(String str)
      Calculates the volume of the painted voxels.
      Parameters:
      str - string in showRegionGrow
      invalid 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 BseedVOTH
      clearPaintMask - if true clear paint mask
      polarity - 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 BseedVOTH
      clearPaintMask - if true clear paint mask
      polarity - 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 BseedVOTH
      clearPaintMask - if true clear paint mask
      polarity - DOCUMENT ME!
      intensityLockVector - Vector containing Integers values which are indexed to the locked intensity values in the image
      showProgressBar - 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 BseedVOTH
      clearPaintMask - if true clear paint mask
      polarity - DOCUMENT ME!
      intensityLockVector - Vector containing Integers values which are indexed to the locked intensity values in the image
      showProgressBar - if true, shows the progress bar for this algorithm
    • commitPaintToUbyteMask

      public String commitPaintToUbyteMask()
      Creates a new ubyte image from the paint mask.
      Returns:
      the name of the new ubyte image
    • commitPaintToMask

      public 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 class ViewJComponentBase
      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(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(String str, Graphics g, int x, int y)
      Draws a white character on a black surround.
      Parameters:
      str - string to be displayed
      g - graphics contexts (where to draw the string)
      x - x coordinate of where the string is to be drawn
      y - 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 interface PaintGrowListener
      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 BitSet getPaintBitmap()
      Returns BitSet paintBitmap.
      Returns:
      paintBitmap
    • getPaintBuffer

      public int[] getPaintBuffer()
      Gets the paint buffer.
      Returns:
      int[] paint buffer
    • getPaintMask

      public 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 interface ScreenCoordinateListener
      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 BufferedImage loadImageFile(String imageName) throws 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:
      IOException
    • loadPaintBrush

      public void loadPaintBrush(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 load
      isQuick - DOCUMENT ME!
    • mouseClicked

      public void mouseClicked(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 interface MouseListener
      Parameters:
      mouseEvent - event that triggers function; contains click count
    • mouseDragged

      public void mouseDragged(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 interface MouseMotionListener
      Parameters:
      mouseEvent - event that triggered function
    • mouseEntered

      public void mouseEntered(MouseEvent mouseEvent)
      Store the lastMouse position.
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      mouseEvent - event
    • mouseExited

      public void mouseExited(MouseEvent mouseEvent)
      Resets the level set stack.
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      mouseEvent - event that triggered function
    • mouseMoved

      public void mouseMoved(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 interface MouseMotionListener
      Parameters:
      mouseEvent - event that triggered the function
    • setFullScreenModeLocation

      public void setFullScreenModeLocation(String _location)
    • mousePressed

      public void mousePressed(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 interface MouseListener
      Parameters:
      mouseEvent - event that triggered function
    • mouseReleased

      public void mouseReleased(MouseEvent mouseEvent)
      A mouse event. This function sets up and draws the VOI according to the mode.
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      mouseEvent - event that triggered function
    • mouseWheelMoved

      public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent)
      ************************************************************************ ************************** Mouse Wheel Events *************************.************************************************************************
      Specified by:
      mouseWheelMoved in interface MouseWheelListener
      Parameters:
      mouseWheelEvent - DOCUMENT ME!
    • restartCheckerboardAnimateThread

      public void restartCheckerboardAnimateThread()
    • openUDLUTandTransferFunct

      public void openUDLUTandTransferFunct()
      Open the user defined LUT table and transfer function.
    • getRGBPaintComponents

      public String getRGBPaintComponents()
    • setRGBPaintComponents

      public void setRGBPaintComponents(String rgb)
    • paintComponent

      public void paintComponent(Graphics graphics)
      Paints the image and calls drawSelf for all VOIs.
      Overrides:
      paintComponent in class ViewJComponentBase
      Parameters:
      graphics - graphics
    • setDrawVOIs

      public void setDrawVOIs(boolean drawVOIs)
    • paintComponentForPrinter

      public void paintComponentForPrinter(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.
      Parameters:
      tx - x translation
      ty - y translation
      g - graphics
    • paintMagComponent

      public void paintMagComponent(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(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 interface PaintGrowListener
      Parameters:
      str - the string to prepend to message containing region growth statistics
    • regionGrow

      public void regionGrow(short x, short y, short z, float value, 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 point
      y - y coordinate of the seed point
      z - z coordinate of the seed point
      value - Intensity value at the seed point
      str - String to start line with
      click - 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 point
      y - y coordinate of the seed point
      z - z coordinate of the seed point
      value - Intensity value at the seed point
      image - the image to perform the region grow in
      leadString - the string to append to the region grow output
      click - 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 point
      y - y coordinate of the seed point
      z - z coordinate of the seed point
      valueR - Red intensity value at the seed point
      valueG - Green intensity value at the seed point
      valueB - Blue intensity value at the seed point
      str - String to start line with
      click - 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 point
      y - y coordinate of the seed point
      z - z coordinate of the seed point
      valueR - Red value at the seed point
      valueG - Green value at the seed point
      valueB - Blue value at the seed point
      image - the image to perform the region grow in
      leadString - the string to append to the region grow output
      click - whether this region grow was initiated by a click on the image
    • regionGrowColor

      public void regionGrowColor(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(String filename, 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 as
      dirName - directory to save LUT to
    • readLUTandTFunctFrom

      public void readLUTandTFunctFrom(String filename, String dirName)
      This method reads a LUT and Transfer function from a file diretory specified.
      Parameters:
      filename - filename of LUT
      dirName - 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 A
      imgBufferB - storage buffer used to display image B
      pixBuff - storage buffer used to build a displayable image
      pixBuffB - 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 rows
      columnCheckers - int # of columns
    • setCrosshairCursor

      public void setCrosshairCursor(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 interface PaintGrowListener
      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 class 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 interface PaintGrowListener
      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 interface PaintGrowListener
      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(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 interface PaintGrowListener
      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 interface PaintGrowListener
      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 interface PaintGrowListener
      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(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 location
      yS - 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 coordinate
      y - y coordinate
      z - z coordinate
      val - 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 interface PaintGrowListener
      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(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 buffer
      useGreenThreshold - whether to threshold the green paint buffer
      useBlueThreshold - whether to threshold the blue paint buffer
    • setThresholds

      public void setThresholds(float threshold1, float threshold2)
      Sets the thresholds.
      Parameters:
      threshold1 - the first threshold
      threshold2 - 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 interface PaintGrowListener
      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 show
      zSlice - z slice to show
      forceShow - 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 show
      zSlice - 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 null
      forceShow - 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 show
      zSlice - 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 null
      forceShow - forces this method to import image and recalculate java image
      interpMode - 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, String leadString)
      Display statistics about the grown region.
      Specified by:
      showRegionInfo in interface PaintGrowListener
      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 intensities
      mean - Average pixel intensity
      stdDev - Standard deviation of pixel intensities
      leadString - 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 intensities
      mean - Average pixel intensity
      stdDev - Standard deviation of pixel intensities
      leadString - 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(BitSet region, boolean backup, boolean isGrower)
      Causes the image to update its paint bit mask and redisplay itself.
      Specified by:
      updatePaint in interface PaintGrowListener
      Parameters:
      region - new paint region bit set
      backup - whether to save the previous paint mask to allow the update to be un-done
      isGrower - 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(Graphics offscreenGraphics2d, boolean bBlend)
    • finalize

      protected void finalize() throws Throwable
      Calls dispose to dump this instance.
      Overrides:
      finalize in class ViewJComponentBase
      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

      protected void mousePressedPaint(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(MouseEvent event)
      DOCUMENT ME!
      Parameters:
      event - DOCUMENT ME!
    • performPaint

      protected void performPaint(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 action
      erase - boolean if true, paintBitmap is cleared (erased), otherwise paintBitmap is set (painted)
    • processDefaultMouseDrag

      protected void processDefaultMouseDrag(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 event
      xS - the mouse x location on screen
      yS - 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(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(Graphics2D graphics2d)
      Repaints the image intensity label.
      Parameters:
      graphics2d - Graphics2D the graphics context to draw in
    • repaintPaintBrushCursorFast

      private void repaintPaintBrushCursorFast(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 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(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(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(Graphics g)
      Displays Image overlays (DICOM or image attributes).
      Parameters:
      g - Graphics object used to paint and display the strings.
    • buildOverlayStrings

      private String buildOverlayStrings(FileInfoBase inf, String name, 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 interface ScreenCoordinateListener
      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 interface ScreenCoordinateListener
      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 interface ScreenCoordinateListener
      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 interface ScreenCoordinateListener
      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 interface ScreenCoordinateListener
      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 interface ScreenCoordinateListener
    • getImageTimeStamp

      private String getImageTimeStamp()
      Get the system timestamp.
      Returns:
    • getTime

      private 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 preset
      preset2 - second CT preset