Package gov.nih.mipav.view.dialogs
Class JDialogPaintVasculature
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.JDialogPaintVasculature
- All Implemented Interfaces:
DialogDefaultsInterface,RegionGrowDialog,ActionListener,FocusListener,ItemListener,KeyListener,MouseListener,MouseMotionListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,ChangeListener,RootPaneContainer,WindowConstants
public class JDialogPaintVasculature
extends JDialogBase
implements RegionGrowDialog, ChangeListener, ActionListener, KeyListener, MouseMotionListener, MouseListener
Dialog to facilitate the painting of a region of an image (such as the vascualture in a liver mip).
- Version:
- 1.0
- Author:
- Evan McCreedy
- See Also:
-
Nested Class Summary
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 TypeFieldDescriptionstatic final intThe mode where paint grow seed points are automatically determined and chosen by the user.static final intThe mode where the user picks an arbitrary point to start a paint grow from.private booleanBoolean which indicates that the seed point intensity bounds were changed from one of the text fields and not from one of the sliders.private JButtonButton to indicate that the painting is finished and the dialog and attached image frame should be closed.private JButtonButton which indicates that a region grow has been initiated / is being adjusted.private JTextFieldText field containing the seed value intensity.private intThe value of seed points to use.private booleanIndicates that we are done with the current grow, and can close the MIP when the done button is next clicked.private JSliderSlider which adjusts the lower bound of the region grow.private JTextFieldText field containing the lower bound of the region grow.private intThe most we can get away from the initial seed point intensity value (151).private JLabelThe intensity of the current mouse position within the mip.private JLabelThe x position of the current mouse position within the mip.private JLabelThe y position of the current mouse position within the mip.private JLabelThe z position of the current mouse position within the mip (the z position of the volume voxel put into the mip).private intThe intensity value to use to recalculate the possible seed points when switching from CLICK_POINT mode back to AUTO_MODE.private Vector<ViewJComponentEditImage> List of frames that want to know about paint updates.private intThe point selection mode.private ViewJFrameImageThe main RFAST frame.private Vector<WildMagic.LibFoundation.Mathematics.Vector3f> List of points where we have grown a region from.private static final longUse serialVersionUID for interoperability.private JPanelThe dialog's toolbar panel.private JButtonButton to undo the last region grow change (either a click of the grow button, or an adjustment of the threshold sliders).private JSliderSlider which adjusts the upper bound of the region grow.private JTextFieldText field containing the upper bound of the region grow.Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, 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
ConstructorsConstructorDescriptionCreate the paint vasculature dialog. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Handle events from the dialog's buttons.voidcommitGrow(boolean flag) Tells the dialog to commit the current set of region grows and prepare for another set region grows, or the closing of the dialog.booleanPlaceholder.floatPlaceholder.floatAccessor to the lower bound slider.floatDOCUMENT ME!floatDOCUMENT ME!floatDOCUMENT ME!intPlaceholder.intPlaceholder.intGet the current seed intensity.floatAccessor to the upper bound slider.floatDOCUMENT ME!floatDOCUMENT ME!floatDOCUMENT ME!booleanPlaceholder.booleanDOCUMENT ME!private voidinitGUI()Construct the dialog interface.private JPanelConstruct the lower intensity bound slider panel.private voidConstruct the dialog toolbar (including zoom, lut, and paint clearing tools).private JPanelConstruct the upper intensity bound slider panel.voidkeyPressed(KeyEvent event) Allow the user to use left and right keys to adjust the intensity bounds sliders, and update the region grow when the user hits enter from within the bounds text fields.voidPlaceholder required by KeyListener.voidPlaceholder required by KeyListener.voidmouseClicked(MouseEvent event) voidmouseDragged(MouseEvent event) voidmouseEntered(MouseEvent event) Do nothing.voidmouseExited(MouseEvent event) voidmouseMoved(MouseEvent event) voidmousePressed(MouseEvent event) Do nothing.voidmouseReleased(MouseEvent event) Do nothing.voidnotifyPaintListeners(boolean isRegionGrow, boolean backup, BitSet paintMask) Tells images which are watching the paint region grow to update themselves.voidSets the reference to this dialog for all of the images listening to it to null.voidsetPaintGrowMode(int mode) Change the method for determining the points to paint grow from.voidsetPositionText(String posString) Placeholder.voidsetRegionGrowAlgo(AlgorithmRegionGrow regionGrowAlgo) Placeholder.voidstateChanged(ChangeEvent event) Handle events from the intensity bounds sliders.voidUpdate the lower threshold slider labels and values.voidUpdate the slider labels around the currentintensityValue.voidUpdate the upper threshold slider labels and values.Methods 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, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, 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, transferFocusUpCycle
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
AUTO_POINT
public static final int AUTO_POINTThe mode where paint grow seed points are automatically determined and chosen by the user.- See Also:
-
CLICK_POINT
public static final int CLICK_POINTThe mode where the user picks an arbitrary point to start a paint grow from.- See Also:
-
deltaSetFromField
private boolean deltaSetFromFieldBoolean which indicates that the seed point intensity bounds were changed from one of the text fields and not from one of the sliders. -
doneButton
Button to indicate that the painting is finished and the dialog and attached image frame should be closed. -
growButton
Button which indicates that a region grow has been initiated / is being adjusted. -
intensityTF
Text field containing the seed value intensity. -
intensityValue
private int intensityValueThe value of seed points to use. -
isCloseOkay
private boolean isCloseOkayIndicates that we are done with the current grow, and can close the MIP when the done button is next clicked. -
lowerDeltaSlider
Slider which adjusts the lower bound of the region grow. -
lowerDeltaTF
Text field containing the lower bound of the region grow. -
maxDelta
private int maxDeltaThe most we can get away from the initial seed point intensity value (151). -
mouseIntensityLabel
The intensity of the current mouse position within the mip. -
mouseXLabel
The x position of the current mouse position within the mip. -
mouseYLabel
The y position of the current mouse position within the mip. -
mouseZLabel
The z position of the current mouse position within the mip (the z position of the volume voxel put into the mip). -
oldSeedIntensity
private int oldSeedIntensityThe intensity value to use to recalculate the possible seed points when switching from CLICK_POINT mode back to AUTO_MODE. -
paintGrowListeners
List of frames that want to know about paint updates. -
paintGrowMode
private int paintGrowModeThe point selection mode. -
rfastFrame
The main RFAST frame. -
seedPoints
List of points where we have grown a region from. -
toolbarPanel
The dialog's toolbar panel. -
undoButton
Button to undo the last region grow change (either a click of the grow button, or an adjustment of the threshold sliders). -
upperDeltaSlider
Slider which adjusts the upper bound of the region grow. -
upperDeltaTF
Text field containing the upper bound of the region grow.
-
-
Constructor Details
-
JDialogPaintVasculature
Create the paint vasculature dialog.- Parameters:
parent- the parent frame which this dialog is attached to
-
-
Method Details
-
actionPerformed
Handle events from the dialog's buttons.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event- gui action events
-
commitGrow
public void commitGrow(boolean flag) Tells the dialog to commit the current set of region grows and prepare for another set region grows, or the closing of the dialog.- Parameters:
flag- whether to commit the grow, or remember to commit later before closing
-
getDisplayFuzzy
public boolean getDisplayFuzzy()Placeholder.- Specified by:
getDisplayFuzzyin interfaceRegionGrowDialog- Returns:
- false.
-
getFuzzyThreshold
public float getFuzzyThreshold()Placeholder.- Specified by:
getFuzzyThresholdin interfaceRegionGrowDialog- Returns:
- -1.
-
getLowerBound
public float getLowerBound()Accessor to the lower bound slider.- Specified by:
getLowerBoundin interfaceRegionGrowDialog- Returns:
- The value to be subtracted to the seed intensity the defines the lower intensity value that the region can grow into.
-
getLowerBoundB
public float getLowerBoundB()DOCUMENT ME!- Specified by:
getLowerBoundBin interfaceRegionGrowDialog- Returns:
- DOCUMENT ME!
-
getLowerBoundG
public float getLowerBoundG()DOCUMENT ME!- Specified by:
getLowerBoundGin interfaceRegionGrowDialog- Returns:
- DOCUMENT ME!
-
getLowerBoundR
public float getLowerBoundR()DOCUMENT ME!- Specified by:
getLowerBoundRin interfaceRegionGrowDialog- Returns:
- DOCUMENT ME!
-
getMaxDistance
public int getMaxDistance()Placeholder.- Specified by:
getMaxDistancein interfaceRegionGrowDialog- Returns:
- -1.
-
getMaxSize
public int getMaxSize()Placeholder.- Specified by:
getMaxSizein interfaceRegionGrowDialog- Returns:
- -1.
-
getSeedIntensity
public int getSeedIntensity()Get the current seed intensity.- Returns:
- the region grow seed intensity to use
-
getUpperBound
public float getUpperBound()Accessor to the upper bound slider.- Specified by:
getUpperBoundin interfaceRegionGrowDialog- Returns:
- The value to be added to the seed intensity that defines the upper intensity value that the region can grow into.
-
getUpperBoundB
public float getUpperBoundB()DOCUMENT ME!- Specified by:
getUpperBoundBin interfaceRegionGrowDialog- Returns:
- DOCUMENT ME!
-
getUpperBoundG
public float getUpperBoundG()DOCUMENT ME!- Specified by:
getUpperBoundGin interfaceRegionGrowDialog- Returns:
- DOCUMENT ME!
-
getUpperBoundR
public float getUpperBoundR()DOCUMENT ME!- Specified by:
getUpperBoundRin interfaceRegionGrowDialog- Returns:
- DOCUMENT ME!
-
getUseVOI
public boolean getUseVOI()Placeholder.- Specified by:
getUseVOIin interfaceRegionGrowDialog- Returns:
- false.
-
getVariableThresholds
public boolean getVariableThresholds()DOCUMENT ME!- Specified by:
getVariableThresholdsin interfaceRegionGrowDialog- Returns:
- DOCUMENT ME!
-
keyPressed
Allow the user to use left and right keys to adjust the intensity bounds sliders, and update the region grow when the user hits enter from within the bounds text fields.- Specified by:
keyPressedin interfaceKeyListener- Parameters:
event- key event generated by either the sliders or text fields
-
keyReleased
Placeholder required by KeyListener. Does nothing.- Specified by:
keyReleasedin interfaceKeyListener- Parameters:
e- KeyEvent
-
keyTyped
Placeholder required by KeyListener. Does nothing.- Specified by:
keyTypedin interfaceKeyListener- Parameters:
e- KeyEvent
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseEntered
Do nothing. Required by MouseListener interface.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
event- the mouse event
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mousePressed
Do nothing. Required by MouseListener interface.- Specified by:
mousePressedin interfaceMouseListener- Parameters:
event- the mouse event
-
mouseReleased
Do nothing. Required by MouseListener interface.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
event- the mouse event
-
notifyPaintListeners
Tells images which are watching the paint region grow to update themselves.- Specified by:
notifyPaintListenersin interfaceRegionGrowDialog- Parameters:
isRegionGrow- whether the update was caused by a region grow or by something else (eg - eraseall)backup- whether to backup the paint region before updating it (to allow for undos).paintMask- the paint mask to tell the listeners about.
-
resetDialogs
public void resetDialogs()Sets the reference to this dialog for all of the images listening to it to null.- Specified by:
resetDialogsin interfaceRegionGrowDialog
-
setPaintGrowMode
public void setPaintGrowMode(int mode) Change the method for determining the points to paint grow from.- Parameters:
mode- the new paint grow mode
-
setPositionText
Placeholder.- Specified by:
setPositionTextin interfaceRegionGrowDialog- Parameters:
posString- doesn't matter.
-
setRegionGrowAlgo
Placeholder.- Specified by:
setRegionGrowAlgoin interfaceRegionGrowDialog- Parameters:
regionGrowAlgo- doesn't matter.
-
stateChanged
Handle events from the intensity bounds sliders.- Specified by:
stateChangedin interfaceChangeListener- Parameters:
event- event fired by slider change
-
updateLowerSliderValues
public void updateLowerSliderValues()Update the lower threshold slider labels and values. -
updateSliderValues
public void updateSliderValues()Update the slider labels around the currentintensityValue. -
updateUpperSliderValues
public void updateUpperSliderValues()Update the upper threshold slider labels and values. -
initGUI
private void initGUI()Construct the dialog interface. -
initLowerSlider
Construct the lower intensity bound slider panel.- Returns:
- panel which allows adjustment of the lower intensity bound
-
initToolbar
private void initToolbar()Construct the dialog toolbar (including zoom, lut, and paint clearing tools). -
initUpperSlider
Construct the upper intensity bound slider panel.- Returns:
- panel which allows adjustment of the upper intensity bound
-