CmpSpots
Class CmpShowImage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by CmpSpots.CmpShowImage
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class CmpShowImage
extends javax.swing.JFrame
implements java.lang.Runnable, java.awt.event.ItemListener, java.awt.event.ActionListener, java.awt.event.WindowListener

Class CmpShowImage.java class implements a popup GUI to show images used in the 2D spot pairing program.

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Open2Dprot Mozilla and Legal files are available on http://Open2Dprot.sourceforge.net/.

Version:
$Date: 2005/10/20 12:20:34 $ $Revision: 1.22 $
Author:
P. Lemkin, NCI-Frederick, Frederick, MD, 21702
See Also:
Open2Dprot Home, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 java.awt.Checkbox addLandmarksCB
          the "Add landmarks" checkbox
private  java.awt.Adjustable aH
           
 boolean alreadyViewedFlag
          flag for closing and reopening popup
private  java.awt.Adjustable aV
           
 java.lang.String baseImageFile
          base name of the image for use in the title
 boolean changeGuiFlag
          flag to indicating that the GUI may have changed and that it should be rebuilt.
 java.awt.Panel controlPanel
          Control panel for the main frame
 CmpSpots cs
          instance of the main class
 int currentPix
          current displayed img index
 java.lang.String dataUnits
          Data type as fct of histogram data type
 java.lang.String dispName
          Name of image to display after spot pairing
 char[] dispPixC
          Picture buffer char[] of image to display after spot pairing.
 java.awt.Choice dispPixChoice
          Selector for image to display after spot pairing
 java.lang.String dispPixFile
          File of image to display after spot pairing.
static int DIST_THR
          Distance threshold in pixels from mouse (x,y) to spot centroid to find spot
 boolean drawHorizSliceFlag
          menu CB item to display horizontal slice
 boolean drawVertSliceFlag
          menu CB item to display vertical slice
 java.awt.Menu fileMenu
          "File" pull down Menu list
 boolean filterByAPlabelFlag
          menu CB item to filter spots by AP label
 boolean filterByCurLMSFlag
          set from "Filter by LMS" checkbox
 java.awt.Checkbox filterbyLMSCB
          the "Filter by LMS" Checkbox
 boolean filterByPPlabelFlag
          menu CB item to filter spots by PP label
 boolean filterBySPlabelFlag
          menu CB item to filter spots by SP label
 boolean filterByUSlabelFlag
          menu CB item to filter spots by US label
 boolean filterGEQactiveBinFlag
          menu CB item to test spots for GEQ activeBin value, else LEQ activeBin value fromt the selected histogram bin for the histogram histType spot data.
 java.awt.Menu filterMenu
          "Filter" pull down Menu list
 java.lang.String fontFamily
           
 boolean hasHistGUIflag
          flag to indicate that the GUI contains the Histogram sub-GUI
 DrawHistogram hCanvas
          Histogram Canvas to hold the image
 int[] hist
          full input unscaled histogram data [0:nHist-1]
static int HIST_DL_DIST
          types of histogram data allowed
static int HIST_DP_DIST
          types of histogram data allowed
static int HIST_HEIGHT
          Height of the histogram
static int HIST_LMS_SIZE
          types of histogram data allowed
static int HIST_NONE
          types of histogram data allowed
static int HIST_PAIRING_LABELS
          types of histogram data allowed
static int HIST_WIDTH
          Width of the histogram
 java.awt.Choice histChoice
          "Histogram" Choice list
 java.awt.Menu histMenu
          "Histogram" pull down Menu list
static java.lang.String[] histNames
          list of histogram data types
 int histType
          type of data to use with the histogram
 java.awt.Font hugeFont
           
 java.awt.Font humongousFont
           
 boolean isVisibleFlag
          Set true if window is visible
 java.awt.Font largeFont
           
 boolean logReportFlag
          set from "Log report" checkbox menu item
 float maxDataValue
          Maximum value expected for current hist[] data
(package private)  java.awt.MenuBar mbar
          menu bar for the frame
 java.awt.Font mediumFont
           
 java.awt.Font microFont
           
 float minDataValue
          Minimum value expected for current hist[] data
 MenuSupport ms
          Menu support functions using Hashtables to tack what is active
