Package gov.nih.mipav.view.dialogs
Class JDialogVOIStatistics
- 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.JDialogVOIStatistics
-
- All Implemented Interfaces:
AlgorithmInterface
,ScriptableActionInterface
,VOIVectorListener
,VOIStatisticList
,DialogDefaultsInterface
,java.awt.event.ActionListener
,java.awt.event.FocusListener
,java.awt.event.ItemListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public class JDialogVOIStatistics extends JDialogScriptableBase implements AlgorithmInterface, VOIStatisticList, VOIVectorListener
Dialog for calculating statistics of a (set of) Volumes of Interest. User selects a Volume of Interest (or more than one) to act on, selects the statistics from a selectable checklist panel. The User selects "Calculate"; the output from the statistics is reported in a "log-panel" and may be sent to a file.$Logfile: /mipav/src/gov/nih/mipav/view/dialogs/JDialogVOIStatistics.java $
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
JDialogVOIStatistics.JPanelAddRemoveVOI
controllas the lists between left and right side.class
JDialogVOIStatistics.JPanelStatisticFileFormatOptions
File-format options panel to select output format for the display of the statistics output file.class
JDialogVOIStatistics.JPanelStatisticsOptions
Panel holding all statistics options and allowing the user-selection.class
JDialogVOIStatistics.VOIHighlighter
An active listener for VOIEvents and ListSelectionEvents, this class will ensure the selected state of the VOI and its name in a dialog's list is the same.-
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private int
activeVolume
private JDialogVOIStatistics.JPanelAddRemoveVOI
addremove
Panel to push/pull VOIs from full list to selectable list.private static int
APPEND
File handler output mode - append.protected AlgorithmVOIProps
calculator
DOCUMENT ME!protected JPanelStatisticsList
checkBoxPanel
Panel holding statistics options.protected boolean[]
checkList
boolean array mirroring checkbox panel's selection.private boolean
doAllVolumes
private boolean
doForce
force precision to display at maximum.protected javax.swing.JTabbedPane
everything
Tabbed pane that holds all components.private JPanelFileSelection
fileSelectorPanel
Panel to select files.private JDialogVOIStatistics.VOIHighlighter
highlighter
Operator to provide listener access... could be done by /this/protected ModelImage
image
Global image reference to the currently active image during script running and recording.private int
initialActiveVolume
protected static int
LOG_TAB
Logging Tab.private java.lang.StringBuffer
logFileText
The text of the log process to be written to file.protected ViewTableModel
logModel
Model where data is stored for the table.private javax.swing.JTable
logTable
Table holding log of statistics calculated.private boolean
noisyProcess
Flag wheretrue
means notifying the user of stupid errors.protected JDialogVOIStatistics.JPanelStatisticsOptions
outputOptionsPanel
Panel holding statistics output options.private static int
OVERWRITE
File handler output mode - overwriteBox.private javax.swing.JCheckBoxMenuItem
overwriteBox
Check box item indicating if we're to always overwriteBox the statistics file.private int
precision
Number of digits after decimal place to allow.private ViewVOIVector
processList
protected int
processType
DOCUMENT ME!private JPanelPixelExclusionSelector.RangeType
r
private float
rangeMaximum
DOCUMENT ME!private float
rangeMaximumB
private float
rangeMaximumG
private float
rangeMaximumR
private float
rangeMinimum
DOCUMENT ME!private float
rangeMinimumB
private float
rangeMinimumG
private float
rangeMinimumR
private JPanelPixelExclusionSelector.RangeType
scriptRange
When running as a script, holds the pixel exclusion range.protected javax.swing.JList
selectedList
List of selected VOIs.private static long
serialVersionUID
Use serialVersionUID for interoperability.protected boolean
showTotals
DOCUMENT ME!protected static int
STAT_TAB
Statistics Tab.private AlgorithmSubset
subsetAlgo
private ModelImage
subsetImage
private java.io.File
tableDestination
Log file destination.private int
tableDestinationUsage
Indicates options for OVERWRITE, APPEND for the xlat file.private int
tDim
protected javax.swing.JToolBar
toolBar
Toolbar.protected ViewUserInterface
userInterface
Icon and log access.protected static int
VOI_TAB
VOI Tab.private javax.swing.JList
volumesList
List of available VOIs.protected int
xUnits
The units printed to the logModel, set in createNewLogileprotected int
yUnits
The units printed to the logModel, set in createNewLogileprotected int
zUnits
The units printed to the logModel, set in createNewLogile-
Fields inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
displayInNewFrame, isComplete, scriptParameters
-
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, voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from interface gov.nih.mipav.model.structures.VOIStatisticList
areaDescription, asymmetryIndexDescription, avgIntensity, axisDescription, circularityDescription, deviationDescription, eccentricityDescription, fractalDimensionBoxCountDescription, fractalDimensionEuclideanDistanceDescription, geometricCenterDescription, invariantMoment1Description, invariantMoment2Description, invariantMoment3Description, invariantMoment4Description, invariantMoment5Description, invariantMoment6Description, invariantMoment7Description, kurtosisDescription, largestDistanceDescription, largestSliceDistanceDescription, majorAxisDescription, massCenterDescription, maxIntensity, maxWidthDescription, meanCurvatureDescription, meanNegativeCurvatureDescription, median, minIntensity, minorAxisDescription, mode, modeCount, numberOfIndentationsCurvatureDescription, numberOfIndentationsHullDescription, numberOfStatistics, perimeterDescription, quantityDescription, skewnessDescription, solidityDescription, statisticDescription, stdDevCurvatureDescription, sumIntensities, surfaceAreaDescription, volumeDescription
-
-
Constructor Summary
Constructors Constructor Description JDialogVOIStatistics()
Empty constructor needed for dynamic instantiation.JDialogVOIStatistics(ModelImage srcImage, VOIVector voiList)
builds and packs the frame. does not set it visible.JDialogVOIStatistics(VOIVector voiList)
builds and packs the frame. does not set it visible.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent ae)
when a button is clicked.void
addedVOI(VOIVectorEvent voiEvent)
resets the volumes list to the current VOIVector. adds the highlighter to the new VOI.void
algorithmPerformed(AlgorithmBase event)
the standard thread-done event forAlgorithmBase.
private void
anotherCall()
protected void
buildCheckBoxPanel()
protected void
buildDialog(VOIVector voiList)
Builds main dialog.protected javax.swing.JScrollPane
buildLogPanel()
creates a panel for the output log.protected javax.swing.JMenuBar
buildMenuEntries()
Builds a small menu with "Clear log" and "Overwrite" options.protected javax.swing.JPanel
buildOKCancelPanel()
creates the panel which consists of the OKAY button and the Cancel button.private javax.swing.JPanel
buildSelectedListing()
creates the visual display in which to list all selected directories in the directory tree.private javax.swing.JPanel
buildSourceListingPanel(VOIVector VOIlist)
Creates the panel holding the directory tree.private javax.swing.JPanel
buildSourcePanel(VOIVector VOIlist)
creates the source panel which consists of the directory line, the browse button, and a check box approving the anonymize in sub-directories.protected void
buildToolBar()
Build the toolbar control.protected javax.swing.JPanel
buildVOIPanel(VOIVector VOIlist)
creates the source panel for the VOI tab which consists of the directory line, the browse button, and a check box approving the anonymize in sub-directories.protected void
callAlgorithm()
Once all the necessary variables are set, call the VOI Props algorithm to run the statistic calculation.protected void
cleanUpAndDispose()
Clean up some things done by the dialog which may affect other parts of MIPAV.protected void
createNewLogModel()
This method resets the logModel in preparation for writing new statistics valuesprotected void
doPostAlgorithmActions()
Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table).private boolean
isStatisticSelectionOkay()
checks to see if the checklist has had any selections made to it.private boolean
isTableDestinationOkay()
Locates the translation/key-file destination directory.void
refreshVOIList(VOIVector VOIlist)
Refreshes the list of available and selected VOIs.void
removedVOI(VOIVectorEvent voiEvent)
resets the volumes list to the current VOIVector. removes the highlighter from the removed VOI.protected void
setGUIFromParams()
Set the dialog GUI using the script parameters while running this algorithm as part of a script.private java.io.File
setupNew(java.io.File selected)
makes the submitted directory as given by the inputted File, or the text as given in the given given textField.private boolean
setVariables()
use the GUI results to set up the variables needed to run the algorithm.protected void
storeParamsFromGUI()
Record the parameters just used to run this algorithm in a script.protected void
updateDialog()
Method for updating the GUI after the algorithm has completed, should not be called when scripting.protected void
updateDialogRow(VOI voi, java.util.Vector<VOIBase>[] contours, VOIStatisticalProperties properties, javax.swing.ListModel list, int i, java.lang.String[] rowData, java.lang.String[] totalData)
Writes the statistic data for contoursprotected java.lang.String[]
updateRowStatistics(VOI voi, VOIStatisticalProperties properties, java.lang.String[] rowData, java.lang.String[] totalData, java.lang.String end, int count)
Writes general statistics data for any VOI structure given a valid "end" modifier to specify the property being fetched.protected void
updateStatLog()
Method for updating the table after the algorithm has completed.void
vectorSelected(VOIVectorEvent voiEvent)
un-implemented.protected void
writeLogHeader()
Writes the column titles of selected statistics calculations to the logModel.protected java.lang.StringBuffer
writeLogModelToString()
Converts the current logModel into either a tab-delimited text file or an XML file.protected void
writeStatisticFile()
Writes out the statistics file based on the current logModel-
Methods inherited from class gov.nih.mipav.view.dialogs.JDialogScriptableBase
getDialogActionString, insertScriptLine, isComplete, scriptRun, setComplete
-
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, windowOpened
-
Methods 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, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
Methods 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, 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, 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, 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, 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 Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
VOI_TAB
protected static final int VOI_TAB
VOI Tab.- See Also:
- Constant Field Values
-
STAT_TAB
protected static final int STAT_TAB
Statistics Tab.- See Also:
- Constant Field Values
-
LOG_TAB
protected static final int LOG_TAB
Logging Tab.- See Also:
- Constant Field Values
-
APPEND
private static final int APPEND
File handler output mode - append.- See Also:
- Constant Field Values
-
OVERWRITE
private static final int OVERWRITE
File handler output mode - overwriteBox.- See Also:
- Constant Field Values
-
addremove
private JDialogVOIStatistics.JPanelAddRemoveVOI addremove
Panel to push/pull VOIs from full list to selectable list.
-
calculator
protected AlgorithmVOIProps calculator
DOCUMENT ME!
-
checkBoxPanel
protected JPanelStatisticsList checkBoxPanel
Panel holding statistics options.
-
checkList
protected boolean[] checkList
boolean array mirroring checkbox panel's selection.
-
doForce
private boolean doForce
force precision to display at maximum.
-
everything
protected javax.swing.JTabbedPane everything
Tabbed pane that holds all components.
-
fileSelectorPanel
private JPanelFileSelection fileSelectorPanel
Panel to select files.
-
highlighter
private JDialogVOIStatistics.VOIHighlighter highlighter
Operator to provide listener access... could be done by /this/
-
image
protected ModelImage image
Global image reference to the currently active image during script running and recording.
-
logFileText
private java.lang.StringBuffer logFileText
The text of the log process to be written to file.
-
logModel
protected ViewTableModel logModel
Model where data is stored for the table.
-
logTable
private javax.swing.JTable logTable
Table holding log of statistics calculated.
-
noisyProcess
private final boolean noisyProcess
Flag wheretrue
means notifying the user of stupid errors.- See Also:
- Constant Field Values
-
outputOptionsPanel
protected JDialogVOIStatistics.JPanelStatisticsOptions outputOptionsPanel
Panel holding statistics output options.
-
overwriteBox
private javax.swing.JCheckBoxMenuItem overwriteBox
Check box item indicating if we're to always overwriteBox the statistics file.
-
precision
private int precision
Number of digits after decimal place to allow.
-
processType
protected int processType
DOCUMENT ME!
-
activeVolume
private int activeVolume
-
initialActiveVolume
private int initialActiveVolume
-
tDim
private int tDim
-
subsetAlgo
private AlgorithmSubset subsetAlgo
-
subsetImage
private ModelImage subsetImage
-
doAllVolumes
private boolean doAllVolumes
-
processList
private ViewVOIVector processList
-
r
private JPanelPixelExclusionSelector.RangeType r
-
rangeMaximum
private float rangeMaximum
DOCUMENT ME!
-
rangeMinimum
private float rangeMinimum
DOCUMENT 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
-
selectedList
protected javax.swing.JList selectedList
List of selected VOIs.
-
showTotals
protected boolean showTotals
DOCUMENT ME!
-
tableDestination
private java.io.File tableDestination
Log file destination.
-
tableDestinationUsage
private int tableDestinationUsage
Indicates options for OVERWRITE, APPEND for the xlat file.
-
toolBar
protected javax.swing.JToolBar toolBar
Toolbar.
-
userInterface
protected ViewUserInterface userInterface
Icon and log access.
-
volumesList
private final javax.swing.JList volumesList
List of available VOIs.
-
xUnits
protected int xUnits
The units printed to the logModel, set in createNewLogile
-
yUnits
protected int yUnits
The units printed to the logModel, set in createNewLogile
-
zUnits
protected int zUnits
The units printed to the logModel, set in createNewLogile
-
scriptRange
private JPanelPixelExclusionSelector.RangeType scriptRange
When running as a script, holds the pixel exclusion range.
-
-
Constructor Detail
-
JDialogVOIStatistics
public JDialogVOIStatistics()
Empty constructor needed for dynamic instantiation.
-
JDialogVOIStatistics
public JDialogVOIStatistics(VOIVector voiList)
builds and packs the frame. does not set it visible.install the panels of source directory, destination directory, the checkbox for approving the translation-table file and the panel containing the ok and cancel buttons. Installs the checkbox panel.
- Parameters:
voiList
- DOCUMENT ME!
-
JDialogVOIStatistics
public JDialogVOIStatistics(ModelImage srcImage, VOIVector voiList)
builds and packs the frame. does not set it visible.install the panels of source directory, destination directory, the checkbox for approving the translation-table file and the panel containing the ok and cancel buttons. Installs the checkbox panel.
- Parameters:
srcImage
- input imagevoiList
- DOCUMENT ME!
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
when a button is clicked.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJDialogBase
- Parameters:
ae
- DOCUMENT ME!
-
addedVOI
public void addedVOI(VOIVectorEvent voiEvent)
resets the volumes list to the current VOIVector. adds the highlighter to the new VOI.- Specified by:
addedVOI
in interfaceVOIVectorListener
- Parameters:
voiEvent
- DOCUMENT ME!
-
algorithmPerformed
public void algorithmPerformed(AlgorithmBase event)
the standard thread-done event forAlgorithmBase.
- Specified by:
algorithmPerformed
in interfaceAlgorithmInterface
- Parameters:
event
- the event
-
anotherCall
private void anotherCall()
-
refreshVOIList
public void refreshVOIList(VOIVector VOIlist)
Refreshes the list of available and selected VOIs.- Parameters:
VOIlist
- imageActive's current VOIVector
-
removedVOI
public void removedVOI(VOIVectorEvent voiEvent)
resets the volumes list to the current VOIVector. removes the highlighter from the removed VOI.- Specified by:
removedVOI
in interfaceVOIVectorListener
- Parameters:
voiEvent
- DOCUMENT ME!
-
vectorSelected
public void vectorSelected(VOIVectorEvent voiEvent)
un-implemented.- Specified by:
vectorSelected
in interfaceVOIVectorListener
- Parameters:
voiEvent
- DOCUMENT ME!
-
callAlgorithm
protected void callAlgorithm()
Once all the necessary variables are set, call the VOI Props algorithm to run the statistic calculation.- Specified by:
callAlgorithm
in classJDialogScriptableBase
-
cleanUpAndDispose
protected void cleanUpAndDispose()
Clean up some things done by the dialog which may affect other parts of MIPAV.
-
doPostAlgorithmActions
protected void doPostAlgorithmActions()
Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table). Defaults to no action, override to actually have it do something.- Overrides:
doPostAlgorithmActions
in classJDialogScriptableBase
-
setGUIFromParams
protected void setGUIFromParams()
Set the dialog GUI using the script parameters while running this algorithm as part of a script.- Specified by:
setGUIFromParams
in classJDialogScriptableBase
-
storeParamsFromGUI
protected void storeParamsFromGUI() throws ParserException
Record the parameters just used to run this algorithm in a script.- Specified by:
storeParamsFromGUI
in classJDialogScriptableBase
- Throws:
ParserException
- If there is a problem creating/recording the new parameters.
-
buildCheckBoxPanel
protected void buildCheckBoxPanel()
-
buildDialog
protected void buildDialog(VOIVector voiList)
Builds main dialog.
-
buildLogPanel
protected javax.swing.JScrollPane buildLogPanel()
creates a panel for the output log.- Returns:
- DOCUMENT ME!
-
buildMenuEntries
protected javax.swing.JMenuBar buildMenuEntries()
Builds a small menu with "Clear log" and "Overwrite" options.- Returns:
- DOCUMENT ME!
-
buildOKCancelPanel
protected javax.swing.JPanel buildOKCancelPanel()
creates the panel which consists of the OKAY button and the Cancel button.- Returns:
- DOCUMENT ME!
-
buildSelectedListing
private javax.swing.JPanel buildSelectedListing()
creates the visual display in which to list all selected directories in the directory tree. The panel is 240 pixels wide though that is supposed to be the minimum size- Returns:
- the panel which is to hold the list of selected items
-
buildSourceListingPanel
private javax.swing.JPanel buildSourceListingPanel(VOIVector VOIlist)
Creates the panel holding the directory tree.- Parameters:
VOIlist
- DOCUMENT ME!- Returns:
- Panel.
-
buildSourcePanel
private javax.swing.JPanel buildSourcePanel(VOIVector VOIlist)
creates the source panel which consists of the directory line, the browse button, and a check box approving the anonymize in sub-directories.- Parameters:
VOIlist
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
buildToolBar
protected void buildToolBar()
Build the toolbar control.
-
buildVOIPanel
protected javax.swing.JPanel buildVOIPanel(VOIVector VOIlist)
creates the source panel for the VOI tab which consists of the directory line, the browse button, and a check box approving the anonymize in sub-directories. Also includes the file-format selection for the output file.- Parameters:
VOIlist
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
createNewLogModel
protected void createNewLogModel()
This method resets the logModel in preparation for writing new statistics values
-
isStatisticSelectionOkay
private boolean isStatisticSelectionOkay()
checks to see if the checklist has had any selections made to it. If it hasn't, then the "Statistics Options" tab is brought to the front (it contains the checklist), and the warning message "No statistics were selected! Select a statistic." is displayed.- Returns:
- boolean if a selection in the JPanelAnonymizeImage has been made, returns
true
. Otherwise, returnsfalse
. - See Also:
JPanelAnonymizeImage
-
isTableDestinationOkay
private boolean isTableDestinationOkay()
Locates the translation/key-file destination directory. If the directory is not there already, the directory is made. If there is a problem in creating the destination directory, the "Directory" tab is brought to the front; the warning message describing the error is displayed; then the text field with the destination directory is given focus, and all available text is displayed. If the translation/key-file is already present in the chosen directory, there will be an options dialog allowing the user to Overwrite the old translation/key-file, to append the the new translation/key to the end of the current file, or to cancel the entire operation (to look for a new location).- Returns:
- boolean if the selected destination has been made, returns
true
. Otherwise, returnsfalse
.
-
setupNew
private java.io.File setupNew(java.io.File selected) throws java.io.IOException, java.lang.SecurityException
makes the submitted directory as given by the inputted File, or the text as given in the given given textField. Priority is given to the text in the textfield, so if the File's path does not agree with the path in the text field, the directory will be made with the path in the text field. Should the text field not have any path, an IOException will be thrown indicating this problem. If the directory does not exist, it will be created; if there are errors in creating the directory, an IOException will be thrown, with error message describing the problem, with a possible remedy as a suggestion.- Parameters:
selected
- DOCUMENT ME!- Returns:
- File a directory
- Throws:
java.io.IOException
- -- failure to create the directoryjava.lang.SecurityException
- DOCUMENT ME!
-
setVariables
private boolean setVariables()
use the GUI results to set up the variables needed to run the algorithm.- Returns:
true
if parameters set successfully,false
otherwise.
-
updateDialog
protected void updateDialog()
Method for updating the GUI after the algorithm has completed, should not be called when scripting.
-
updateStatLog
protected void updateStatLog()
Method for updating the table after the algorithm has completed. All relevant statistics are stored in the log model.
-
updateDialogRow
protected void updateDialogRow(VOI voi, java.util.Vector<VOIBase>[] contours, VOIStatisticalProperties properties, javax.swing.ListModel list, int i, java.lang.String[] rowData, java.lang.String[] totalData)
Writes the statistic data for contours- Parameters:
voi
-
-
updateRowStatistics
protected java.lang.String[] updateRowStatistics(VOI voi, VOIStatisticalProperties properties, java.lang.String[] rowData, java.lang.String[] totalData, java.lang.String end, int count)
Writes general statistics data for any VOI structure given a valid "end" modifier to specify the property being fetched.- Parameters:
voi
-
-
writeLogHeader
protected void writeLogHeader()
Writes the column titles of selected statistics calculations to the logModel.
-
writeLogModelToString
protected java.lang.StringBuffer writeLogModelToString()
Converts the current logModel into either a tab-delimited text file or an XML file. TODO: Fix XML functionality.- Returns:
-
writeStatisticFile
protected void writeStatisticFile()
Writes out the statistics file based on the current logModel
-
-