public class DetectionUtils extends Object
| Constructor and Description |
|---|
DetectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <R extends RealType<R> & NativeType<R>> |
applyMedianFilter(RandomAccessibleInterval<R> image)
Apply a simple 3x3 median filter to the target image.
|
static <T extends RealType<T>> |
copyToFloatImg(RandomAccessible<T> img,
Interval interval,
ImgFactory<FloatType> factory)
Copy an interval of the specified source image on a float image.
|
static Img<FloatType> |
createLoGKernel(double radius,
int nDims,
double[] calibration)
Creates a laplacian of gaussian (LoG) kernel tuned for blobs with a
radius specified using calibrated units.
|
static List<Spot> |
findLocalMaxima(RandomAccessibleInterval<FloatType> source,
double threshold,
double[] calibration,
double radius,
boolean doSubPixelLocalization,
int numThreads) |
static boolean |
is2D(ij.ImagePlus imp) |
static boolean |
is2D(ImgPlus<?> img)
Returns
true if the specified image is 2D. |
static <T extends Type<T>> |
prepareFrameImg(ImgPlus<T> img,
int channel,
int frame)
Return a view of the specified input image, at the specified channel
(0-based) and the specified frame (0-based too).
|
static void |
preview(Model model,
Settings settings,
SpotDetectorFactoryBase<?> detectorFactory,
Map<String,Object> detectorSettings,
int frame,
Logger logger,
Consumer<Boolean> buttonEnabler)
Preview a detection results.
|
static Interval |
squeeze(Interval interval)
Returns a new
Interval, built by squeezing out singleton
dimensions from the specified interval. |
public static final void preview(Model model, Settings settings, SpotDetectorFactoryBase<?> detectorFactory, Map<String,Object> detectorSettings, int frame, Logger logger, Consumer<Boolean> buttonEnabler)
This method returns immediately and execute the detection in a separate thread. It executes the detection in one frame only and writes the results in the specified model object.
model - the model to write detection results in.settings - the settings to use for the image input and the ROI input.detectorFactory - the detector factory to use for detection.detectorSettings - the settings for the detection, specific to the detector
factory/frame - the frame (0-based) to execute the detection in.logger - a logger to write results and error messages to.buttonEnabler - a consumer that will receive false at the
beginning of the preview, and true at its end.
Can be used to disable GUI elements.public static final boolean is2D(ImgPlus<?> img)
true if the specified image is 2D. It can have
multiple channels and multiple time-points; this method only looks at
whether several Z-slices can be found.img - the image.true if the image is 2D, regardless of time and
channel.public static final boolean is2D(ij.ImagePlus imp)
public static final Img<FloatType> createLoGKernel(double radius, int nDims, double[] calibration)
radius - the blob radius (in image unit).nDims - the dimensionality of the desired kernel. Must be 1, 2 or 3.calibration - the pixel sizes, specified as double[] array.public static final <T extends RealType<T>> Img<FloatType> copyToFloatImg(RandomAccessible<T> img, Interval interval, ImgFactory<FloatType> factory)
img - the source image.interval - the interval in the source image to copy.factory - a factory used to build the float image.public static final Interval squeeze(Interval interval)
Interval, built by squeezing out singleton
dimensions from the specified interval.interval - the interval to squeeze.public static final <R extends RealType<R> & NativeType<R>> Img<R> applyMedianFilter(RandomAccessibleInterval<R> image)
public static final List<Spot> findLocalMaxima(RandomAccessibleInterval<FloatType> source, double threshold, double[] calibration, double radius, boolean doSubPixelLocalization, int numThreads)
public static final <T extends Type<T>> RandomAccessibleInterval<T> prepareFrameImg(ImgPlus<T> img, int channel, int frame)
T - the type of the input image.img - the input image.channel - the channel to extract.frame - the frame to extract.Copyright © 2015–2021 Fiji. All rights reserved.