private  java.awt.TextArea msgTextArea
          Text area GUI for message rporting
(package private) static int NCOLS
           
 int nHist
          size of input unscaled histogram[] data
private  boolean notDoneFlag
          Set to kill the run loop
 int nPixels
          The pixWidth*pixHeight
 int nPixList
          The size of the lists in case list contents is less than size
(package private) static int NROWS
          size of the text area in characters
 int nSampleDisp
          Sample to display after spot pairing.
 int nsampleSelected
          Compute the selected sample (either RSAMPLE or SAMPLE).
 java.lang.String oGifFileName
          Full path of image to "Save image" in
 java.awt.Image pImg
          Image to display
 char[][] pixClist
          List of display pix names associated char[] images
 java.lang.String[] pixFileList
           
 int pixHeight
          The width of the current image
 int[] pixHeightSize
          List of pix widths[] associated with images
 java.lang.String[] pixMenuList
          list of display picture menu commands for choices
 java.lang.String[] pixNameList
          list of display picture names for choices
 int pixWidth
          The width of the current image
 int[] pixWidthSize
          List of pix widths[] associated with images
 boolean reportAllSpotPairsForSelectedSpotFlag
          set from "Report all spot pairs for selected spot" menu checkbox
 java.lang.Thread runT
          reposition scroller thread
static int SCR_HEIGHT
          Height of the histogram
static int SCR_WIDTH
          Width of the histogram
(package private) static long serialVersionUID
          frame id
 boolean showCWflag
           
 boolean showDbugCWflag
           
 boolean showNDCWflag
           
 boolean showPixdumpCWflag
           
private  CmpSpotsScrollableImagePanel siCanvas
          ScrollableImage to hold the image and scrollers
 java.awt.Font smallFont
           
private  java.awt.ScrollPane sp
          Scroll pane to hold the image
private  int textAreaFontSize
          font size
private  java.lang.String textFontFamily
          font family for message window
 boolean useAddCwRdbugFlag
          set from "Add -cwRdbug ROI overlay" Menu CB
 boolean useAddCwSdbugFlag
          set from "Add -cwSdbug ROI overlay" Menu CB
 java.awt.Checkbox useAddLabelsCB
          the "Add labels" checkbox
 boolean useAddLabelsFlag
          set from "Add label" checkbox
 boolean useAddLandmarksFlag
          set from "Add Landmarks" Menu CB
 boolean useAddLMradiiFlag
          set from "Add LM radii" Menu CB
 java.awt.Checkbox useAddVectorCB
          the "Add vector" checkbox
 boolean useAddVectorFlag
          set from "Add vector" checkbox
 java.awt.Checkbox useDragCB
          the "Use drag" checkbox
 boolean useDragFlag
          set from "Use drag" checkbox
 boolean useFilterByBinFlag
          menu CB item to filter spots by testing if the histogram active bin is selected and histogram spot feature meets the active bin test
 boolean useHistGUIflag
          flag to use simple ImageViewer w/o histogram or full GUI with the histogram
 boolean useSaveImageFlag
          set from "Save image" Command
 int VIEW_HEIGHT
          Height of the frame with and without histogram
 int VIEW_WIDTH_NO_HIST
          Width of the frame without histogram
 int VIEW_WIDTH_WITH_HIST
          Width of the frame with histogram
 int viewHeight
           
 java.awt.Menu viewMenu
          "View" pull down Menu list
 int viewWidth
           
 int[] xImg
          array for x img coords
 int[] yImg
          array for y img coords
 java.awt.Choice zoomChoice
          zoom Choice list
 int zoomFactor
          zoomFactor
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CmpShowImage(CmpSpots cs, boolean useHistGUIflag, java.lang.String baseImageFile)
          CmpShowImage() - Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed() - Handle button clicks
 void addHistogramGUI()
          addHistogramGUI() - Add the histogram GUI to the ImageViewer GUI
