public class MaskUtils extends Object
Constructor and Description |
---|
MaskUtils() |
Modifier and Type | Method and Description |
---|---|
static List<double[]> |
douglasPeucker(List<double[]> list,
double epsilon)
Given a curve composed of line segments find a similar curve with fewer
points.
|
static <R extends IntegerType<R>> |
fromLabeling(ImgLabeling<Integer,R> labeling,
Interval interval,
double[] calibration)
Creates spots from a label image.
|
static <R extends IntegerType<R>,S extends NumericType<S>> |
fromLabelingWithROI(ImgLabeling<Integer,R> labeling,
Interval interval,
double[] calibration,
boolean simplify,
RandomAccessibleInterval<S> qualityImage)
Creates spots with ROIs from a 2D label image.
|
static <T extends RealType<T>> |
fromThreshold(RandomAccessible<T> input,
Interval interval,
double[] calibration,
double threshold,
int numThreads)
Creates spots from a grayscale image, thresholded to create a mask.
|
static <T extends RealType<T>,R extends RealType<R>> |
fromThreshold(RandomAccessible<T> input,
Interval interval,
double[] calibration,
double threshold,
int numThreads,
RandomAccessibleInterval<R> qualityImage)
Creates spots from a grayscale image, thresholded to create a mask.
|
static <T extends RealType<T>,S extends NumericType<S>> |
fromThresholdWithROI(RandomAccessible<T> input,
Interval interval,
double[] calibration,
double threshold,
boolean simplify,
int numThreads,
RandomAccessibleInterval<S> qualityImage)
Creates spots with their ROIs from a 2D grayscale image,
thresholded to create a mask.
|
static long |
getThreshold(Histogram1d<?> hist) |
static Iterator<Integer> |
labelGenerator()
Start at 1.
|
static <T extends RealType<T>> |
otsuThreshold(RandomAccessibleInterval<T> img) |
static PolygonRoi |
simplify(PolygonRoi roi,
double smoothInterval,
double epsilon) |
static <T extends RealType<T>> |
toLabeling(RandomAccessible<T> input,
Interval interval,
double threshold,
int numThreads)
Creates a zero-min label image from a thresholded input image.
|
public static final <T extends RealType<T>> double otsuThreshold(RandomAccessibleInterval<T> img)
public static final long getThreshold(Histogram1d<?> hist)
public static final <T extends RealType<T>> ImgLabeling<Integer,IntType> toLabeling(RandomAccessible<T> input, Interval interval, double threshold, int numThreads)
T
- the type of the input image. Must be real, scalar.input
- the input image.interval
- the interval in the input image to analyze.threshold
- the threshold to apply to the input image.numThreads
- how many threads to use for multithreaded computation.public static <T extends RealType<T>> List<Spot> fromThreshold(RandomAccessible<T> input, Interval interval, double[] calibration, double threshold, int numThreads)
T
- the type of the input image. Must be real, scalar.input
- the input image.interval
- the interval in the input image to analyze.calibration
- the physical calibration.threshold
- the threshold to apply to the input image.numThreads
- how many threads to use for multithreaded computation.public static <R extends IntegerType<R>> List<Spot> fromLabeling(ImgLabeling<Integer,R> labeling, Interval interval, double[] calibration)
R
- the type that backs-up the labeling.labeling
- the labeling, must be zero-min.interval
- the interval, used to reposition the spots from the zero-min
labeling to the proper coordinates.calibration
- the physical calibration.public static <T extends RealType<T>,R extends RealType<R>> List<Spot> fromThreshold(RandomAccessible<T> input, Interval interval, double[] calibration, double threshold, int numThreads, RandomAccessibleInterval<R> qualityImage)
T
- the type of the input image. Must be real, scalar.input
- the input image.interval
- the interval in the input image to analyze.calibration
- the physical calibration.threshold
- the threshold to apply to the input image.numThreads
- how many threads to use for multithreaded computation.qualityImage
- the image in which to read the quality value.public static final <T extends RealType<T>,S extends NumericType<S>> List<Spot> fromThresholdWithROI(RandomAccessible<T> input, Interval interval, double[] calibration, double threshold, boolean simplify, int numThreads, RandomAccessibleInterval<S> qualityImage)
T
- the type of the input image. Must be real, scalar.S
- the type of the quality image. Must be real, scalar.input
- the input image. Must be 2D.interval
- the interval in the input image to analyze.calibration
- the physical calibration.threshold
- the threshold to apply to the input image.simplify
- if true
the polygon will be post-processed to be
smoother and contain less points.numThreads
- how many threads to use for multithreaded computation.qualityImage
- the image in which to read the quality value.public static <R extends IntegerType<R>,S extends NumericType<S>> List<Spot> fromLabelingWithROI(ImgLabeling<Integer,R> labeling, Interval interval, double[] calibration, boolean simplify, RandomAccessibleInterval<S> qualityImage)
R
- the type that backs-up the labeling.S
- the type of the quality image. Must be real, scalar.labeling
- the labeling, must be zero-min and 2D..interval
- the interval, used to reposition the spots from the zero-min
labeling to the proper coordinates.calibration
- the physical calibration.simplify
- if true
the polygon will be post-processed to be
smoother and contain less points.qualityImage
- the image in which to read the quality value.public static final List<double[]> douglasPeucker(List<double[]> list, double epsilon)
The Ramer–Douglas–Peucker algorithm (RDP) is an algorithm for reducing the number of points in a curve that is approximated by a series of points.
list
- List of Double[] points (x,y)epsilon
- Distance dimensionpublic static final PolygonRoi simplify(PolygonRoi roi, double smoothInterval, double epsilon)
Copyright © 2015–2021 Fiji. All rights reserved.