Package sc.fiji.snt.plugin
Class GWDTTracerCommonCmd
java.lang.Object
org.scijava.module.AbstractModule
org.scijava.module.DefaultMutableModule
org.scijava.command.DynamicCommand
sc.fiji.snt.gui.cmds.CommonDynamicCmd
sc.fiji.snt.plugin.GWDTTracerCommonCmd
- All Implemented Interfaces:
Runnable,org.scijava.Cancelable,org.scijava.command.Command,org.scijava.Contextual,org.scijava.module.Module,org.scijava.module.MutableModule,org.scijava.plugin.SciJavaPlugin
- Direct Known Subclasses:
AutotraceFromSeedsCmd,AutotraceFromTipsCmd,AutotraceFromWaypointsCmd,GWDTMultiSomaCommonCmd,GWDTTracerCmd,GWDTTracerFileCmd
Base command providing shared parameters and logic for GWDT autotracing.
Subclassed by
GWDTTracerCmd (interactive, image already loaded) and
GWDTTracerFileCmd (non-interactive, file-based).- Author:
- Tiago Ferreira
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected doubleprotected doubleprotected net.imagej.ImgPlus<?> protected booleanprotected Stringprotected Fileprotected doubleprotected StringFields inherited from class sc.fiji.snt.gui.cmds.CommonDynamicCmd
EMPTY_LABEL, HEADER_HTML, snt, sntService, statusService, ui, uiServiceFields inherited from class org.scijava.command.DynamicCommand
moduleService, pluginService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected booleanconfigureSecondaryScoreMap(AbstractGWDTTracer<?> tracer) Hook for configuring the tracer's score map from a user-supplied secondary image.protected AbstractGWDTTracer<?> createAndConfigureTracer(net.imagej.ImgPlus<?> img) Creates and configures a tracer from the shared GUI parameters.protected voidprotected net.imagej.ImgPlus<?> protected voidhandleTracedTrees(List<Tree> trees) Called after tracing completes with valid trees.protected voidprotected voidprotected abstract booleanprotected voidprotected voidprotected voidToggles visibility of secondary-image inputs that are only relevant whenscoreMapFilter == SCORE_MAP_OTHER.Methods inherited from class sc.fiji.snt.gui.cmds.CommonDynamicCmd
cancel, getPromptWithCloseHandler, getPromptWithCloseHandler, init, isCanceled, msg, notifyExternalDataLoaded, notifyLoadingEnd, notifyLoadingStart, resetUI, resetUI, resetUI, run, statusMethods inherited from class org.scijava.command.DynamicCommand
context, getCancelReason, getContext, getInfo, getInput, getOutput, saveInputs, setContext, setInput, setOutput, uncancelMethods inherited from class org.scijava.module.AbstractModule
getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, unresolveInput, unresolveOutputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.scijava.module.Module
getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, isResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, setResolved, unresolveInput, unresolveOutputMethods inherited from interface org.scijava.module.MutableModule
addInput, addInput, addOutput, addOutput, removeInput, removeOutput
-
Field Details
-
imgChoice
-
imgFileChoice
-
backgroundThreshold
protected double backgroundThreshold -
scoreMapFilter
-
lengthThreshold
protected double lengthThreshold -
branchTuneMaxAngle
protected double branchTuneMaxAngle -
debugMode
protected boolean debugMode -
abortRun
protected boolean abortRun -
chosenImp
protected net.imagej.ImgPlus<?> chosenImp
-
-
Constructor Details
-
GWDTTracerCommonCmd
public GWDTTracerCommonCmd()
-
-
Method Details
-
scoreMapFilterCallback
protected void scoreMapFilterCallback()Toggles visibility of secondary-image inputs that are only relevant whenscoreMapFilter == SCORE_MAP_OTHER. The base implementation handles anysecondaryImageSuffixinput declared by subclasses; subclasses may override to control additional related inputs. Safe to call when the input is not declared (no-op in that case). -
initForImage
protected void initForImage() -
initForFile
protected void initForFile() -
createAndConfigureTracer
Creates and configures a tracer from the shared GUI parameters. Returnsnullif configuration failed (e.g., missing secondary image for score map).- Parameters:
img- the image to trace- Returns:
- configured tracer, or null on error
-
configureSecondaryScoreMap
Hook for configuring the tracer's score map from a user-supplied secondary image. Invoked only whenscoreMapFilter == SCORE_MAP_OTHER.Default implementation pulls from
SNT.getSecondaryData()(the secondary layer currently loaded in the GUI) and aborts the command viaerror(String)if none is available.Subclasses may override to source the secondary from disk (or elsewhere) and may choose to handle missing/incompatible inputs gracefully by disabling score mapping (
tracer.setScoreMapEnabled(false)) and returningtrueso tracing proceeds without it.- Parameters:
tracer- the tracer being configured- Returns:
trueto continue (score map configured, or gracefully disabled);falseto abort the command
-
runCommand
protected void runCommand() -
handleTracedTrees
Called after tracing completes with valid trees. The default implementation loads trees into PathAndFillManager and optionally triggers proofreading. Subclasses (e.g.,GWDTTracerFileCmd) may override to export trees to disk instead.- Parameters:
trees- the traced trees (guaranteed non-empty)
-
isFileMode
protected abstract boolean isFileMode() -
getImgFromImgChoice
protected net.imagej.ImgPlus<?> getImgFromImgChoice() -
noValidImgError
protected void noValidImgError() -
cancel
- Specified by:
cancelin interfaceorg.scijava.Cancelable- Overrides:
cancelin classCommonDynamicCmd
-
error
- Overrides:
errorin classCommonDynamicCmd
-