private  void addMenuTree(java.awt.Frame f, java.awt.MenuBar mbar)
          addMenuTree() - create pull down menus in menu bar
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
          adjustmentValueChanged() - handle ImageScroller scroll events.
 boolean buildImageGUI()
          buildImageGUI() - Build the ImageViewer GUI
 boolean calcHistogram()
          calcHistogram() - compute histogram from image data.
 boolean calDbSpotDataMaxMinValues()
          calDbSpotDataMaxMinValues() - calc maxDataValue and minDataValue from the spotList[] data that is inside of the ROI if used.
 void close()
          close() - close this popup and reset flags
 java.awt.Dimension getPreferredSize()
          getPreferredSize() - getPreferredSize, needed for sizing frame and ScrollPane correctly.
private  boolean initImageGUI(java.lang.String dName)
          initImageGUI() - init the image gui
 void itemStateChanged(java.awt.event.ItemEvent e)
          itemStateChanged() - handle item state changed events NOTE: need to implement radio groups here since AWT only implements radio groups for Checkboxes, and CheckboxMenuItems.
 void paintComponent(java.awt.Graphics g)
          paintComponent() - repaint scrollable canvas in region defined by scroll bars
 void positionImageWindow()
          positionImageWindow() - position image window on the screen
 void removeHistogramGUI()
          removeHistogramGUI() - Remove the histogram GUI from ImageViewer GUI
 void run()
          run() - Wait for repaint to be finished after zoom so we can position scrollers in same position a.
 boolean setHistDataGUI(int histDataType)
          setHistDataGUI() - set checkbox radio button and choice selected for histogram data type
 void setImageGUI(java.lang.String imgName)
          setImageGUI() - set checkbox radio button and choice selected for image to be displayed
 boolean setPixDatabase(java.lang.String[] pixNameList, java.lang.String[] pixMenuList, java.lang.String[] pixFileList, char[][] pixClist, int nPixList, java.lang.String defaultPixName, int[] pixWidthSize, int[] pixHeightSize, boolean useHistGUIflag)
          setPixDatabase() - setup the list of predefined images available to the ImageViewer.
 boolean showImageGUI(java.lang.String dName)
          showImageGUI() - show the Image Viewer GUI window
 void showImgMsg(java.lang.String msg)
          showImgMsg() - display the msg in text area window
 void start()
          start() - start new thread
 void stop()
          stop() - stop or suspend thread
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          windowClosing() - closing down the window, get rid of the frame.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

serialVersionUID

static final long serialVersionUID
frame id

See Also:
Constant Field Values

cs

public CmpSpots cs
instance of the main class


useHistGUIflag

public boolean useHistGUIflag
flag to use simple ImageViewer w/o histogram or full GUI with the histogram


baseImageFile

public java.lang.String baseImageFile
base name of the image for use in the title


changeGuiFlag

public boolean changeGuiFlag
flag to indicating that the GUI may have changed and that it should be rebuilt.


hasHistGUIflag

public boolean hasHistGUIflag
flag to indicate that the GUI contains the Histogram sub-GUI


VIEW_WIDTH_NO_HIST

public final int VIEW_WIDTH_NO_HIST
Width of the frame without histogram

See Also:
Constant Field Values

VIEW_WIDTH_WITH_HIST

public final int VIEW_WIDTH_WITH_HIST
Width of the frame with histogram

See Also:
Constant Field Values

VIEW_HEIGHT

public final int VIEW_HEIGHT
Height of the frame with and without histogram

See Also:
Constant Field Values

SCR_WIDTH

public static final int SCR_WIDTH
Width of the histogram

See Also:
Constant Field Values

SCR_HEIGHT

public static final int SCR_HEIGHT
Height of the histogram

See Also:
Constant Field Values

HIST_WIDTH

public static final int HIST_WIDTH
Width of the histogram

See Also:
Constant Field Values

HIST_HEIGHT

public static final int HIST_HEIGHT
Height of the histogram

See Also:
Constant Field Values

NROWS

static final int NROWS
size of the text area in characters

See Also:
Constant Field Values

NCOLS

static final int NCOLS
See Also:
Constant Field Values

DIST_THR

public static final int DIST_THR
Distance threshold in pixels from mouse (x,y) to spot centroid to find spot

See Also:
Constant Field Values

mbar

java.awt.MenuBar mbar
menu bar for the frame


