T
- the type of the source. Must extend RealType
and
NativeType
to use with most TrackMate SpotDetector
s.public abstract class AbstractSemiAutoTracker<T extends RealType<T> & NativeType<T>> extends Object implements Algorithm, MultiThreaded
The user has to select one spot, one a meaningful location. The spot location
and its radius are then used to extract a small rectangular neighborhood in
the next frame around the spot. The neighborhood is then passed to a
SpotDetector
that returns the spot it found. If a spot of
Spot.QUALITY
high enough is found near enough to the first spot
center, then it is added to the model and linked with the first spot.
The process is then repeated, taking the newly found spot as a source for the next neighborhood. The model is updated live for every spot found.
The process halts when:
Modifier and Type | Class and Description |
---|---|
static class |
AbstractSemiAutoTracker.SearchRegion<R>
A utility class made to return the information on a neighborhood
generated from a source around a
Spot . |
Modifier and Type | Field and Description |
---|---|
protected static String |
BASE_ERROR_MESSAGE |
protected double |
distanceTolerance
How close must be the new spot found to be accepted, in radius units.
|
protected String |
errorMessage |
protected Logger |
logger |
protected static double |
NEIGHBORHOOD_FACTOR
Minimal size of neighborhoods, in spot diameter units.
|
protected boolean |
ok |
protected double |
qualityThreshold
The fraction of the initial quality above which we keep new spots.
|
Constructor and Description |
---|
AbstractSemiAutoTracker(Model model,
SelectionModel selectionModel,
Logger logger) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkInput() |
protected SpotDetector<T> |
createDetector(RandomAccessible<T> img,
Interval interval,
double[] calibration,
double radius,
double quality)
Returns a new instance of a
SpotDetector that will inspect the
neighborhood. |
protected abstract void |
exposeSpot(Spot newSpot,
Spot previousSpot)
This method is a hook for subclassers.
|
String |
getErrorMessage() |
protected abstract AbstractSemiAutoTracker.SearchRegion<T> |
getNeighborhood(Spot spot,
int frame)
Returns a small neighborhood around the specified spot, but taken at the
specified frame.
|
int |
getNumThreads() |
boolean |
process() |
void |
processSpot(Spot initialSpot)
Recursively investigates a neighborhood to find the most likely successor
of a spot, starting with the specified spot and operating recursively.
|
void |
setNumThreads() |
void |
setNumThreads(int numThreads) |
void |
setParameters(double qualityThreshold,
double distanceTolerance,
int nFrames)
Configures this semi-automatic tracker.
|
protected static final double NEIGHBORHOOD_FACTOR
protected static final String BASE_ERROR_MESSAGE
protected String errorMessage
protected boolean ok
protected final Logger logger
protected double distanceTolerance
protected double qualityThreshold
public AbstractSemiAutoTracker(Model model, SelectionModel selectionModel, Logger logger)
public void setParameters(double qualityThreshold, double distanceTolerance, int nFrames)
qualityThreshold
- the fraction of the initial quality above which we keep new
spots. The highest, the more intolerant.distanceTolerance
- how close must be the new spot found to be accepted, in radius
units.nFrames
- how many frames at most we track. Set it to 0 or negative to
go as far as possible.public void processSpot(Spot initialSpot)
Model
given at construction and
linked to the previous spot, until:
initialSpot
- the spot to start detection with.protected abstract void exposeSpot(Spot newSpot, Spot previousSpot)
Model
. This method allows concrete
implementation to add some specific post-treatment to detected spots.newSpot
- the spot that just has been found by the detection mechanism.previousSpot
- the spot in the previous frame whose neighborhood has been
investigated to find the new spot. Already part of the model.protected abstract AbstractSemiAutoTracker.SearchRegion<T> getNeighborhood(Spot spot, int frame)
Implementations can return null
if for instance, the number
of time frames in the raw source has been exhausted, or if the specified
spot misses some information. This will be dealt with gracefully in the
process()
method.
spot
- the spot the desired neighborhood is centered on.frame
- the frame in the source image the desired neighborhood as to
be taken.AbstractSemiAutoTracker.SearchRegion
. Concrete
implementations have to specify the neighborhood location and
calibration, so that the found spots can have their coordinates
put back in the raw source coordinate system.protected SpotDetector<T> createDetector(RandomAccessible<T> img, Interval interval, double[] calibration, double radius, double quality)
SpotDetector
that will inspect the
neighborhood.img
- the source image.interval
- defines the neighborhood to inspect.calibration
- the pixel sizes to convert pixel coordinates into image
coordinates.radius
- the expected spot radius.quality
- the quality threshold below which found spots will be
discarded.SpotDetector
.public boolean checkInput()
checkInput
in interface Algorithm
public String getErrorMessage()
getErrorMessage
in interface Algorithm
public void setNumThreads()
setNumThreads
in interface MultiThreaded
public void setNumThreads(int numThreads)
setNumThreads
in interface MultiThreaded
public int getNumThreads()
getNumThreads
in interface MultiThreaded
Copyright © 2015–2021 Fiji. All rights reserved.