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 classJDialogVOIStatistics.JPanelAddRemoveVOIcontrollas the lists between left and right side.classJDialogVOIStatistics.JPanelStatisticFileFormatOptionsFile-format options panel to select output format for the display of the statistics output file.classJDialogVOIStatistics.JPanelStatisticsOptionsPanel holding all statistics options and allowing the user-selection.classJDialogVOIStatistics.VOIHighlighterAn 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 intactiveVolumeprivate JDialogVOIStatistics.JPanelAddRemoveVOIaddremovePanel to push/pull VOIs from full list to selectable list.private static intAPPENDFile handler output mode - append.protected AlgorithmVOIPropscalculatorDOCUMENT ME!protected JPanelStatisticsListcheckBoxPanelPanel holding statistics options.protected boolean[]checkListboolean array mirroring checkbox panel's selection.private booleandoAllVolumesprivate booleandoForceforce precision to display at maximum.protected javax.swing.JTabbedPaneeverythingTabbed pane that holds all components.private JPanelFileSelectionfileSelectorPanelPanel to select files.private JDialogVOIStatistics.VOIHighlighterhighlighterOperator to provide listener access... could be done by /this/protected ModelImageimageGlobal image reference to the currently active image during script running and recording.private intinitialActiveVolumeprotected static intLOG_TABLogging Tab.private java.lang.StringBufferlogFileTextThe text of the log process to be written to file.protected ViewTableModellogModelModel where data is stored for the table.private javax.swing.JTablelogTableTable holding log of statistics calculated.private booleannoisyProcessFlag wheretruemeans notifying the user of stupid errors.protected JDialogVOIStatistics.JPanelStatisticsOptionsoutputOptionsPanelPanel holding statistics output options.private static intOVERWRITEFile handler output mode - overwriteBox.private javax.swing.JCheckBoxMenuItemoverwriteBoxCheck box item indicating if we're to always overwriteBox the statistics file.private intprecisionNumber of digits after decimal place to allow.private ViewVOIVectorprocessListprotected intprocessTypeDOCUMENT ME!private JPanelPixelExclusionSelector.RangeTyperprivate floatrangeMaximumDOCUMENT ME!private floatrangeMaximumBprivate floatrangeMaximumGprivate floatrangeMaximumRprivate floatrangeMinimumDOCUMENT ME!private floatrangeMinimumBprivate floatrangeMinimumGprivate floatrangeMinimumRprivate JPanelPixelExclusionSelector.RangeTypescriptRangeWhen running as a script, holds the pixel exclusion range.protected javax.swing.JListselectedListList of selected VOIs.private static longserialVersionUIDUse serialVersionUID for interoperability.protected booleanshowTotalsDOCUMENT ME!protected static intSTAT_TABStatistics Tab.private AlgorithmSubsetsubsetAlgoprivate ModelImagesubsetImageprivate java.io.FiletableDestinationLog file destination.private inttableDestinationUsageIndicates options for OVERWRITE, APPEND for the xlat file.private inttDimprotected javax.swing.JToolBartoolBarToolbar.protected ViewUserInterfaceuserInterfaceIcon and log access.protected static intVOI_TABVOI Tab.private javax.swing.JListvolumesListList of available VOIs.protected intxUnitsThe units printed to the logModel, set in createNewLogileprotected intyUnitsThe units printed to the logModel, set in createNewLogileprotected intzUnitsThe 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 voidactionPerformed(java.awt.event.ActionEvent ae)when a button is clicked.voidaddedVOI(VOIVectorEvent voiEvent)resets the volumes list to the current VOIVector. adds the highlighter to the new VOI.voidalgorithmPerformed(AlgorithmBase event)the standard thread-done event forAlgorithmBase.private voidanotherCall()protected voidbuildCheckBoxPanel()protected voidbuildDialog(VOIVector voiList)Builds main dialog.protected javax.swing.JScrollPanebuildLogPanel()creates a panel for the output log.protected javax.swing.JMenuBarbuildMenuEntries()Builds a small menu with "Clear log" and "Overwrite" options.protected javax.swing.JPanelbuildOKCancelPanel()creates the panel which consists of the OKAY button and the Cancel button.private javax.swing.JPanelbuildSelectedListing()creates the visual display in which to list all selected directories in the directory tree.private javax.swing.JPanelbuildSourceListingPanel(VOIVector VOIlist)Creates the panel holding the directory tree.private javax.swing.JPanelbuildSourcePanel(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 voidbuildToolBar()Build the toolbar control.protected javax.swing.JPanelbuildVOIPanel(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 voidcallAlgorithm()Once all the necessary variables are set, call the VOI Props algorithm to run the statistic calculation.protected voidcleanUpAndDispose()Clean up some things done by the dialog which may affect other parts of MIPAV.protected voidcreateNewLogModel()This method resets the logModel in preparation for writing new statistics valuesprotected voiddoPostAlgorithmActions()Used to perform actions after the execution of the algorithm is completed (e.g., put the result image in the image table).private booleanisStatisticSelectionOkay()checks to see if the checklist has had any selections made to it.private booleanisTableDestinationOkay()Locates the translation/key-file destination directory.voidrefreshVOIList(VOIVector VOIlist)Refreshes the list of available and selected VOIs.voidremovedVOI(VOIVectorEvent voiEvent)resets the volumes list to the current VOIVector. removes the highlighter from the removed VOI.protected voidsetGUIFromParams()Set the dialog GUI using the script parameters while running this algorithm as part of a script.private java.io.FilesetupNew(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 booleansetVariables()use the GUI results to set up the variables needed to run the algorithm.protected voidstoreParamsFromGUI()Record the parameters just used to run this algorithm in a script.protected voidupdateDialog()Method for updating the GUI after the algorithm has completed, should not be called when scripting.protected voidupdateDialogRow(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 voidupdateStatLog()Method for updating the table after the algorithm has completed.voidvectorSelected(VOIVectorEvent voiEvent)un-implemented.protected voidwriteLogHeader()Writes the column titles of selected statistics calculations to the logModel.protected java.lang.StringBufferwriteLogModelToString()Converts the current logModel into either a tab-delimited text file or an XML file.protected voidwriteStatisticFile()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 wheretruemeans 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:
actionPerformedin interfacejava.awt.event.ActionListener- Overrides:
actionPerformedin 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:
addedVOIin interfaceVOIVectorListener- Parameters:
voiEvent- DOCUMENT ME!
-
algorithmPerformed
public void algorithmPerformed(AlgorithmBase event)
the standard thread-done event forAlgorithmBase.- Specified by:
algorithmPerformedin 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:
removedVOIin interfaceVOIVectorListener- Parameters:
voiEvent- DOCUMENT ME!
-
vectorSelected
public void vectorSelected(VOIVectorEvent voiEvent)
un-implemented.- Specified by:
vectorSelectedin 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:
callAlgorithmin 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:
doPostAlgorithmActionsin 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
protected void storeParamsFromGUI() throws ParserExceptionRecord 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.
-
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.SecurityExceptionmakes 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:
trueif parameters set successfully,falseotherwise.
-
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
-
-