fileMenu

public java.awt.Menu fileMenu
"File" pull down Menu list


viewMenu

public java.awt.Menu viewMenu
"View" pull down Menu list


filterMenu

public java.awt.Menu filterMenu
"Filter" pull down Menu list


histMenu

public java.awt.Menu histMenu
"Histogram" pull down Menu list


zoomChoice

public java.awt.Choice zoomChoice
zoom Choice list


zoomFactor

public int zoomFactor
zoomFactor


xImg

public int[] xImg
array for x img coords


yImg

public int[] yImg
array for y img coords


histChoice

public java.awt.Choice histChoice
"Histogram" Choice list


controlPanel

public java.awt.Panel controlPanel
Control panel for the main frame


ms

public MenuSupport ms
Menu support functions using Hashtables to tack what is active


sp

private java.awt.ScrollPane sp
Scroll pane to hold the image


aH

private java.awt.Adjustable aH

aV

private java.awt.Adjustable aV

siCanvas

private CmpSpotsScrollableImagePanel siCanvas
ScrollableImage to hold the image and scrollers


msgTextArea

private java.awt.TextArea msgTextArea
Text area GUI for message rporting


textAreaFontSize

private int textAreaFontSize
font size


textFontFamily

private java.lang.String textFontFamily
font family for message window


fontFamily

public java.lang.String fontFamily

microFont

public java.awt.Font microFont

smallFont

public java.awt.Font smallFont

mediumFont

public java.awt.Font mediumFont

largeFont

public java.awt.Font largeFont

hugeFont

public java.awt.Font hugeFont

humongousFont

public java.awt.Font humongousFont

dispPixChoice

public java.awt.Choice dispPixChoice
Selector for image to display after spot pairing


dispName

public java.lang.String dispName
Name of image to display after spot pairing


dispPixC

public char[] dispPixC
Picture buffer char[] of image to display after spot pairing. Note this is read either from the pix? variable or from the file if the pix? variable is null.


dispPixFile

public java.lang.String dispPixFile
File of image to display after spot pairing. Used if dispPixC is null.


nSampleDisp

public int nSampleDisp
Sample to display after spot pairing. Will be in the range of [0:pixNameList.length-1].


nsampleSelected

public int nsampleSelected
Compute the selected sample (either RSAMPLE or SAMPLE). BY CONVENTION: all Rsamples are even (i.e, 0, 2) all Samples are odd (i.e., 1, 3)


pixNameList

public java.lang.String[] pixNameList
list of display picture names for choices


pixMenuList

public java.lang.String[] pixMenuList
list of display picture menu commands for choices


pixFileList

public java.lang.String[] pixFileList

pixClist

public char[][] pixClist
List of display pix names associated char[] images


nPixList

public int nPixList
The size of the lists in case list contents is less than size


currentPix

public int currentPix
current displayed img index


pixWidthSize

public int[] pixWidthSize
List of pix widths[] associated with images


pixHeightSize

public int[] pixHeightSize
List of pix widths[] associated with images


pixWidth

public int pixWidth
The width of the current image


pixHeight

public int pixHeight
The width of the current image


nPixels

public int nPixels
The pixWidth*pixHeight


oGifFileName

public java.lang.String oGifFileName
Full path of image to "Save image" in


filterbyLMSCB

public java.awt.Checkbox filterbyLMSCB
the "Filter by LMS" Checkbox


filterByCurLMSFlag

public boolean filterByCurLMSFlag
set from "Filter by LMS" checkbox


isVisibleFlag

public boolean isVisibleFlag
Set true if window is visible


drawHorizSliceFlag

public boolean drawHorizSliceFlag
menu CB item to display horizontal slice


drawVertSliceFlag

public boolean drawVertSliceFlag
menu CB item to display vertical slice


filterGEQactiveBinFlag

public boolean filterGEQactiveBinFlag
menu CB item to test spots for GEQ activeBin value, else LEQ activeBin value fromt the selected histogram bin for the histogram histType spot data.


filterBySPlabelFlag

public boolean filterBySPlabelFlag
menu CB item to filter spots by SP label


filterByPPlabelFlag

