Class SNT
- All Implemented Interfaces:
HessianGenerationCallback,PaneOwner,SearchProgressCallback
- Author:
- Tiago Ferreira, Cameron Arshadi
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected static final intprotected intprotected ij.ImagePlusprotected Pathprotected intprotected intprotected static final Colorprotected static final org.jogamp.vecmath.Color3fprotected static final Colorprotected static final org.jogamp.vecmath.Color3fprotected intprotected Colorprotected org.jogamp.vecmath.Color3fprotected static final intprotected static final intprotected static final intprotected booleanprotected booleanprotected SNT.FilterTypeprotected intprotected intprotected intprotected booleanprotected doubleprotected doubleprotected doubleprotected List<SNTListener> protected doubleprotected static final intprotected static final intprotected static final intprotected static final intprotected doubleprotected booleanprotected booleanprotected booleanprotected SNT.SearchImageTypeprotected net.imglib2.RandomAccessibleIntervalprotected Fileprotected Colorprotected org.jogamp.vecmath.Color3fprotected booleanprotected booleanprotected booleanprotected Stringprotected static final Stringprotected org.scijava.app.StatusServiceprotected static final Stringprotected Pathprotected booleanprotected TubularGeodesicsTracerprotected booleanprotected SNTUIprotected ij3d.Image3DUniverseprotected booleanprotected static booleanprotected intprotected doubleprotected doubleprotected doubleFields inherited from class sc.fiji.snt.hyperpanes.MultiDThreePanes
MIP_OVERLAY_IDENTIFIER_PREFIX, single_pane, singleSlice, xy, xy_canvas, XY_PLANE, xy_window, xz, xz_canvas, XZ_PLANE, xz_window, zy, zy_canvas, ZY_PLANE, zy_window -
Constructor Summary
ConstructorsConstructorDescriptionSNT(ij.ImagePlus sourceImage) Script-friendly constructor for Instantiating and initializing SNT in 'Tracing Mode' (typically headless operations).SNT(net.imagej.ImgPlus<T> sourceImage) Script-friendly constructor for Instantiating SNT in 'Tracing Mode' (typically headless operations)SNT(net.imagej.ImgPlus<T> sourceImage, int channel, int timePoint) Script-friendly constructor for Instantiating SNT in 'Tracing Mode' (typically headless operations)SNT(org.scijava.Context context, ij.ImagePlus sourceImage) Instantiates SNT in 'Tracing Mode'.SNT(org.scijava.Context context, PathAndFillManager pathAndFillManager) Instantiates SNT in 'Analysis Mode' -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether valid image data exists.voidaddFillerThread(FillerThread filler) voidaddListener(SNTListener listener) protected voidprotected booleanautoTrace(List<SNTPoint> pointList, PointInImage forkPoint) Automatically traces a path from a list of points and adds it to the activePathAndFillManagerinstance.autoTrace(List<SNTPoint> pointList, PointInImage forkPoint, boolean headless) Automatically traces a path from a point A to a point B.autoTrace(SNTPoint start, SNTPoint end, PointInImage forkPoint) Automatically traces a path from a point A to a point B.autoTrace(SNTPoint start, SNTPoint end, PointInImage forkPoint, boolean headless) Automatically traces a path from a point A to a point B.voidCancels the temporary path.voidcancelSearch(boolean cancelFillToo) voidij.ImagePluscaptureView(String view, boolean project) Retrieves a WYSIWYG 'snapshot' of a tracing canvas.ij.ImagePluscaptureView(String view, org.scijava.util.ColorRGB backgroundColor) Retrieves a WYSIWYG 'snapshot' of a tracing canvas without voxel data.voidchangeUIState(int newState) protected voidclickAtMaxPoint(int x_in_pane, int y_in_pane, int plane, boolean join) protected voidclickForTrace(double world_x, double world_y, double world_z, boolean join) protected voidclickForTrace(double x_in_pane_precise, double y_in_pane_precise, int plane, boolean join) protected voidclickForTrace(org.jogamp.vecmath.Point3d p, boolean join) voidprotected <T extends net.imglib2.type.numeric.RealType<T>>
ij.process.ImageStatisticscomputeImgStats(Iterable<T> in, ij.process.ImageStatistics imgStats) <T extends net.imglib2.type.numeric.RealType<T>>
ij.process.ImageStatisticscomputeImgStats(Iterable<T> in, ij.process.ImageStatistics imgStats, SNT.CostType costType) voidconfirmTemporary(boolean updateTracingViewers) sc.fiji.snt.InteractiveTracerCanvascreateCanvas(ij.ImagePlus imagePlus, int plane) protected voidprotected voidprotected voiddiscreteMsg(String msg) protected voiddispose()booleanAssesses if activation of 'Edit Mode' is possible.protected booleaneditModeAllowed(boolean warnUserIfNot) Checks if edit mode can be enabled.protected booleaneditModeAllowed(boolean warnUserIfNot, Path pathToEdit) Checks if edit mode can be enabled, optionally using a specific path.voidenableAstar(boolean enable) Toggles the A* search algorithm (enabled by default)voidenableAutoActivation(boolean enable) voidenableAutoSelectionOfFinishedPath(boolean enable) protected voidenableEditMode(boolean enable) voidenableSecondaryLayerTracing(boolean enable) voidenableSnapCursor(boolean enable) Enables SNT's XYZ snap cursor feature.protected voidprotected voidfindSnappingPointInXView(double x_in_pane, double y_in_pane, double[] point) voidfinished(SearchInterface source, boolean success) protected voidvoidprotected ij3d.Image3DUniverseDeprecated.protected Componentdoubleij.measure.CalibrationgetCanvas(int pane) intprotected booleangetConfirmation(String msg, String title) org.scijava.Contextnet.imagej.DatasetGets the Image being traced as Dataset.intgetDepth()booleanprotected intprotected Pathij.ImagePlusij.ImagePlus<T extends net.imglib2.type.numeric.RealType<T>>
ij.ImagePlus<T extends net.imglib2.type.numeric.IntegerType<T>>
ij.ImagePlusdoubleprotected FileReturns the file of the 'secondary image', if any.intgetFrame()intij.ImagePlusGets the Image being traced.ij.ImagePlusgetImagePlus(int pane) Gets the Image associated with a view pane.protected doublegetImpDiagonalLength(boolean scaled, boolean xyOnly) <T extends net.imglib2.type.numeric.RealType<T>>
net.imglib2.RandomAccessibleInterval<T> net.imagej.ImgPlus<?> getLoadedDataAsImg(boolean secondaryLayer) <T extends net.imglib2.type.numeric.RealType<T>>
ij.ImagePlusRetrieves the pixel data of the main image currently loaded in memory as an ImagePlus object.<T> net.imglib2.IterableIntervaldoubleprotected doubleprotected intDeprecated.doubledoubledoublegetPrefs()protected Path<T extends net.imglib2.type.numeric.RealType<T>>
net.imglib2.RandomAccessibleInterval<T> <T extends net.imglib2.type.numeric.NumericType<T>>
ij.ImagePlusRetrieves the 'secondary image' data currently loaded in memory as an ImagePlus object.double[]Returns theSeedOverlayassociated with this SNT instance.protected Pathij.process.ImageStatisticsgetStats()ij.process.ImageStatisticsprotected sc.fiji.snt.InteractiveTracerCanvasgetUI()Gets the main UI.protected intbooleanintgetWidth()protected intvoidinitialize(boolean singlePane, int channel, int frame) Initializes the plugin by assembling all the required tracing viewsvoidinitialize(boolean singlePane, int channel, int frame, boolean computeStackStats) voidinitialize(ij.ImagePlus imp) voidinitPathsToFill(Set<Path> fromPaths, boolean splitFillerThreads) protected <T extends net.imglib2.type.numeric.RealType<T>>
booleaninvalidStatsError(boolean isSecondary) booleanis2D()booleanChecks if A* search is enabledprotected booleanisCachedData(ij.ImagePlus imp) protected booleanisDisplayCanvas(ij.ImagePlus imp) protected booleanReturns whether the path currently being edited is displayed as its fitted version.protected booleanbooleanbooleanAssesses if the 'secondary image' has been loaded into memory.protected booleanbooleanprotected booleanprotected booleanprotected booleanprotected voidjustDisplayNearSlices(boolean value, int eitherSide) voidloadLabelsFile(String path) voidloadSecondaryImage(ij.ImagePlus imp) protected voidloadSecondaryImage(ij.ImagePlus imp, boolean changeUIState) voidloadSecondaryImage(File file) Loads the 'secondary image' specified bysetSecondaryImage(File)into memory as 32-bit data.<T extends net.imglib2.type.numeric.RealType<T>>
voidloadSecondaryImage(net.imglib2.RandomAccessibleInterval<T> img, boolean computeStatistics) protected <T extends net.imglib2.type.numeric.RealType<T>>
voidloadSecondaryImage(net.imglib2.RandomAccessibleInterval<T> img, boolean changeUIState, boolean computeStatistics) protected booleanloadSWCFile(File file) protected booleanloadTracesFile(File file) Assumes UI is availablebooleanloadTracings(File file) ij.ImagePlusmakePathVolume(Collection<Path> paths, boolean labelsImage) Rasterizes centerline of paths into an ImagePlusvoidmouseMovedTo(double x_in_pane, double y_in_pane, int in_plane, boolean sync_panes_modifier_down, boolean join_modifier_down) voidnotifyListeners(SNTEvent event) protected voidpause(boolean pause, boolean hideSideViewsOnPause) protected voidpauseTracing(boolean pause, boolean validateChange) voidpointsInSearch(SearchInterface source, long inOpen, long inClosed) voidproportionDone(double proportion) voidRebuilds display canvases, i.e., the placeholder canvases used when no valid image data exists (a single-canvas is rebuilt if only the XY view is active).voidvoidreloadImage(int channel, int frame) protected voidremoveSphere(String name) protected voidreplaceCurrentPath(Path path) protected voidsaveFill()voidselectPath(Path p, boolean addToExistingSelection) protected voidset3DUniverse(ij3d.Image3DUniverse universe) voidsetAnnotationsVisible(boolean visible) Enables/Disables SNT overlays over tracing views.protected voidsetColorImage(ij.ImagePlus newColorImage) Deprecated.voidsetCostType(SNT.CostType costType) voidsetCurrentPath(Path path) protected voidsetDeselectedColor(Color newColor) voidsetDrawDiameters(boolean draw) protected voidsetEditingPath(Path path) voidsetFillList(List<Fill> fillList) voidsetFillThreshold(double distance) Sets the fill threshold distance.voidsetFillThresholdFrom(double world_x, double world_y, double world_z) protected voidsetFillTransparent(boolean transparent) voidsetFilterType(SNT.FilterType filterType) voidsetHeuristicType(SNT.HeuristicType heuristicType) voidsetPathList(List<Path> pathList, Path justAdded, boolean expandAll) protected voidsetPaths3DDisplay(int paths3DDisplay) Deprecated.protected voidsetPathUnfinished(boolean unfinished) voidsetSearchImageType(SNT.SearchImageType searchImageType) voidsetSearchType(SNT.SearchType searchType) voidsetSecondaryImage(File file) Specifies the 'secondary image' to be used during a tracing session.voidsetSecondaryImageMinMax(double min, double max) protected voidsetSelectedColor(Color newColor) voidsetSelectedPaths(Collection<Path> selectedPathsSet, Object source) protected voidsetShowOnlyActiveCTposPaths(boolean showOnlyActiveCTposPaths, boolean updateGUI) voidsetShowOnlySelectedPaths(boolean showOnlySelectedPaths) protected voidsetShowOnlySelectedPaths(boolean showOnlySelectedPaths, boolean updateGUI) voidsetStopFillAtThreshold(boolean stopFillAtThreshold) voidsetStoreExtraFillNodes(boolean storeExtraFillNodes) voidsetTemporaryPath(Path path) protected voidsetUnsavedChanges(boolean b) voidsetUseSubVolumeStats(boolean useSubVolumeStatistics) protected voidshowCanvasInfo(String msg) protected voidshowCanvasInfo(String msg, int durationMs) Displays a timed informational message (blue background) on the canvas banner.protected voidshowCanvasWarning(String msg) protected voidshowCanvasWarning(String msg, int durationMs) Displays a timed warning (amber background) on the canvas banner.voidshowCorrespondencesTo(File tracesFile, Color c, double maxDistance) Deprecated.protected voidshowMessage(String msg, String title) protected voidshowMIPOverlays(boolean filteredData, double opacity) voidshowMIPOverlays(double opacity) Overlays a semi-transparent MIP (8-bit scaled) of the data being traced over the tracing canvas(es).voidshowStatus(int progress, int maximum, String status) Shows a status message with progress information.protected voidvoidstartHessian(String image, double sigma, double max, boolean wait) Deprecated.<T extends net.imglib2.type.numeric.RealType<T>>
voidstartHessian(String image, String filter, double[] scales, double min, double max, String strategy, int nThreads) Constructs and enables an instance of a hessian eigenvalue filter.<T extends net.imglib2.type.numeric.RealType<T>>
voidstartHessian(String image, String filter, double[] scales, String strategy, int nThreads) Constructs and enables an instance of a hessian eigenvalue filter.protected voidstartRubberBandSearch(double x_in_pane, double y_in_pane, int plane) protected voidstartSholl(PointInImage centerScaled) voidstartUI()protected voidprotected voidstopFilling(boolean updateUIState) voidthreadStatus(SearchInterface source, int status) protected voidprotected booleanprotected voidvoidprotected voidupdateCursor(double new_x, double new_y, double new_z) voidRebuilds display canvas(es) to ensure all paths are contained in the image.protected voidupdateImageContent(int resamplingFactor) Deprecated.protected voidprotected voidupdateTracingViewers(boolean includeLegacy3Dviewer) Methods inherited from class sc.fiji.snt.hyperpanes.MultiDThreePanes
disableEventsAllPanes, disableZoomAllPanes, findAllPointsAlongLine, findPointInStack, findPointInStackPrecise, getSinglePane, getZYXZ, initialize, isDummy, isZoomAllPanesDisabled, main, mouseMovedTo, panEventOccurred, reloadZYXZpanes, removeMIPOverlayAllPanes, removeMIPOverlayAllPanes, repaintAllPanes, setAnnotationsColorAllPanes, setCanvasLabelAllPanes, setCanvasLabelBackgroundAllPanes, setCursorTextAllPanes, setDrawCrosshairsAllPanes, setLockCursorAllPanes, setSinglePane, setZPositionAllPanes, unzoomAllPanes, zoom100PercentAllPanes, zoomAllPanes, zoomEventOccurred
-
Field Details
-
statusService
protected org.scijava.app.StatusService statusService -
verbose
protected static boolean verbose -
MIN_SNAP_CURSOR_WINDOW_XY
protected static final int MIN_SNAP_CURSOR_WINDOW_XY- See Also:
-
MIN_SNAP_CURSOR_WINDOW_Z
protected static final int MIN_SNAP_CURSOR_WINDOW_Z- See Also:
-
MAX_SNAP_CURSOR_WINDOW_XY
protected static final int MAX_SNAP_CURSOR_WINDOW_XY- See Also:
-
MAX_SNAP_CURSOR_WINDOW_Z
protected static final int MAX_SNAP_CURSOR_WINDOW_Z- See Also:
-
startBallName
- See Also:
-
targetBallName
- See Also:
-
ballRadiusMultiplier
protected static final int ballRadiusMultiplier- See Also:
-
univ
protected ij3d.Image3DUniverse univ -
use3DViewer
protected boolean use3DViewer -
colorImage
protected ij.ImagePlus colorImage -
DISPLAY_PATHS_SURFACE
protected static final int DISPLAY_PATHS_SURFACE- See Also:
-
DISPLAY_PATHS_LINES
protected static final int DISPLAY_PATHS_LINES- See Also:
-
DISPLAY_PATHS_LINES_AND_DISCS
protected static final int DISPLAY_PATHS_LINES_AND_DISCS- See Also:
-
cursorSnapWindowXY
protected volatile int cursorSnapWindowXY -
cursorSnapWindowZ
protected volatile int cursorSnapWindowZ -
autoCanvasActivation
protected volatile boolean autoCanvasActivation -
panMode
protected volatile boolean panMode -
snapCursor
protected volatile boolean snapCursor -
showOnlySelectedPaths
protected volatile boolean showOnlySelectedPaths -
showOnlyActiveCTposPaths
protected volatile boolean showOnlyActiveCTposPaths -
activateFinishedPath
protected volatile boolean activateFinishedPath -
requireShiftToFork
protected volatile boolean requireShiftToFork -
autoCT
protected volatile boolean autoCT -
manualRadius
protected double manualRadius -
width
protected int width -
height
protected int height -
depth
protected int depth -
imageType
protected int imageType -
x_spacing
protected double x_spacing -
y_spacing
protected double y_spacing -
z_spacing
protected double z_spacing -
spacing_units
-
channel
protected int channel -
frame
protected int frame -
filterType
-
searchImageType
-
isUseSubVolumeStats
protected volatile boolean isUseSubVolumeStats -
oneMinusErfZFudge
protected volatile double oneMinusErfZFudge -
doSearchOnSecondaryData
protected boolean doSearchOnSecondaryData -
secondaryData
protected net.imglib2.RandomAccessibleInterval secondaryData -
secondaryImageFile
-
tubularGeodesicsTracingEnabled
protected boolean tubularGeodesicsTracingEnabled -
tubularGeodesicsThread
-
last_start_point_x
protected double last_start_point_x -
last_start_point_y
protected double last_start_point_y -
last_start_point_z
protected double last_start_point_z -
temporaryPath
-
currentPath
-
ui
-
tracingHalted
protected volatile boolean tracingHalted -
rubberBandTracing
protected volatile boolean rubberBandTracing -
DEFAULT_SELECTED_COLOR
-
DEFAULT_DESELECTED_COLOR
-
DEFAULT_SELECTED_COLOR3F
protected static final org.jogamp.vecmath.Color3f DEFAULT_SELECTED_COLOR3F -
DEFAULT_DESELECTED_COLOR3F
protected static final org.jogamp.vecmath.Color3f DEFAULT_DESELECTED_COLOR3F -
selectedColor3f
protected org.jogamp.vecmath.Color3f selectedColor3f -
deselectedColor3f
protected org.jogamp.vecmath.Color3f deselectedColor3f -
selectedColor
-
deselectedColor
-
displayCustomPathColors
protected boolean displayCustomPathColors -
confirmedSegmentSizes
-
listeners
-
-
Constructor Details
-
SNT
Script-friendly constructor for Instantiating and initializing SNT in 'Tracing Mode' (typically headless operations). The channel/frame to be traced is assumed to be the image's active CT position.Note that the image is not displayed. For interactive display of the image call
initialize(ImagePlus)/startUI()directly.- Parameters:
sourceImage- the source image- Throws:
IllegalArgumentException- If sourceImage is of type 'RGB'
-
SNT
Script-friendly constructor for Instantiating SNT in 'Tracing Mode' (typically headless operations)- Parameters:
sourceImage- the source image- Throws:
IllegalArgumentException
-
SNT
public SNT(net.imagej.ImgPlus<T> sourceImage, int channel, int timePoint) throws IllegalArgumentException Script-friendly constructor for Instantiating SNT in 'Tracing Mode' (typically headless operations)- Parameters:
sourceImage- the source imagechannel- channel index to extract (index 0)timePoint- time index to extract (index 0)- Throws:
IllegalArgumentException
-
SNT
Instantiates SNT in 'Tracing Mode'.- Parameters:
context- the SciJava application context providing the services required by the classsourceImage- the source image- Throws:
IllegalArgumentException- If sourceImage is of type 'RGB'
-
SNT
Instantiates SNT in 'Analysis Mode'- Parameters:
context- the SciJava application context providing the services required by the classpathAndFillManager- The PathAndFillManager instance to be associated with the plugin
-
-
Method Details
-
undoLastSegment
protected void undoLastSegment() -
rebuildDisplayCanvases
Rebuilds display canvases, i.e., the placeholder canvases used when no valid image data exists (a single-canvas is rebuilt if only the XY view is active).Useful when multiple files are imported and imported paths 'fall off' the dimensions of current canvas(es). If there is not enough memory to accommodate enlarged dimensions, the resulting canvas will be a 2D image.
- Throws:
IllegalArgumentException- if valid image data exists
-
updateDisplayCanvases
public void updateDisplayCanvases()Rebuilds display canvas(es) to ensure all paths are contained in the image. Does nothing if placeholder canvas(es) are not being used.- See Also:
-
accessToValidImageData
public boolean accessToValidImageData()Checks whether valid image data exists.- Returns:
- true if a tracing image exists, or (for headless/API usage) cached pixel data remains in memory.
-
isDisplayCanvas
protected boolean isDisplayCanvas(ij.ImagePlus imp) -
isCachedData
protected boolean isCachedData(ij.ImagePlus imp) -
initialize
public void initialize(ij.ImagePlus imp) - Overrides:
initializein classMultiDThreePanes
-
initialize
public void initialize(boolean singlePane, int channel, int frame) Initializes the plugin by assembling all the required tracing views- Parameters:
singlePane- if true only the XY view will be generated, if false XY, ZY, XZ views are createdchannel- the channel to be traced. Ignored when no valid image data exists.frame- the frame to be traced. Ignored when no valid image data exists.
-
initialize
public void initialize(boolean singlePane, int channel, int frame, boolean computeStackStats) -
reloadImage
public void reloadImage(int channel, int frame) -
rebuildZYXZpanes
public void rebuildZYXZpanes() -
startUI
public void startUI() -
loadTracings
-
isUnsavedChanges
protected boolean isUnsavedChanges() -
setUnsavedChanges
protected void setUnsavedChanges(boolean b) -
getPathAndFillManager
-
getSeedOverlay
Returns theSeedOverlayassociated with this SNT instance. The overlay holds candidateSeedPoints (e.g., output of upstream point detectors) and is rendered on the tracing canvas when non-empty.The overlay is transient: it is automatically cleared when the active image changes (see
initialize(ImagePlus)) and is not persisted with the.tracesfile. Importers should useSeedOverlay.addAll(java.util.Collection)for bulk loads.- Returns:
- the seed overlay (never
null)
-
getCanvas
-
getDataset
public net.imagej.Dataset getDataset()Gets the Image being traced as Dataset. If the loaded image has been closed, cached pixel data is returned as pergetLoadedDataAsImp(). Null is returned if no image exists. -
getImagePlus
public ij.ImagePlus getImagePlus()Gets the Image being traced. If the loaded image has been closed, cached pixel data is returned as pergetLoadedDataAsImp(). Null is returned if no image exists. -
getImpDiagonalLength
protected double getImpDiagonalLength(boolean scaled, boolean xyOnly) -
createCanvas
public sc.fiji.snt.InteractiveTracerCanvas createCanvas(ij.ImagePlus imagePlus, int plane) - Overrides:
createCanvasin classMultiDThreePanes
-
dispose
protected void dispose() -
cancelSearch
public void cancelSearch(boolean cancelFillToo) -
threadStatus
- Specified by:
threadStatusin interfaceSearchProgressCallback
-
changeUIState
public void changeUIState(int newState) -
getUIState
protected int getUIState() -
saveFill
protected void saveFill() -
discardFill
protected void discardFill() -
stopFilling
protected void stopFilling(boolean updateUIState) -
stopFilling
protected void stopFilling() -
startFilling
protected void startFilling() -
addListener
-
notifyListeners
-
anyListeners
protected boolean anyListeners() -
finished
- Specified by:
finishedin interfaceSearchProgressCallback
-
pointsInSearch
- Specified by:
pointsInSearchin interfaceSearchProgressCallback
-
justDisplayNearSlices
protected void justDisplayNearSlices(boolean value, int eitherSide) -
uiReadyForModeChange
protected boolean uiReadyForModeChange() -
getEditingPath
-
getPreviousEditingPath
-
getEditingNode
protected int getEditingNode() -
editModeAllowed
public boolean editModeAllowed()Assesses if activation of 'Edit Mode' is possible.- Returns:
- true, if possible, false otherwise
-
editModeAllowed
protected boolean editModeAllowed(boolean warnUserIfNot) Checks if edit mode can be enabled.- Parameters:
warnUserIfNot- if true, shows error messages when edit mode is not allowed- Returns:
- true if edit mode is allowed, false otherwise
-
editModeAllowed
Checks if edit mode can be enabled, optionally using a specific path.- Parameters:
warnUserIfNot- if true, shows error messages when edit mode is not allowedpathToEdit- the path to edit, or null to auto-detect from selection- Returns:
- true if edit mode is allowed, false otherwise
-
isEditingFittedPath
protected boolean isEditingFittedPath()Returns whether the path currently being edited is displayed as its fitted version. Callers should use this to guard edit operations that cannot meaningfully propagate between fitted and unfitted representations (e.g., structural edits such as insert/delete, or tree-level operations like split/re-root).- Returns:
- true if the editing path is in fitted-display mode
-
setEditingPath
-
detectEditingPath
protected void detectEditingPath() -
getSingleSelectedPath
-
enableEditMode
protected void enableEditMode(boolean enable) -
pause
protected void pause(boolean pause, boolean hideSideViewsOnPause) -
pauseTracing
protected void pauseTracing(boolean pause, boolean validateChange) -
isEditModeEnabled
protected boolean isEditModeEnabled() -
updateCursor
protected void updateCursor(double new_x, double new_y, double new_z) -
loadLabelsFile
-
loadTracesFile
Assumes UI is available -
loadSWCFile
-
mouseMovedTo
public void mouseMovedTo(double x_in_pane, double y_in_pane, int in_plane, boolean sync_panes_modifier_down, boolean join_modifier_down) -
setTemporaryPath
-
setCurrentPath
-
getCurrentPath
-
setPathUnfinished
protected void setPathUnfinished(boolean unfinished) -
makePathVolume
Rasterizes centerline of paths into an ImagePlus- Parameters:
labelsImage- If true, each path has a unique intensity; otherwise all nodes are set to 255 (8-bit Binary)- Returns:
- the ImagePlus with embedded centerlines
-
startRubberBandSearch
protected void startRubberBandSearch(double x_in_pane, double y_in_pane, int plane) -
computeImgStats
protected <T extends net.imglib2.type.numeric.RealType<T>> ij.process.ImageStatistics computeImgStats(Iterable<T> in, ij.process.ImageStatistics imgStats) -
computeImgStats
public <T extends net.imglib2.type.numeric.RealType<T>> ij.process.ImageStatistics computeImgStats(Iterable<T> in, ij.process.ImageStatistics imgStats, SNT.CostType costType) -
confirmTemporary
public void confirmTemporary(boolean updateTracingViewers) -
cancelTemporary
public void cancelTemporary() -
cancelPath
public void cancelPath()Cancels the temporary path. -
startHessian
Deprecated.Constructs and enables a lazy instance of aTubenessfilter. The image is filtered locally during path searches. Filtered data is stored in a disk cache when memory runs full. This method is slated for redesign.- Parameters:
image- the image to filter, either "primary" or "secondary".sigma- the scale parameter for the Tubeness filter, in physical units.max- the maximum pixel intensity in the Tubeness image beyond which the cost function of the A* search is minimized.wait- this parameter does nothing.
-
startHessian
public <T extends net.imglib2.type.numeric.RealType<T>> void startHessian(String image, String filter, double[] scales, String strategy, int nThreads) Constructs and enables an instance of a hessian eigenvalue filter. If the strategy is "preprocess", the entire filtered image, including intensity statistics, are pre-computed and stored in memory. If the strategy is "lazy", the image is filtered and measured locally during path searches, and filtered data is stored in a disk cache when memory runs full. If you are tracing over a large image or if you are in a memory-limited environment, you should choose "lazy".- Type Parameters:
T-- Parameters:
image- the image to filter, either "primary" or "secondary".filter- the hessian filter type, either "tubeness" or "frangi"scales- the scale parameters for the Hessian filter, in physical units. Computation time increases linearly with the number of scales.strategy- either "lazy" or "preprocess"nThreads- number of threads to use in the computation
-
startHessian
public <T extends net.imglib2.type.numeric.RealType<T>> void startHessian(String image, String filter, double[] scales, double min, double max, String strategy, int nThreads) Constructs and enables an instance of a hessian eigenvalue filter. If the strategy is "preprocess", the entire filtered image is pre-computed and stored in memory. If the strategy is "lazy", the image is filtered locally during path searches, and filtered data is stored in a disk cache when memory runs full. If you are tracing over a large image or if you are in a memory-limited environment, you should choose "lazy".- Type Parameters:
T-- Parameters:
image- the image to filter, either "primary" or "secondary".filter- the hessian filter type, either "tubeness" or "frangi"scales- the scale parameters for the Hessian filter, in physical units. Computation time increases linearly with the number of scales.min- the minimum pixel intensity in the filtered image beyond which the cost function of the A* search is maximized.max- the maximum pixel intensity in the filtered image beyond which the cost function of the A* search is minimized.strategy- either "lazy" or "preprocess"nThreads- number of threads to use in the computation
-
autoTrace
Automatically traces a path from a point A to a point B. SeeautoTrace(List, PointInImage)for details.- Parameters:
start- thePointInImagethe starting point of the pathend- thePointInImagethe terminal point of the pathforkPoint- thePointInImagefork point of the parentPathfrom which the searched path should branch off, or null if the path should not have any parent.- Returns:
- the path a reference to the computed path.
- See Also:
-
autoTrace
Automatically traces a path from a point A to a point B. SeeautoTrace(List, PointInImage)for details.- Parameters:
start- thePointInImagethe starting point of the pathend- thePointInImagethe terminal point of the pathforkPoint- thePointInImagefork point of the parentPathfrom which the searched path should branch off, or null if the path should not have any parent.headless- whether search should occur headless- Returns:
- the path a reference to the computed path.
- See Also:
-
autoTrace
Automatically traces a path from a list of points and adds it to the activePathAndFillManagerinstance. Note that this method still requires SNT's UI. For headless auto-tracing have a look atTracerThread.SNT's UI will remain blocked in "search mode" until the Path computation completes. Tracing occurs through the active
SearchInterfaceselected in the UI, i.e.,TracerThread(the default A* search),TubularGeodesicsTracer, etc.All input
PointInImagemust be specified in real world coordinates.- Parameters:
pointList- the list ofPointInImagecontaining the nodes to be used as target goals during the search. If the search cannot converge into a target point, such point is omitted from path, if Successful, target point will be included in the final path. The final path. The first point in the list is the start of the path, the last its terminus. Null objects not allowed.forkPoint- thePointInImagefork point of the parentPathfrom which the searched path should branch off, or null if the path should not have any parent.- Returns:
- the path a reference to the computed path. It is added to the Path Manager list. If a path cannot be fully computed from the specified list of points, a single-point path is generated.
-
autoTrace
Automatically traces a path from a point A to a point B. SeeautoTrace(List, PointInImage)for details.- Parameters:
pointList- the list ofPointInImagecontaining the nodes to be used as target goals during the search. If the search cannot converge into a target point, such point is omitted from path, if Successful, target point will be included in the final path. The final path. The first point in the list is the start of the path, the last its terminus. Null objects not allowed.forkPoint- thePointInImagefork point of the parentPathfrom which the searched path should branch off, or null if the path should not have any parent.headless- whether search should occur headless- Returns:
- the path a reference to the computed path.
- See Also:
-
replaceCurrentPath
-
finishedPath
protected void finishedPath() -
clickForTrace
protected void clickForTrace(org.jogamp.vecmath.Point3d p, boolean join) -
clickForTrace
protected void clickForTrace(double world_x, double world_y, double world_z, boolean join) -
clickForTrace
protected void clickForTrace(double x_in_pane_precise, double y_in_pane_precise, int plane, boolean join) -
setFillThresholdFrom
public void setFillThresholdFrom(double world_x, double world_y, double world_z) -
setFillThreshold
Sets the fill threshold distance. Typically, this value is set before a filling operation as a starting value for theFillerThread.- Parameters:
distance- the new threshold distance. Set it to-1to use SNT's default.- Throws:
IllegalArgumentException- If distance is not a valid positive value
-
getFillThreshold
public double getFillThreshold() -
setStoreExtraFillNodes
public void setStoreExtraFillNodes(boolean storeExtraFillNodes) -
setStopFillAtThreshold
public void setStopFillAtThreshold(boolean stopFillAtThreshold) -
addSphere
-
removeSphere
-
startSholl
-
getFilledBinaryImp
public ij.ImagePlus getFilledBinaryImp() -
getFilledImp
public <T extends net.imglib2.type.numeric.RealType<T>> ij.ImagePlus getFilledImp() -
getFilledDistanceImp
public ij.ImagePlus getFilledDistanceImp() -
getFilledLabelImp
public <T extends net.imglib2.type.numeric.IntegerType<T>> ij.ImagePlus getFilledLabelImp() -
guessResamplingFactor
protected int guessResamplingFactor() -
isUIready
protected boolean isUIready() -
addFillerThread
-
initPathsToFill
-
invalidStatsError
protected <T extends net.imglib2.type.numeric.RealType<T>> boolean invalidStatsError(boolean isSecondary) -
setFillTransparent
protected void setFillTransparent(boolean transparent) -
getMinimumSeparation
public double getMinimumSeparation() -
getAverageSeparation
public double getAverageSeparation() -
getLoadedDataAsImp
public <T extends net.imglib2.type.numeric.RealType<T>> ij.ImagePlus getLoadedDataAsImp()Retrieves the pixel data of the main image currently loaded in memory as an ImagePlus object. Returned image is always a single channel image.- Returns:
- the loaded data corresponding to the C,T position currently being traced, or null if no image data has been loaded into memory.
-
getLoadedData
public <T extends net.imglib2.type.numeric.RealType<T>> net.imglib2.RandomAccessibleInterval<T> getLoadedData() -
getLoadedDataAsImg
public net.imagej.ImgPlus<?> getLoadedDataAsImg(boolean secondaryLayer) -
getLoadedIterable
public <T> net.imglib2.IterableInterval getLoadedIterable() -
getFilteredImageFile
Returns the file of the 'secondary image', if any.- Returns:
- the secondary image file, or null if no file has been set
-
isSecondaryDataAvailable
public boolean isSecondaryDataAvailable()Assesses if the 'secondary image' has been loaded into memory. Note that while some tracer Threads will load the image into memory, others may waive the loading to third party libraries- Returns:
- true, if image has been loaded into memory.
-
isSecondaryImageFileLoaded
protected boolean isSecondaryImageFileLoaded() -
isTracingOnSecondaryImageAvailable
protected boolean isTracingOnSecondaryImageAvailable() -
setSecondaryImage
Specifies the 'secondary image' to be used during a tracing session.- Parameters:
file- The file containing the 'secondary image'
-
loadSecondaryImage
Loads the 'secondary image' specified bysetSecondaryImage(File)into memory as 32-bit data.- Parameters:
file- The file to be loaded- Throws:
IOException- If image could not be loadedIllegalArgumentException- if dimensions are unexpected, or image type is not supported- See Also:
-
loadSecondaryImage
- Throws:
IllegalArgumentException
-
loadSecondaryImage
public <T extends net.imglib2.type.numeric.RealType<T>> void loadSecondaryImage(net.imglib2.RandomAccessibleInterval<T> img, boolean computeStatistics) -
setSecondaryImageMinMax
public void setSecondaryImageMinMax(double min, double max) -
getSecondaryImageMinMax
public double[] getSecondaryImageMinMax() -
loadSecondaryImage
protected void loadSecondaryImage(ij.ImagePlus imp, boolean changeUIState) -
loadSecondaryImage
protected <T extends net.imglib2.type.numeric.RealType<T>> void loadSecondaryImage(net.imglib2.RandomAccessibleInterval<T> img, boolean changeUIState, boolean computeStatistics) -
enableSecondaryLayerTracing
public void enableSecondaryLayerTracing(boolean enable) -
flushSecondaryData
public void flushSecondaryData() -
getSecondaryDataAsImp
public <T extends net.imglib2.type.numeric.NumericType<T>> ij.ImagePlus getSecondaryDataAsImp()Retrieves the 'secondary image' data currently loaded in memory as an ImagePlus object. Returned image is always of 32-bit type.- Returns:
- the loaded data or null if no image has been loaded.
- See Also:
-
getSecondaryData
public <T extends net.imglib2.type.numeric.RealType<T>> net.imglib2.RandomAccessibleInterval<T> getSecondaryData() -
getPrefs
-
proportionDone
public void proportionDone(double proportion) - Specified by:
proportionDonein interfaceHessianGenerationCallback
-
showCorrespondencesTo
Deprecated. -
setShowOnlySelectedPaths
protected void setShowOnlySelectedPaths(boolean showOnlySelectedPaths, boolean updateGUI) -
setShowOnlyActiveCTposPaths
protected void setShowOnlyActiveCTposPaths(boolean showOnlyActiveCTposPaths, boolean updateGUI) -
setShowOnlySelectedPaths
public void setShowOnlySelectedPaths(boolean showOnlySelectedPaths) -
getImagePlus
public ij.ImagePlus getImagePlus(int pane) Gets the Image associated with a view pane.- Parameters:
pane- the flag specifying the view eitherMultiDThreePanes.XY_PLANE,MultiDThreePanes.XZ_PLANEorMultiDThreePanes.ZY_PLANE.- Returns:
- the image associate with the specified view, or null if the view is
not available. If the view is XY_PLANE, and the image has been closed,
cached pixel data is returned as per
getLoadedDataAsImp()
-
error
-
showMessage
-
getTracingCanvas
protected sc.fiji.snt.InteractiveTracerCanvas getTracingCanvas() -
getActiveWindow
-
isOnlySelectedPathsVisible
public boolean isOnlySelectedPathsVisible() -
updateTracingViewers
protected void updateTracingViewers(boolean includeLegacy3Dviewer) -
updateNonTracingViewers
protected void updateNonTracingViewers() -
updateAllViewers
public void updateAllViewers() -
get3DUniverse
Deprecated.Gets the instance of the legacy 3D viewer universe. Note that the legacy 3D viewer is now deprecated.- Returns:
- a reference to the 3DUniverse or null if no universe has been set
-
set3DUniverse
protected void set3DUniverse(ij3d.Image3DUniverse universe) -
updateImageContent
Deprecated. -
setSelectedColor
-
setDeselectedColor
-
setColorImage
Deprecated. -
setPaths3DDisplay
Deprecated. -
getPaths3DDisplay
Deprecated. -
selectPath
-
getSelectedPaths
-
setPathList
-
setFillList
-
setSelectedPaths
-
findSnappingPointInXView
protected void findSnappingPointInXView(double x_in_pane, double y_in_pane, double[] point) -
clickAtMaxPoint
protected void clickAtMaxPoint(int x_in_pane, int y_in_pane, int plane, boolean join) -
showMIPOverlays
public void showMIPOverlays(double opacity) Overlays a semi-transparent MIP (8-bit scaled) of the data being traced over the tracing canvas(es). Does nothing if image is 2D. Note that with multidimensional images, only the C,T position being traced is projected.- Parameters:
opacity- (alpha), in the range 0.0-1.0, where 0.0 is none (fully transparent) and 1.0 is fully opaque. Setting opacity to zero clears previous MIPs.
-
showMIPOverlays
protected void showMIPOverlays(boolean filteredData, double opacity) -
discreteMsg
-
showCanvasWarning
Displays a timed warning (amber background) on the canvas banner.- Parameters:
msg- the warning text, ornullto clear immediatelydurationMs- how long the label stays visible (milliseconds)
-
showCanvasWarning
- See Also:
-
showCanvasInfo
Displays a timed informational message (blue background) on the canvas banner. Use for confirmations, status updates, and non-critical feedback.- Parameters:
msg- the info text, ornullto clear immediatelydurationMs- how long the label stays visible (milliseconds)
-
showCanvasInfo
- See Also:
-
getConfirmation
-
toggleSnapCursor
protected void toggleSnapCursor() -
setAnnotationsVisible
public void setAnnotationsVisible(boolean visible) Enables/Disables SNT overlays over tracing views. Note that disabling overlays will also suppress most GUI-related operations.- Parameters:
visible- whether overlays should be rendered
-
enableSnapCursor
public void enableSnapCursor(boolean enable) Enables SNT's XYZ snap cursor feature. Does nothing if no image data is available or currently loaded image is binary- Parameters:
enable- whether cursor snapping should be enabled
-
enableAutoActivation
public void enableAutoActivation(boolean enable) -
enableAutoSelectionOfFinishedPath
public void enableAutoSelectionOfFinishedPath(boolean enable) -
isTracingOnSecondaryImageActive
public boolean isTracingOnSecondaryImageActive() -
enableAstar
public void enableAstar(boolean enable) Toggles the A* search algorithm (enabled by default)- Parameters:
enable- true to enable A* search, false otherwise
-
isAstarEnabled
public boolean isAstarEnabled()Checks if A* search is enabled- Returns:
- true, if A* search is enabled, otherwise false
-
is2D
public boolean is2D()- Returns:
- true if the image currently loaded does not have a depth (Z) dimension
-
setDrawDiameters
public void setDrawDiameters(boolean draw) -
getDrawDiameters
public boolean getDrawDiameters() -
closeAndResetAllPanes
public void closeAndResetAllPanes()- Overrides:
closeAndResetAllPanesin classMultiDThreePanes
-
getContext
public org.scijava.Context getContext() -
getUI
Gets the main UI.- Returns:
- the main dialog of SNT's UI
-
showStatus
Description copied from interface:PaneOwnerShows a status message with progress information.- Specified by:
showStatusin interfacePaneOwner- Overrides:
showStatusin classMultiDThreePanes- Parameters:
progress- the current progress valuemaximum- the maximum progress valuestatus- the status message to display
-
getOneMinusErfZFudge
protected double getOneMinusErfZFudge() -
getStats
public ij.process.ImageStatistics getStats() -
getStatsSecondary
public ij.process.ImageStatistics getStatsSecondary() -
setUseSubVolumeStats
public void setUseSubVolumeStats(boolean useSubVolumeStatistics) -
getUseSubVolumeStats
public boolean getUseSubVolumeStats() -
getSearchType
-
setSearchType
-
getCostType
-
setCostType
-
getHeuristicType
-
setHeuristicType
-
getSearchImageType
-
setSearchImageType
-
getFilterType
-
setFilterType
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getDepth
public int getDepth() -
getPixelWidth
public double getPixelWidth() -
getPixelHeight
public double getPixelHeight() -
getPixelDepth
public double getPixelDepth() -
getSpacingUnits
-
getChannel
public int getChannel() -
getFrame
public int getFrame() -
captureView
Retrieves a WYSIWYG 'snapshot' of a tracing canvas.- Parameters:
view- A case-insensitive string specifying the canvas to be captured. Either "xy" (or "main"), "xz", "zy" or "3d" (for legacy's 3D Viewer).project- whether the snapshot of 3D image stacks should include its projection (MIP), or just the current plane- Returns:
- the snapshot capture of the canvas as an RGB image
- Throws:
UnsupportedOperationException- if SNT is not runningIllegalArgumentException- if view is not a recognized option
-
captureView
public ij.ImagePlus captureView(String view, org.scijava.util.ColorRGB backgroundColor) throws IllegalArgumentException Retrieves a WYSIWYG 'snapshot' of a tracing canvas without voxel data.- Parameters:
view- A case-insensitive string specifying the canvas to be captured. Either "xy" (or "main"), "xz", "zy" or "3d" (for legacy's 3D Viewer).backgroundColor- the background color of the canvas (string, hex, or html)- Returns:
- the snapshot capture of the canvas as an RGB image
- Throws:
UnsupportedOperationException- if SNT is not runningIllegalArgumentException- ifvieworbackgroundColorare not recognized
-
getCalibration
public ij.measure.Calibration getCalibration()
-