Package sc.fiji.snt.tracing
Class SearchThread
java.lang.Object
sc.fiji.snt.tracing.AbstractSearch
sc.fiji.snt.tracing.SearchThread
- All Implemented Interfaces:
Runnable,SearchInterface
- Direct Known Subclasses:
FillerThread,TracerThread
Implements a common thread that explores the image using a variety of
strategies, e.g., to trace tubular structures or surfaces.
- Author:
- Mark Longair, Tiago Ferreira, Cameron Arshadi
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final byteprotected longstatic final byteprotected longprotected final Coststatic final String[]protected intstatic final byteprotected longprotected longprotected longprotected SearchImageStack<DefaultSearchNode> protected SearchImageStack<DefaultSearchNode> static final byteprotected org.jheaps.AddressableHeap<DefaultSearchNode, Void> static final bytestatic final intstatic final intprotected longstatic final intstatic final intprotected final booleanFields inherited from class sc.fiji.snt.tracing.AbstractSearch
img, imgAccess, imgDepth, imgHeight, imgWidth, neighborDistances, progressListeners, reportEveryMilliseconds, spacing_units, timeoutSeconds, xMax, xMin, xSep, yMax, yMin, ySep, zMax, zMin, zSep -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSearchThread(net.imagej.Dataset dataset, boolean bidirectional, boolean definedGoal, int timeoutSeconds, long reportEveryMilliseconds, SNT.SearchImageType searchImageType, Cost costFunction) protectedSearchThread(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> image, ij.measure.Calibration calibration, boolean bidirectional, boolean definedGoal, int timeoutSeconds, long reportEveryMilliseconds, SNT.SearchImageType searchImageType, Cost costFunction) protectedSearchThread(SNT snt, net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> image, Cost costFunction) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNode(DefaultSearchNode n, boolean fromStart) voidaddProgressListener(SearchProgressCallback callback) Registers a callback to receive progress updates during the search.protected booleanatGoal(int x, int y, int z, boolean fromStart) protected booleancreateNewNode(int x, int y, int z, double g, double h, DefaultSearchNode predecessor, byte searchStatus) protected voidintlongReturns the total number of points evaluated so far during the search.voidPrints the current search status to the log.voidreportFinished(boolean success) protected voidvoidrun()Methods inherited from class sc.fiji.snt.tracing.AbstractSearch
precomputeNeighborDistancesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface sc.fiji.snt.tracing.SearchInterface
getResult
-
Field Details
-
OPEN_FROM_START
public static final byte OPEN_FROM_START- See Also:
-
CLOSED_FROM_START
public static final byte CLOSED_FROM_START- See Also:
-
OPEN_FROM_GOAL
public static final byte OPEN_FROM_GOAL- See Also:
-
CLOSED_FROM_GOAL
public static final byte CLOSED_FROM_GOAL- See Also:
-
FREE
public static final byte FREE- See Also:
-
SUCCESS
public static final int SUCCESS- See Also:
-
CANCELLED
public static final int CANCELLED- See Also:
-
TIMED_OUT
public static final int TIMED_OUT- See Also:
-
POINTS_EXHAUSTED
public static final int POINTS_EXHAUSTED- See Also:
-
OUT_OF_MEMORY
public static final int OUT_OF_MEMORY- See Also:
-
EXIT_REASONS_STRINGS
-
costFunction
-
open_from_start
-
closed_from_start_count
protected long closed_from_start_count -
closed_from_goal_count
protected long closed_from_goal_count -
nodes_as_image_from_start
-
nodes_as_image_from_goal
-
exitReason
protected int exitReason -
verbose
protected final boolean verbose -
started_at
protected long started_at -
loops
protected long loops -
loops_at_last_report
protected long loops_at_last_report -
lastReportMilliseconds
protected long lastReportMilliseconds
-
-
Constructor Details
-
SearchThread
protected SearchThread(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> image, ij.measure.Calibration calibration, boolean bidirectional, boolean definedGoal, int timeoutSeconds, long reportEveryMilliseconds, SNT.SearchImageType searchImageType, Cost costFunction) -
SearchThread
protected SearchThread(net.imagej.Dataset dataset, boolean bidirectional, boolean definedGoal, int timeoutSeconds, long reportEveryMilliseconds, SNT.SearchImageType searchImageType, Cost costFunction) -
SearchThread
-
-
Method Details
-
reportPointsInSearch
protected void reportPointsInSearch()- Specified by:
reportPointsInSearchin classAbstractSearch
-
pointsConsideredInSearch
public long pointsConsideredInSearch()Description copied from class:AbstractSearchReturns the total number of points evaluated so far during the search.- Specified by:
pointsConsideredInSearchin classAbstractSearch
-
createNewNode
public DefaultSearchNode createNewNode(int x, int y, int z, double g, double h, DefaultSearchNode predecessor, byte searchStatus) -
foundGoal
-
atGoal
protected boolean atGoal(int x, int y, int z, boolean fromStart) -
addProgressListener
Description copied from class:AbstractSearchRegisters a callback to receive progress updates during the search.- Specified by:
addProgressListenerin classAbstractSearch
-
reportFinished
public void reportFinished(boolean success) -
printStatus
public void printStatus()Description copied from class:AbstractSearchPrints the current search status to the log.- Specified by:
printStatusin classAbstractSearch
-
checkStatus
protected boolean checkStatus() -
run
public void run() -
getExitReason
public int getExitReason() -
addNode
-
getNodesAsImageFromStart
-
getNodesAsImageFromGoal
-