Package sc.fiji.snt
Class SNTUI
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
sc.fiji.snt.SNTUI
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,RootPaneContainer,WindowConstants
Implements SNT's main dialog.
- Author:
- Tiago Ferreira
- See Also:
-
Nested Class Summary
Nested 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 TypeFieldDescriptionprotected booleanprotected booleanprotected booleanstatic final intFlag specifying UI is currently waiting for user to edit a selected Pathprotected booleanstatic final intFlag specifying UI is currently waiting for fitting operations to concludeprotected GuiUtilsstatic final intFlag specifying UI is currently waiting for I/0 operations to concludeprotected CheckboxSpinnerstatic final intFlag specifying that image data is available and the UI is not waiting on any pending operations, thus 'ready to trace'protected Viewer3Dprotected Framestatic final intprotected SciViewSNTprotected JSpinnerprotected JSpinnerstatic final intFlag specifying all SNT are temporarily disabled (all user interactions are waived back to ImageJ)static final intFlag specifying tracing functions are (currently) disabled.protected JCheckBoxstatic final intFields 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
ConstructorsConstructorDescriptionInstantiates SNT's main UI and associatedPathManagerUIandFillManagerUIinstances. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected booleanvoidchangeState(int newState) Changes this UI to a new state.protected voidprotected voidprotected voidprotected voidenableAStarGUI(boolean enable) Should only be called bySNT.enableAstar(boolean)voidprotected voidprotected voidgaussianCalculated(boolean succeeded) protected StringGets the Bookmark Manager pane.Returns the Curation Manager (Curation Assistant).Gets the Delineations Manager pane.Gets the Fill Manager dialog.protected StringGets the Bookmark Manager pane.Returns the workspace directory, prompting user to create it if it doesn't exist.Gets the Path Manager dialog.Returns the plausibility monitor used by the Curation Manager (Curation Assistant).getPrefs()getReconstructionViewer(boolean initializeIfNull) Gets the Reconstruction Viewer.getRecorder(boolean createIfNeeded) getSciViewSNT(boolean initializeIfNull) Gets the SciViewSNT instance.intgetState()Gets the current UI state.getTable()protected voidbooleanisReady()Assesses whether the UI is blocked.protected voidlaunchSigmaPaletteAround(int x, int y) protected voidloadImagefromGUI(int newC, int newT) protected booleanprotected voidprotected Fileprotected FileopenReconstructionFile(String extension) voidpause(boolean pause) Pauses/Resume SNT (equivalent to command in image contextual menu).voidpauseTracing(boolean pause) Pauses/Resume tracing functions (equivalent to command in image contextual menu).protected voidvoidrefresh()Updates the dialog, including status bar and 'computation settings' widget.protected voidreset()protected voidvoidLaunches the autotracing wizard for the active image.voidrunCommand(Class<? extends org.scijava.command.Command> cmd, HashMap<String, Object> inputs) Runs a Scijava command associated with SNT.voidrunCommand(String cmd) Runs a menu command (as listed in the menu bar hierarchy).voidrunCommand(String cmd, String... args) Runs a menu command with options.protected booleanrunCustomCommand(String cmd) voidRuns the 'secondary layer' wizard prompt for built-in filtersvoidrunSecondaryLayerWizard(String filter, double[] scales) Runs the 'secondary layer wizard' in the background, without displaying prompt.protected voidprotected booleansaveAllPathsToSwc(String filePath) protected booleansaveAllPathsToSwc(String filePath, String commonFileHeader) protected Fileprotected voidsaveToXML(boolean timeStampedCopy) protected booleanprotected voidsaveTracingsAndOpenSiblingImage(boolean next) voidActivates the specified tab.voidsetEnableDebugMode(boolean enable) Enables/disables debug modeprotected voidsetFillListVisible(boolean makeVisible) voidsetLookAndFeel(String lookAndFeelName) protected voidsetReconstructionViewer(Viewer3D recViewer) voidsetRenderingScale(double scale) Sets rendering scale of Paths as per respective widget in dialog.protected voidsetSciViewSNT(SciViewSNT sciViewSNT) protected voidsetSecondaryLayerTracingSelected(boolean enable) voidsetSigmaPaletteListener(SigmaPaletteListener listener) voidsetVisibilityFilter(String filter, boolean state) Sets filters for visibility of paths, as per respective widget in dialog.voidshowMessage(String msg, String title) voidshowStatus(String msg, boolean temporary) Updates the status bar.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidMethods 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, setVisible, 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
-
partsNearbyCSpinner
-
useSnapWindow
-
snapWindowXYsizeSpinner
-
snapWindowZsizeSpinner
-
guiUtils
-
recViewer
-
recViewerFrame
-
sciViewSNT
-
READY
public static final int READYFlag specifying that image data is available and the UI is not waiting on any pending operations, thus 'ready to trace'- See Also:
-
RUNNING_CMD
public static final int RUNNING_CMD- See Also:
-
WAITING_FOR_SIGMA_POINT_I
public static final int WAITING_FOR_SIGMA_POINT_I- See Also:
-
LOADING
public static final int LOADINGFlag specifying UI is currently waiting for I/0 operations to conclude- See Also:
-
FITTING_PATHS
public static final int FITTING_PATHSFlag specifying UI is currently waiting for fitting operations to conclude- See Also:
-
EDITING
public static final int EDITINGFlag specifying UI is currently waiting for user to edit a selected Path- See Also:
-
SNT_PAUSED
public static final int SNT_PAUSEDFlag specifying all SNT are temporarily disabled (all user interactions are waived back to ImageJ)- See Also:
-
TRACING_PAUSED
public static final int TRACING_PAUSEDFlag specifying tracing functions are (currently) disabled. Tracing is disabled when the user chooses so or when no valid image data is available (e.g., when no image has been loaded and a placeholder display canvas is being used)- See Also:
-
confirmTemporarySegments
protected boolean confirmTemporarySegments -
finishOnDoubleConfimation
protected boolean finishOnDoubleConfimation -
discardOnDoubleCancellation
protected boolean discardOnDoubleCancellation -
askUserConfirmation
protected boolean askUserConfirmation
-
-
Constructor Details
-
SNTUI
Instantiates SNT's main UI and associatedPathManagerUIandFillManagerUIinstances.- Parameters:
plugin- theSNTinstance associated with this UI
-
-
Method Details
-
getState
public int getState()Gets the current UI state.- Returns:
- the current UI state, e.g.,
READY,RUNNING_CMD, etc.
-
getPrefs
- Returns:
- the preferences associated with this instance
-
isReady
public boolean isReady()Assesses whether the UI is blocked.- Returns:
- true if the UI is currently unblocked, i.e., ready for tracing/editing/analysis *
-
setEnableDebugMode
public void setEnableDebugMode(boolean enable) Enables/disables debug mode- Parameters:
enable- true to enable debug mode, otherwise false
-
pause
public void pause(boolean pause) Pauses/Resume SNT (equivalent to command in image contextual menu).- Parameters:
pause- whether SNT should be paused/resumed
-
pauseTracing
public void pauseTracing(boolean pause) Pauses/Resume tracing functions (equivalent to command in image contextual menu).- Parameters:
pause- whether tracing functions should be paused/resumed
-
runCommand
Runs a menu command (as listed in the menu bar hierarchy).- Parameters:
cmd- The command to be run, exactly as listed in its menu (either in this dialog, orPathManagerUI)- Throws:
IllegalArgumentException- ifcmdwas not found.
-
selectTab
Activates the specified tab.- Parameters:
tabTitle- The tab title (e.g., "Main", "3D");
-
runCommand
Runs a menu command with options.- Parameters:
cmd- The command to be run, exactly as listed in SNTUI's menu barargs- the option(s) that would fill the command's prompt. e.g., 'runCommand("Load Demo Dataset...", "4. Hippocampal neuron (DIC timelapse)")'- Throws:
IllegalArgumentException- ifcmdis not found or supported.
-
runCommand
public void runCommand(Class<? extends org.scijava.command.Command> cmd, HashMap<String, Object> inputs) Runs a Scijava command associated with SNT.- Parameters:
cmd- The command class to be run, exactly as listed in SNTUI's menu barinputs- the input(s) map
-
runSNTCommandFinderCommand
-
runCustomCommand
-
getBookmarkManager
Gets the Bookmark Manager pane.- Returns:
- the
BookmarkManagerassociated with this UI
-
getNotesPane
Gets the Bookmark Manager pane.- Returns:
- the
BookmarkManagerassociated with this UI
-
getDelineationsManager
Gets the Delineations Manager pane.- Returns:
- the
DelineationsManagerassociated with this UI
-
runAutotracingWizard
public void runAutotracingWizard()Launches the autotracing wizard for the active image.The tracer implementation is selected based on image type:
- Binary images:
BinaryTracerCmd(topology-based skeletonization) - Grayscale images:
GWDTTracerCmd(intensity-weighted distance transform)
- See Also:
- Binary images:
-
runSecondaryLayerWizard
public void runSecondaryLayerWizard()Runs the 'secondary layer' wizard prompt for built-in filters -
runSecondaryLayerWizard
Runs the 'secondary layer wizard' in the background, without displaying prompt.- Parameters:
filter- either "Frangi Vesselness", "Tubeness", or "Gaussian Blur"scales- a list of aprox. thicknesses (radius) of the structures being traced- Throws:
IllegalArgumentException- if no valid image data is currently loaded
-
gaussianCalculated
protected void gaussianCalculated(boolean succeeded) -
refresh
public void refresh()Updates the dialog, including status bar and 'computation settings' widget. -
setVisibilityFilter
Sets filters for visibility of paths, as per respective widget in dialog.- Parameters:
filter- a reference to the visibility filter checkbox. Either the checkbox complete label or relevant keyword, e.g., "selected", "Z-slices", "channel", etc. "all" can also be used to toggle all checkboxes in the widgetstate- whether the filter should be active or not.
-
setRenderingScale
public void setRenderingScale(double scale) Sets rendering scale of Paths as per respective widget in dialog.- Parameters:
scale- the scale value (-1 for default scale)
-
geSettingsString
-
updateSettingsString
protected void updateSettingsString() -
exitRequested
protected void exitRequested() -
disableImageDependentComponents
protected void disableImageDependentComponents() -
changeState
public void changeState(int newState) Changes this UI to a new state. Does nothing ifnewStateis the current UI state- Parameters:
newState- the new state, e.g.,READY,TRACING_PAUSED, etc.
-
resetState
protected void resetState() -
error
-
showMessage
-
loadImagefromGUI
protected void loadImagefromGUI(int newC, int newT) -
updateAssignDiameterSpinner
protected void updateAssignDiameterSpinner() -
openFile
-
openReconstructionFile
-
saveFile
-
updateSecLayerWidgets
protected void updateSecLayerWidgets() -
showStatus
Updates the status bar.- Parameters:
msg- the text to displayed. Set it to null (or empty String) to reset the status bar.temporary- if true andmsgis valid, text is displayed transiently for a couple of seconds
-
setLookAndFeel
-
getOrPromptForWorkspace
Returns the workspace directory, prompting user to create it if it doesn't exist.- Returns:
- workspace directory, or null if user declined creation
-
displayOnStarting
protected void displayOnStarting() -
promptForAutoTracingAsAppropriate
protected void promptForAutoTracingAsAppropriate() -
noPathsError
protected boolean noPathsError() -
setFillListVisible
protected void setFillListVisible(boolean makeVisible) -
setSigmaPaletteListener
-
getPathManager
Gets the Path Manager dialog.- Returns:
- the
PathManagerUIassociated with this UI
-
getFillManager
Gets the Fill Manager dialog.- Returns:
- the
FillManagerUIassociated with this UI
-
getPlausibilityMonitor
Returns the plausibility monitor used by the Curation Manager (Curation Assistant). -
getCurationManager
Returns the Curation Manager (Curation Assistant). -
getReconstructionViewer
Gets the Reconstruction Viewer.- Parameters:
initializeIfNull- it true, initializes the Viewer if it has not yet been initialized- Returns:
- the reconstruction viewer
-
getSciViewSNT
Gets the SciViewSNT instance.- Parameters:
initializeIfNull- whether a new instance should be created if one hasn't been initialized- Returns:
- the SciViewSNT instance
-
getTracingCanvasPopupMenu
-
setReconstructionViewer
-
setSciViewSNT
-
reset
protected void reset() -
ctPositionChanged
protected void ctPositionChanged() -
inputImageChanged
protected void inputImageChanged() -
abortCurrentOperation
protected void abortCurrentOperation() -
launchSigmaPaletteAround
protected void launchSigmaPaletteAround(int x, int y) -
togglePathsChoice
protected void togglePathsChoice() -
setSecondaryLayerTracingSelected
protected void setSecondaryLayerTracingSelected(boolean enable) -
toggleSecondaryLayerTracing
protected void toggleSecondaryLayerTracing() -
enableAStarGUI
protected void enableAStarGUI(boolean enable) Should only be called bySNT.enableAstar(boolean) -
togglePartsChoice
protected void togglePartsChoice() -
toggleChannelAndFrameChoice
protected void toggleChannelAndFrameChoice() -
accessToValidImagePlus
protected boolean accessToValidImagePlus() -
noValidImageDataError
protected void noValidImageDataError() -
getTable
-
saveTracingsAndOpenSiblingImage
protected void saveTracingsAndOpenSiblingImage(boolean next) -
getImageFilenamePrefix
-
saveToXML
protected void saveToXML(boolean timeStampedCopy) -
saveToXML
-
saveAllPathsToSwc
-
saveAllPathsToSwc
-
getRecorder
-