public boolean filterByPPlabelFlag
menu CB item to filter spots by PP label


filterByAPlabelFlag

public boolean filterByAPlabelFlag
menu CB item to filter spots by AP label


filterByUSlabelFlag

public boolean filterByUSlabelFlag
menu CB item to filter spots by US label


useFilterByBinFlag

public boolean useFilterByBinFlag
menu CB item to filter spots by testing if the histogram active bin is selected and histogram spot feature meets the active bin test


useDragCB

public java.awt.Checkbox useDragCB
the "Use drag" checkbox


useDragFlag

public boolean useDragFlag
set from "Use drag" checkbox


reportAllSpotPairsForSelectedSpotFlag

public boolean reportAllSpotPairsForSelectedSpotFlag
set from "Report all spot pairs for selected spot" menu checkbox


useAddVectorCB

public java.awt.Checkbox useAddVectorCB
the "Add vector" checkbox


useAddVectorFlag

public boolean useAddVectorFlag
set from "Add vector" checkbox


useAddLabelsCB

public java.awt.Checkbox useAddLabelsCB
the "Add labels" checkbox


useAddLabelsFlag

public boolean useAddLabelsFlag
set from "Add label" checkbox


addLandmarksCB

public java.awt.Checkbox addLandmarksCB
the "Add landmarks" checkbox


useAddLandmarksFlag

public boolean useAddLandmarksFlag
set from "Add Landmarks" Menu CB


useAddLMradiiFlag

public boolean useAddLMradiiFlag
set from "Add LM radii" Menu CB


useAddCwRdbugFlag

public boolean useAddCwRdbugFlag
set from "Add -cwRdbug ROI overlay" Menu CB


useAddCwSdbugFlag

public boolean useAddCwSdbugFlag
set from "Add -cwSdbug ROI overlay" Menu CB


useSaveImageFlag

public boolean useSaveImageFlag
set from "Save image" Command


logReportFlag

public boolean logReportFlag
set from "Log report" checkbox menu item


viewWidth

public int viewWidth

viewHeight

public int viewHeight

pImg

public java.awt.Image pImg
Image to display


showCWflag

public boolean showCWflag

showNDCWflag

public boolean showNDCWflag

showDbugCWflag

public boolean showDbugCWflag

showPixdumpCWflag

public boolean showPixdumpCWflag

alreadyViewedFlag

public boolean alreadyViewedFlag
flag for closing and reopening popup


hCanvas

public DrawHistogram hCanvas
Histogram Canvas to hold the image


hist

public int[] hist
full input unscaled histogram data [0:nHist-1]


nHist

public int nHist
size of input unscaled histogram[] data


histType

public int histType
type of data to use with the histogram


HIST_NONE

public static final int HIST_NONE
types of histogram data allowed

See Also:
Constant Field Values

HIST_DP_DIST

public static final int HIST_DP_DIST
types of histogram data allowed

See Also:
Constant Field Values

HIST_DL_DIST

public static final int HIST_DL_DIST
types of histogram data allowed

See Also:
Constant Field Values

HIST_PAIRING_LABELS

public static final int HIST_PAIRING_LABELS
types of histogram data allowed

See Also:
Constant Field Values

HIST_LMS_SIZE

public static final int HIST_LMS_SIZE
types of histogram data allowed

See Also:
Constant Field Values

histNames

public static final java.lang.String[] histNames
list of histogram data types


dataUnits

public java.lang.String dataUnits
Data type as fct of histogram data type


minDataValue

public float minDataValue
Minimum value expected for current hist[] data


maxDataValue

public float maxDataValue
Maximum value expected for current hist[] data


runT

public java.lang.Thread runT
reposition scroller thread


notDoneFlag

private boolean notDoneFlag
Set to kill the run loop

Constructor Detail

CmpShowImage

public CmpShowImage(CmpSpots cs,
                    boolean useHistGUIflag,
                    java.lang.String baseImageFile)
CmpShowImage() - Constructor

Parameters:
cs - is an instance of the main class
useHistGUIflag - to bring up the histogram GUI as well.
baseImageFile - is the base name of the image
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
getPreferredSize() - getPreferredSize, needed for sizing frame and ScrollPane correctly.

