Package gov.nih.mipav.view.dialogs
Class JDialogVOIStats
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
gov.nih.mipav.view.dialogs.JDialogBase
gov.nih.mipav.view.dialogs.JDialogScriptableBase
gov.nih.mipav.view.dialogs.JDialogVOIStats
- All Implemented Interfaces:
AlgorithmInterface,ScriptableActionInterface,UpdateVOISelectionListener,DialogDefaultsInterface,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,ChangeListener,TreeSelectionListener,RootPaneContainer,WindowConstants
public class JDialogVOIStats
extends JDialogScriptableBase
implements ItemListener, ChangeListener, FocusListener, UpdateVOISelectionListener, TreeSelectionListener, AlgorithmInterface
DOCUMENT ME!
- Version:
- 1.1 June 15, 1999
- Author:
- Matthew J. McAuliffe, Ph.D.
$Logfile: /mipav/src/gov/nih/mipav/view/dialogs/JDialogVOIStats.java $ $Revision: 56 $ $Date: 2/17/06 6:20p $
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classDoes nothing.(package private) classPick up the selected color and call method to change the VOI color.private classDOCUMENT ME!private classDOCUMENT ME!Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate JRadioButtonprivate AlgorithmVOIPropsAlgorithm for computing VOI statisticsprivate JRadioButtonprotected JButtonApplies bounding box/shading/name display and other UI changes to ModelImageprotected JButtonPerforms statistics calculationsprotected JCheckBoxWhether to display bounding box around VOIprotected JCheckBoxWhether to include the selected VOI for statistics processingprotected JCheckBoxWhether to display VOI with shadingprotected JCheckBoxWhether to save statistics to a fileprotected JCheckBoxWhether to display VOI nameprotected JButtonAllows VOI color to be selectedprivate ViewJColorChooserInternal dialog box for selecting VOI colorprivate ColorThe current color of the selected VOIprivate JTextAreaDisplays points and name of selected VOI or contourprotected JLabelDisplays current opacity level in sliderprivate booleanprivate JPanelPixelExclusionSelectorprotected JCheckBoxDOCUMENT ME!protected BorderDOCUMENT ME!private booleanDOCUMENT ME!protected JButtonDisplays Stats dialog helpprivate static IconDOCUMENT ME!private static IconDOCUMENT ME!private static IconDOCUMENT ME!private static IconDOCUMENT ME!private static IconDOCUMENT ME!private static IconDOCUMENT ME!private static IconDOCUMENT ME!private static IconDOCUMENT ME!private static IconDOCUMENT ME!protected ModelImageInternal reference to the currently selected ModelImageprotected JPanelStatisticsListThe list of statistics to calculateprotected JSliderThe opacity slider for the selected VOIprivate JDialogVOIStats.VOITreePopupDOCUMENT ME!private ViewVOIVector[]List of VOI sets that will have statistics calculatedprivate intCurrent set of VOIs that are being processedprivate floatDOCUMENT ME!private floatprivate floatprivate floatprivate floatDOCUMENT ME!private floatprivate floatprivate floatprivate DefaultMutableTreeNodeA reference in the voiTree to the currently selected imageWhen running as a script, holds the pixel exclusion range.private shortThe seed value last entered by the userprotected JTextFieldWatershed seed valueprivate static final longUse serialVersionUID for interoperability.private AlgorithmSubsetprivate ModelImageprivate intprivate booleanDOCUMENT ME!protected JTextFielduid of the selected voiprivate booleanprivate VOIThe selected VOI when the VOIStats dialogue was createdprotected JScrollPaneDOCUMENT ME!protected VOIHandlerInterfaceprivate DefaultTreeModelThe tree of VOIs, composed of an image with children VOIsprotected JTextFieldName of the currently selected voiprotected JTextFieldThickness of the currently selected voiprivate JTreeThe graphical representation of voiModelprotected JScrollPaneDisplays the orthoganal list of VOIs in the selected ModelImageprivate VOIVOI used for whole image processingFields inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
displayInNewFrame, isComplete, scriptParametersFields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
bar, cancelButton, cancelFlag, closeButton, HELP, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManagerFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor needed for dynamic instantiation.JDialogVOIStats(VOIHandlerInterface theVoiHandler, ModelImage img, VOI _voi) Constructor for the JDialogVOIStats. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Applies changes to VOI when "Apply" is pressed; closes when "Cancel" is pressed; and calculates statistics and outputs them to the message frame when "Calculate" is pressed.voidalgorithmPerformed(AlgorithmBase algorithm) Called after an algorithm this listener is registered to exits (maybe successfully, maybe not).private voidprotected voidDOCUMENT ME!protected voidDOCUMENT ME!protected voidStarts the algorithm.voidcallVOIAlgo(ViewVOIVector voiProcessingSet, int processingMode, boolean inSepThread) private StringextendName(String name, VOI tempVOI, int contourNum, int processType) Changes voi name used for statistics retrieval based on processing modevoidfocusLost(FocusEvent event) Test the seed value and if appropriate, sets it.private VOIgetVOIforProcessing(VOI parent) protected voidinit()Sets up GUI components - buttons, checkboxes, sliders, etc.voiditemStateChanged(ItemEvent event) Updates the VOI when the checkboxes for title, boundary, processing, and opacity are changedprivate voidvoidselectionChanged(UpdateVOIEvent newVOIselection) responds to the volume of interest (VOI) change events.voidsetCheckboxBoundingBox(boolean flag) protected voidSet the dialog GUI using the script parameters while running this algorithm as part of a script.voidsetVisible(boolean visible) DOCUMENT ME!private voidsetVOIActive(VOI v) Internal method for setting all relevant parts of the GUI and the MIPAV interface to reflect the active VOI.voidDOCUMENT ME!voidSets values based on knob along slider.protected voidRecord the parameters just used to run this algorithm in a script.private voidupdateContourPane(VOIBase leadBase) DOCUMENT ME!voidDOCUMENT ME!voidupdateVOIPanel(VOI _voi, ModelImage img) Updates the dialog based on the VOI passed in.voidUpdates the ViewJFrameImage when a VOI/contour is selected.Methods inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
doPostAlgorithmActions, getDialogActionString, insertScriptLine, isComplete, scriptRun, setCompleteMethods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontMethods 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, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.event.FocusListener
focusGained
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
ICON_POLYGON
DOCUMENT ME! -
ICON_POLYLINE
DOCUMENT ME! -
ICON_POINT
DOCUMENT ME! -
ICON_LINE
DOCUMENT ME! -
ICON_MEDICAL_FRAME
DOCUMENT ME! -
ICON_X_AXIS
DOCUMENT ME! -
ICON_Y_AXIS
DOCUMENT ME! -
ICON_Z_AXIS
DOCUMENT ME! -
ICON_PROTRACTOR
DOCUMENT ME! -
algoVOI
Algorithm for computing VOI statistics -
applyButton
Applies bounding box/shading/name display and other UI changes to ModelImage -
calcButton
Performs statistics calculations -
helpButton
Displays Stats dialog help -
checkboxOpacity
Whether to display VOI with shading -
checkboxBoundingBox
Whether to display bounding box around VOI -
checkboxSaveStats
Whether to save statistics to a file -
checkboxIncludeForProcessing
Whether to include the selected VOI for statistics processing -
checkboxVOIName
Whether to display VOI name -
colorButton
Allows VOI color to be selected -
colorChooser
Internal dialog box for selecting VOI color -
colorVOI
The current color of the selected VOI -
contourTextArea
Displays points and name of selected VOI or contour -
currentOpacity
Displays current opacity level in slider -
followVOISelectionBox
DOCUMENT ME! -
frameBorder
DOCUMENT ME! -
frameFollowsSelection
private boolean frameFollowsSelectionDOCUMENT ME! -
image
Internal reference to the currently selected ModelImage -
listPanel
The list of statistics to calculate -
opacitySlider
The opacity slider for the selected VOI -
popup
DOCUMENT ME! -
root
A reference in the voiTree to the currently selected image -
seedValue
private short seedValueThe seed value last entered by the user -
seedValueTF
Watershed seed value -
treeSelectionChange
private boolean treeSelectionChangeDOCUMENT ME! -
updateTree
private boolean updateTree -
voi
The selected VOI when the VOIStats dialogue was created -
voiContourPane
DOCUMENT ME! -
voiModel
The tree of VOIs, composed of an image with children VOIs -
VOIName
Name of the currently selected voi -
VOIThicknessField
Thickness of the currently selected voi -
UIDfield
uid of the selected voi -
voiTree
The graphical representation of voiModel -
voiTreePane
Displays the orthoganal list of VOIs in the selected ModelImage -
processList
List of VOI sets that will have statistics calculated -
processListIndex
private int processListIndexCurrent set of VOIs that are being processed -
voiHandler
-
activeVolumeButton
-
allVolumesButton
-
activeVolume
private int activeVolume -
doAllVolumes
private boolean doAllVolumes -
tDim
private int tDim -
subsetAlgo
-
subsetImage
-
wholeImage
VOI used for whole image processing -
rangeMaximum
private float rangeMaximumDOCUMENT ME! -
rangeMinimum
private float rangeMinimumDOCUMENT ME! -
rangeMaximumR
private float rangeMaximumR -
rangeMinimumR
private float rangeMinimumR -
rangeMaximumG
private float rangeMaximumG -
rangeMinimumG
private float rangeMinimumG -
rangeMaximumB
private float rangeMaximumB -
rangeMinimumB
private float rangeMinimumB -
excluder
-
scriptRange
When running as a script, holds the pixel exclusion range.
-
-
Constructor Details
-
JDialogVOIStats
public JDialogVOIStats()Empty constructor needed for dynamic instantiation. -
JDialogVOIStats
Constructor for the JDialogVOIStats.this class ought to listen for VOI updates, but we are having it implemented elsewhere.
- Parameters:
img- DOCUMENT ME!_voi- DOCUMENT ME!theParentFrame- DOCUMENT ME!
-
-
Method Details
-
actionPerformed
Applies changes to VOI when "Apply" is pressed; closes when "Cancel" is pressed; and calculates statistics and outputs them to the message frame when "Calculate" is pressed. Also brings up a color chooser when the color button is pressed.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event- Event that triggers this function
-
getVOIforProcessing
-
getListPanel
-
callVOIAlgo
-
algorithmPerformed
Description copied from interface:AlgorithmInterfaceCalled after an algorithm this listener is registered to exits (maybe successfully, maybe not). If the algorithm is run in a separate thread, this call will be made within that thread. If not, this call will be made from that same, shared thread.- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- the algorithm which has just completed
-
extendName
Changes voi name used for statistics retrieval based on processing mode -
anotherCall
private void anotherCall() -
focusLost
Test the seed value and if appropriate, sets it.- Specified by:
focusLostin interfaceFocusListener- Overrides:
focusLostin classJDialogBase- Parameters:
event- Event that triggered function.
-
itemStateChanged
Updates the VOI when the checkboxes for title, boundary, processing, and opacity are changed- Specified by:
itemStateChangedin interfaceItemListener- Overrides:
itemStateChangedin classJDialogBase- Parameters:
event- Event that cause the method to fire
-
selectionChanged
responds to the volume of interest (VOI) change events.This method calls
updateVOIusing theUpdateVOIEventchangedVOI, and retrieves the runningInSeparateThread out of the current image's frame.- Specified by:
selectionChangedin interfaceUpdateVOISelectionListener- Parameters:
newVOIselection- DOCUMENT ME!- See Also:
-
setVisible
public void setVisible(boolean visible) DOCUMENT ME!- Overrides:
setVisiblein classJDialogBase- Parameters:
visible- DOCUMENT ME!
-
showColorChooser
public void showColorChooser()DOCUMENT ME! -
stateChanged
Sets values based on knob along slider. Changes the opacity of the VOI- Specified by:
stateChangedin interfaceChangeListener- Parameters:
e- Event that triggered this function
-
updateVOIPanel
Updates the dialog based on the VOI passed in.- Parameters:
_voi- VOI whose properties we want to calculate.img- Image where voi is to be updated
-
printTree
-
valueChanged
Updates the ViewJFrameImage when a VOI/contour is selected.- Specified by:
valueChangedin interfaceTreeSelectionListener- Parameters:
e- TreeSelectionEvent
-
setVOIActive
Internal method for setting all relevant parts of the GUI and the MIPAV interface to reflect the active VOI. -
buildVOIContourPane
protected void buildVOIContourPane()DOCUMENT ME! -
buildVOITree
protected void buildVOITree()DOCUMENT ME! -
init
protected void init()Sets up GUI components - buttons, checkboxes, sliders, etc. -
updateContourPane
DOCUMENT ME!- Parameters:
leadBase- DOCUMENT ME!
-
updateTree
public void updateTree()DOCUMENT ME! -
setCheckboxBoundingBox
public void setCheckboxBoundingBox(boolean flag) -
callAlgorithm
protected void callAlgorithm()Description copied from class:JDialogScriptableBaseStarts the algorithm. Already exists in most algorithm dialogs. Should be called during scripted execution and regular operation.- Specified by:
callAlgorithmin classJDialogScriptableBase
-
setGUIFromParams
protected void setGUIFromParams()Set the dialog GUI using the script parameters while running this algorithm as part of a script.- Specified by:
setGUIFromParamsin classJDialogScriptableBase
-
storeParamsFromGUI
Record the parameters just used to run this algorithm in a script.- Specified by:
storeParamsFromGUIin classJDialogScriptableBase- Throws:
ParserException- If there is a problem creating/recording the new parameters.
-