Package gov.nih.mipav.view.dialogs
Class JDialogStandardDeviationThreshold
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.JDialogStandardDeviationThreshold
- All Implemented Interfaces:
AlgorithmInterface,ScriptableActionInterface,DialogDefaultsInterface,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
public class JDialogStandardDeviationThreshold
extends JDialogScriptableBase
implements AlgorithmInterface
The Standard Deviation Threshold works by first having an active VOI in which the standard deviation and other
statistics are calculated. The dialog allows the user to enter the number of standard deviations and the values
outside the range for the thersholding process. The theresholding can be done on the whole image or alternatively,
on other VOIS that are not active that might be on the image. The destination can either be a new image or paint in
existing image except if the src image is a color image.
- Author:
- pandyan
- 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 TypeFieldDescriptionhandle to algorithmprivate AlgorithmVOIPropshandle to algorithmprivate floataverage intensities in VOIprivate floataverage intensities in VOIprivate floataverage intensities in VOIprivate floataverage intensities in VOIprivate JPanelpanelsprivate ButtonGroupradio groupsprivate intnumber for id of VOIprivate booleanboolean for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate booleanboolean for color imageprivate JPanelpanelsprivate floatmax intensities calculatd using std devprivate floatmax intensities calculatd using std devprivate floatmax intensities calculatd using std devprivate floatmax intensities calculatd using std devprivate floatmin intensities calculatd using std devprivate floatmin intensities calculatd using std devprivate floatmin intensities calculatd using std devprivate floatmin intensities calculatd using std devprivate booleanflags for destination and thresholdprivate JRadioButtonradio buttonsprivate intprivate floatnumber of standard deviations used in thresholdingprivate floatnumber of standard deviations used in thresholdingprivate floatnumber of standard deviations used in thresholdingprivate floatnumber of standard deviations used in thresholdingprivate doubleimage type maxprivate doubleimage type minprivate JRadioButtonradio buttonsprivate ModelImagesrc image, result imageprivate booleanboolean telling if script failedprivate JCheckBoxcheckbox for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate JCheckBoxcheckbox for inverse thresholdprivate ModelImagesrc image, result imageprivate VOIsrc VOI used for thresholding ME!private floatstandard deviations in VOIprivate floatstandard deviations in VOIprivate floatstandard deviations in VOIprivate floatstandard deviations in VOIprivate JTextFieldtext fieldsprivate JTextFieldtext fieldsprivate JTextFieldtext fieldsprivate JTextFieldtext fields(package private) double(package private) double(package private) double(package private) doubleprivate JPanelpanelsprivate JPanelpanelsprivate JPanelpanelsprivate JPanelpanelsprivate ButtonGroupradio groupsprivate ViewUserInterfacehandle to UIprivate floatintensity values to be used in thresholdingprivate floatintensity values to be used in thresholdingprivate floatintensity values to be used in thresholdingprivate floatintensity values to be used in thresholdingprivate JTextFieldtext fieldsprivate JTextFieldtext fieldsprivate JTextFieldtext fieldsprivate JTextFieldtext fieldsprivate JRadioButtonradio buttonsprivate ViewVOIVectorvois in imageprivate JPanelpanelsprivate JPanelpanelsprivate JPanelpanelsprivate JRadioButtonradio buttonsprivate booleanflags for destination and thresholdFields inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
displayInNewFrame, isComplete, scriptParametersFields 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
ConstructorsConstructorDescriptionempty constructorJDialogStandardDeviationThreshold(Frame theParentFrame, ModelImage im) constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) action performedvoidalgorithmPerformed(AlgorithmBase algorithm) algorithm performedprotected voidcall algorithmprivate ViewVOIVectorgetActiveVOIs(ModelImage srcImage) This legacy code returns all active vois for a given source image.private StringgetRangeString(int imageType) voidinit()initprotected voidset gui from paramsprivate voidsetOutMinAndMax(int imageType) sets out min and max...used in scriptingprotected voidstore paramsbooleanvalidate paramsMethods 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, 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
-
srcImage
src image, result image -
resultImage
src image, result image -
VOIs
vois in image -
groupNum
private int groupNumnumber for id of VOI -
srcVOI
src VOI used for thresholding ME! -
algoVOI
handle to algorithm -
UI
handle to UI -
mainPanel
panels -
voiStatsPanel
panels -
voiStatsLeftPanel
panels -
voiStatsRightPanel
panels -
thresholdParametersPanel
panels -
thresholdParametersLeftPanel
panels -
thresholdParametersRightPanel
panels -
destinationPanel
panels -
thresholdPanel
panels -
stdDevTextField
text fields -
stdDevTextFieldR
text fields -
stdDevTextFieldG
text fields -
stdDevTextFieldB
text fields -
valuesOutsideTextField
text fields -
valuesOutsideTextFieldR
text fields -
valuesOutsideTextFieldG
text fields -
valuesOutsideTextFieldB
text fields -
inverseThresholdCheckBox
checkbox for inverse threshold -
setMinThresholdCheckBox
checkbox for inverse threshold -
setMinThresholdCheckBoxR
checkbox for inverse threshold -
setMinThresholdCheckBoxG
checkbox for inverse threshold -
setMinThresholdCheckBoxB
checkbox for inverse threshold -
setMaxThresholdCheckBox
checkbox for inverse threshold -
setMaxThresholdCheckBoxR
checkbox for inverse threshold -
setMaxThresholdCheckBoxG
checkbox for inverse threshold -
setMaxThresholdCheckBoxB
checkbox for inverse threshold -
maxIntensity
private float maxIntensitymax intensities calculatd using std dev -
maxIntensityR
private float maxIntensityRmax intensities calculatd using std dev -
maxIntensityG
private float maxIntensityGmax intensities calculatd using std dev -
maxIntensityB
private float maxIntensityBmax intensities calculatd using std dev -
minIntensity
private float minIntensitymin intensities calculatd using std dev -
minIntensityR
private float minIntensityRmin intensities calculatd using std dev -
minIntensityG
private float minIntensityGmin intensities calculatd using std dev -
minIntensityB
private float minIntensityBmin intensities calculatd using std dev -
avgIntensity
private float avgIntensityaverage intensities in VOI -
avgIntensityR
private float avgIntensityRaverage intensities in VOI -
avgIntensityG
private float avgIntensityGaverage intensities in VOI -
avgIntensityB
private float avgIntensityBaverage intensities in VOI -
stdDev
private float stdDevstandard deviations in VOI -
stdDevR
private float stdDevRstandard deviations in VOI -
stdDevG
private float stdDevGstandard deviations in VOI -
stdDevB
private float stdDevBstandard deviations in VOI -
numStdDev
private float numStdDevnumber of standard deviations used in thresholding -
numStdDevR
private float numStdDevRnumber of standard deviations used in thresholding -
numStdDevG
private float numStdDevGnumber of standard deviations used in thresholding -
numStdDevB
private float numStdDevBnumber of standard deviations used in thresholding -
valuesOutside
private float valuesOutsideintensity values to be used in thresholding -
valuesOutsideR
private float valuesOutsideRintensity values to be used in thresholding -
valuesOutsideG
private float valuesOutsideGintensity values to be used in thresholding -
valuesOutsideB
private float valuesOutsideBintensity values to be used in thresholding -
alg
handle to algorithm -
newImageRadio
radio buttons -
paintRadio
radio buttons -
wholeImageRadio
radio buttons -
voiRegionsRadio
radio buttons -
destinationRadioGroup
radio groups -
thresholdRadioGroup
radio groups -
newImageDestination
private boolean newImageDestinationflags for destination and threshold -
wholeImageThreshold
private boolean wholeImageThresholdflags for destination and threshold -
isColorImage
private boolean isColorImageboolean for color image -
inverseThreshold
private boolean inverseThresholdboolean for inverse threshold -
outMax
private double outMaximage type max -
outMin
private double outMinimage type min -
scriptFail
private boolean scriptFailboolean telling if script failed -
numPixels
private int numPixels -
sumPixelInten
double sumPixelInten -
sumPixelIntenR
double sumPixelIntenR -
sumPixelIntenG
double sumPixelIntenG -
sumPixelIntenB
double sumPixelIntenB
-
-
Constructor Details
-
JDialogStandardDeviationThreshold
public JDialogStandardDeviationThreshold()empty constructor -
JDialogStandardDeviationThreshold
constructor- Parameters:
theParentFrame-im-
-
-
Method Details
-
init
public void init()init -
actionPerformed
action performed- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
event-
-
validateParams
public boolean validateParams()validate params -
callAlgorithm
protected void callAlgorithm()call algorithm- Specified by:
callAlgorithmin classJDialogScriptableBase
-
algorithmPerformed
algorithm performed- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- the algorithm which has just completed
-
getRangeString
- Parameters:
imageType-- Returns:
-
setOutMinAndMax
private void setOutMinAndMax(int imageType) sets out min and max...used in scripting- Parameters:
imageType-
-
storeParamsFromGUI
store params- Specified by:
storeParamsFromGUIin classJDialogScriptableBase- Throws:
ParserException
-
setGUIFromParams
protected void setGUIFromParams()set gui from params- Specified by:
setGUIFromParamsin classJDialogScriptableBase
-
getActiveVOIs
This legacy code returns all active vois for a given source image. PlugIns should explicitly identify VOIs they would like to process using AlgorithmVOIProps, because the user may have already added other VOIs to srcImage, or VOIs may be created by the algorithm in an unexpected way. This plugin relied onAlgorithmVOIProp's getActiveVOIs() code, so that code has been moved into this plugin. Use of this method is discouraged, as shown by the old documentation for this method: not for use. should be moved to a better location. does NOT clone the VOIs that it find to be active, and inserts into a new ViewVOIVector. if no VOIs are active, the ViewVOIVector returned isnull.- Returns:
- All the active VOIs for a given srcImage.
-