Overrides:
getPreferredSize in class java.awt.Container
Returns:
frame size

setPixDatabase

public boolean setPixDatabase(java.lang.String[] pixNameList,
                              java.lang.String[] pixMenuList,
                              java.lang.String[] pixFileList,
                              char[][] pixClist,
                              int nPixList,
                              java.lang.String defaultPixName,
                              int[] pixWidthSize,
                              int[] pixHeightSize,
                              boolean useHistGUIflag)
setPixDatabase() - setup the list of predefined images available to the ImageViewer. All images must be the same heightXwidth.
 Image names BY CONVENTION:
 all Rsamples are even (i.e, 0, 2, 4)
 all Samples are odd (i.e., 1, 3, 5)

Parameters:
pixNameList - is the list of display picture names for choices/menus
pixMenuList - is the list of display picture menu cmds
pixFileList - is list of associated file names if any
pixClist - is list of the associate char[] images
nPixList - is size of the lists in case list contents is less than size
defaultPixName - is the default pix name
pixWidthSize - is widths of all images
pixHeightSize - is heights of all images
useHistGUIflag - to bring up the histogram GUI as well.
Returns:
true if succeed

initImageGUI

private boolean initImageGUI(java.lang.String dName)
initImageGUI() - init the image gui

Parameters:
dName - is the image to display
Returns:
true if succeed

showImageGUI

public boolean showImageGUI(java.lang.String dName)
showImageGUI() - show the Image Viewer GUI window

Returns:
true if succeed

addHistogramGUI

public void addHistogramGUI()
addHistogramGUI() - Add the histogram GUI to the ImageViewer GUI


removeHistogramGUI

public void removeHistogramGUI()
removeHistogramGUI() - Remove the histogram GUI from ImageViewer GUI


buildImageGUI

public boolean buildImageGUI()
buildImageGUI() - Build the ImageViewer GUI


addMenuTree

private void addMenuTree(java.awt.Frame f,
                         java.awt.MenuBar mbar)
addMenuTree() - create pull down menus in menu bar

Parameters:
f - is frame
mbar - is MenuBar

showImgMsg

public void showImgMsg(java.lang.String msg)
showImgMsg() - display the msg in text area window

Parameters:
msg - to display

positionImageWindow

public void positionImageWindow()
positionImageWindow() - position image window on the screen


close

public void close()
close() - close this popup and reset flags


windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
windowClosing() - closing down the window, get rid of the frame.

Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
e - is window closing event
See Also:
close()

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

paintComponent

public void paintComponent(java.awt.Graphics g)
paintComponent() - repaint scrollable canvas in region defined by scroll bars

Parameters:
g - is graphics context

calDbSpotDataMaxMinValues

public boolean calDbSpotDataMaxMinValues()
calDbSpotDataMaxMinValues() - calc maxDataValue and minDataValue from the spotList[] data that is inside of the ROI if used.


calcHistogram

public boolean calcHistogram()
calcHistogram() - compute histogram from image data. The dynamic range is determined by the actual data.


setImageGUI

public void setImageGUI(java.lang.String imgName)
setImageGUI() - set checkbox radio button and choice selected for image to be displayed

Parameters:
imgName - is the name name

setHistDataGUI

public boolean setHistDataGUI(int histDataType)
setHistDataGUI() - set checkbox radio button and choice selected for histogram data type

Parameters:
r - is the radix code

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged() - handle ImageScroller scroll events. Handle ImageScroller scroll events & cause repaint of canvas. If we are using the scroll bar for this canvas, then set the obj position for use by other canvas for the same image. Handle the delay scrollbar as well if it exists.

Parameters:
e - is adjustment event for scroll bars

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged() - handle item state changed events NOTE: need to implement radio groups here since AWT only implements radio groups for Checkboxes, and CheckboxMenuItems.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
e - is ItemEvent

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed() - Handle button clicks

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - is action evet

start

public void start()
start() - start new thread


run

public void run()
run() - Wait for repaint to be finished after zoom so we can position scrollers in same position a.

Specified by:
run in interface java.lang.Runnable

stop

public void stop()
stop() - stop or suspend thread