Package sc.fiji.snt.plugin
Class BinaryTracerFileCmd
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.BinaryTracerCommonCmd
sc.fiji.snt.plugin.BinaryTracerFileCmd
- 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
Non-interactive command for batch
BinaryTracer
autotracing of all images in a directory. Each image is processed independently
and traced trees are exported to disk as SWC files.
Failures on individual images are logged but do not abort the batch. ROI-based root detection is supported when images contain embedded ROIs (e.g., from TIFF headers).
- Author:
- Tiago Ferreira
- See Also:
-
Field Summary
Fields inherited from class sc.fiji.snt.plugin.BinaryTracerCommonCmd
abortRun, afterTracingChoice, chosenMaskImp, connectComponents, cullSingleNodePaths, debugMode, ensureMaskImgVisibleOnAbort, headless, impMap, inputDir, lengthThreshold, loopSolvingChoice, maskImgFileBeingProcessed, maxConnectDist, originalImgChoice, pruneByLength, ROI_AUTO_DETECT, ROI_CENTROID, ROI_CENTROID_WEIGHTED, ROI_CONTAINED, ROI_EDGE, ROI_UNSET, roiPlane, rootChoiceFields 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 TypeMethodDescriptionprotected voidprotected voidhandleTracedTrees(List<Tree> trees) Called after tracing completes with valid trees.protected booleanReturns whether this command operates in file mode (loading images from file paths) or in image-choice mode (selecting from open images).voidrun()protected booleanvalidateBeforeTracing(ij.gui.Roi roi, boolean inferRootFromRoi, boolean isSame, boolean isSegmented, boolean isValidOrigImg, boolean isSameDim, boolean isCompatible, boolean isValidConnectDist, boolean isValidRoi) Validates configuration before tracing begins.Methods inherited from class sc.fiji.snt.plugin.BinaryTracerCommonCmd
assignRoiZPosition, cancel, cancel, confirmIfNotSegmented, createAndConfigureConverter, getRoi, getRootStrategy, info, initForFile, initForImage, isSegmented, noImgError, pruneModeToString, runCommand, setPruneModeMethods inherited from class sc.fiji.snt.gui.cmds.CommonDynamicCmd
getPromptWithCloseHandler, getPromptWithCloseHandler, init, isCanceled, msg, notifyExternalDataLoaded, notifyLoadingEnd, notifyLoadingStart, resetUI, resetUI, resetUI, 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
-
Constructor Details
-
BinaryTracerFileCmd
public BinaryTracerFileCmd()
-
-
Method Details
-
isFileMode
protected boolean isFileMode()Description copied from class:BinaryTracerCommonCmdReturns whether this command operates in file mode (loading images from file paths) or in image-choice mode (selecting from open images).- Specified by:
isFileModein classBinaryTracerCommonCmd- Returns:
truefor file-based operation,falsefor choice-widget operation
-
run
public void run()- Specified by:
runin interfaceorg.scijava.module.MutableModule- Specified by:
runin interfaceRunnable- Overrides:
runin classCommonDynamicCmd
-
error
- Overrides:
errorin classBinaryTracerCommonCmd
-
validateBeforeTracing
protected boolean validateBeforeTracing(ij.gui.Roi roi, boolean inferRootFromRoi, boolean isSame, boolean isSegmented, boolean isValidOrigImg, boolean isSameDim, boolean isCompatible, boolean isValidConnectDist, boolean isValidRoi) Description copied from class:BinaryTracerCommonCmdValidates configuration before tracing begins. The default (non-interactive) implementation logs warnings and adjusts flags as needed without prompting the user. Interactive subclasses may override this to display a confirmation dialog.This method may modify
BinaryTracerCommonCmd.connectComponentsandBinaryTracerCommonCmd.ensureMaskImgVisibleOnAbortdirectly.- Overrides:
validateBeforeTracingin classBinaryTracerCommonCmd- Parameters:
roi- the active ROI (may benull)inferRootFromRoi- whether root inference from ROI is requestedisSame- whether mask and original image are the sameisSegmented- whether the mask image is binary/thresholdedisValidOrigImg- whether the original image path is validisSameDim- whether mask and original share dimensionsisCompatible- whether images share spatial calibrationisValidConnectDist- whether the max connection distance is validisValidRoi- whether the ROI is a valid area ROI- Returns:
trueto proceed with tracing,falseto abort
-
handleTracedTrees
Description copied from class:BinaryTracerCommonCmdCalled after tracing completes with valid trees. The default implementation honorsBinaryTracerCommonCmd.afterTracingChoice: optionally replaces existing paths, assigns colors (per-tree "dim" palette when proofreading, inter-tree otherwise), adds trees via PathAndFillManager, and optionally calibrates the Curation Manager for proofreading. Subclasses may override to export trees to disk or adopt the mask image as tracing canvas.- Overrides:
handleTracedTreesin classBinaryTracerCommonCmd- Parameters:
trees- the traced trees (guaranteed non-null and non-empty)
-