public class MarsImageUtils
extends java.lang.Object
Constructor and Description |
---|
MarsImageUtils() |
Modifier and Type | Method and Description |
---|---|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
calcR2(net.imglib2.RandomAccess<T> ra,
int radius,
Gaussian2D gauss)
This method calculates the R-squared for the 2D gaussian provided within
the radius specified for the image given as a RandomAccess.
|
static <T extends net.imglib2.type.numeric.RealType<T>> |
dogFilter(net.imglib2.RandomAccessibleInterval<T> img,
double dogFilterRadius)
This method uses the OpService to apply a Difference of Gaussian (DoG)
filter on a 2D image provided.
|
static <T extends net.imglib2.type.numeric.RealType<T>> |
dogFilter(net.imglib2.RandomAccessibleInterval<T> img,
double dogFilterRadius,
int numThreads)
This method uses the OpService to apply a Difference of Gaussian (DoG)
filter on a 2D image provided.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
findPeaks(net.imglib2.Cursor<T> cursor,
int t,
double threshold,
int minimumDistance,
boolean findNegativePeaks)
This method returned a list of peaks in the 2D image using the cursor
specified that are above the pixel value threshold specified.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
findPeaks(net.imglib2.IterableInterval<T> iterableInterval,
int t,
double threshold,
int minimumDistance,
boolean findNegativePeaks)
This method returned a list of peaks in the 2D image within the interval
and iterable interval specified that are above the pixel value threshold
specified.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
findPeaks(net.imglib2.RandomAccessible<T> img,
net.imglib2.Interval interval,
int t,
double threshold,
int minimumDistance,
boolean findNegativePeaks)
This method returned a list of peaks in the 2D image within the interval
specified that are above the pixel value threshold specified.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
fitPeaks(net.imglib2.RandomAccessible<T> img,
net.imglib2.Interval interval,
java.util.List<Peak> peaks,
int radius,
double initialSize,
boolean findNegativePeaks,
double RsquaredMin)
Given a 2D image and a list of peak positions in pixels, this function
performs subpixel 2D gaussian fitting and updates the peak positions
accordingly.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
fitPeaks(net.imglib2.RandomAccessible<T> img,
net.imglib2.Interval interval,
java.util.List<Peak> peaks,
int radius,
double initialSize,
double fitRegionThreshold,
boolean findNegativePeaks)
Given a 2D image and a list of peak positions in pixels, this function
performs subpixel 2D gaussian fitting and updates the peak positions
accordingly.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
get2DHyperSlice(net.imagej.ImgPlus<T> img,
int z,
int c,
int t)
Convenience method to retrieve a 2D view from an ImgPlus for a given z, c,
and t.
|
static java.util.List<int[]> |
innerOffsets(int innerRadius)
This method creates a list of integer x, y offsets from a central point
based on the provided radius.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
integratePeaks(net.imglib2.RandomAccessible<T> img,
net.imglib2.Interval interval,
java.util.List<Peak> peaks,
int innerRadius,
int outerRadius)
This method integrates the intensity of peaks in the 2D image provided.
|
static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> |
integratePeaks(net.imglib2.RandomAccessible<T> img,
net.imglib2.Interval interval,
java.util.List<Peak> peaks,
int innerRadius,
int outerRadius,
boolean verbose)
This method integrates the intensity of peaks in the 2D image provided.
|
static boolean |
intervalContains(net.imglib2.Interval interval,
double... location) |
static java.util.List<int[]> |
outerOffsets(int innerRadius,
int outerRadius)
This method creates a list of integer x, y offsets between the provided
inner radius and outer radius.
|
static java.util.List<Peak> |
removeNearestNeighbors(java.util.List<Peak> peaks,
int minimumDistance)
This method removes peaks from the provided list that are closer than the
minimum distance given.
|
static net.imglib2.roi.IterableRegion<net.imglib2.type.logic.BoolType> |
toIterableRegion(net.imglib2.roi.RealMask mask,
net.imglib2.Interval image)
This method converts from a RealMask to an IterableRegion
|
static net.imglib2.roi.IterableRegion<net.imglib2.type.logic.BoolType> |
toIterableRegion(net.imglib2.roi.RealMaskRealInterval roi)
This method converts from a RealMaskRealInterval to an IterableRegion
|
public static java.util.List<int[]> innerOffsets(int innerRadius)
innerRadius
- Inner integration radius.public static java.util.List<int[]> outerOffsets(int innerRadius, int outerRadius)
innerRadius
- Inner integration radius.outerRadius
- Outer integration radius.public static net.imglib2.roi.IterableRegion<net.imglib2.type.logic.BoolType> toIterableRegion(net.imglib2.roi.RealMaskRealInterval roi)
roi
- A RealMaskRealInterval represent the region of interest to
convert.public static net.imglib2.roi.IterableRegion<net.imglib2.type.logic.BoolType> toIterableRegion(net.imglib2.roi.RealMask mask, net.imglib2.Interval image)
mask
- The RealMaks representing the roi.image
- The Interval of the image.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> java.util.List<Peak> findPeaks(net.imglib2.IterableInterval<T> iterableInterval, int t, double threshold, int minimumDistance, boolean findNegativePeaks)
T
- Image type.iterableInterval
- The IterableInterval to search for peaks in the
image.t
- The T position being searched for peaks.threshold
- The pixel value threshold for peak detection.minimumDistance
- The minimum allowed distance between peaks.findNegativePeaks
- Whether to search for negative peaks.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> java.util.List<Peak> findPeaks(net.imglib2.RandomAccessible<T> img, net.imglib2.Interval interval, int t, double threshold, int minimumDistance, boolean findNegativePeaks)
T
- Image type.img
- 2D image containing peaks.interval
- The interval to search for peaks in the image.t
- The T position being searched for peaks.threshold
- The pixel value threshold for peak detection.minimumDistance
- The minimum allowed distance between peaks.findNegativePeaks
- Whether to search for negative peaks.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> java.util.List<Peak> findPeaks(net.imglib2.Cursor<T> cursor, int t, double threshold, int minimumDistance, boolean findNegativePeaks)
T
- Image type.cursor
- The cursor used to iterate through the regions of interest.t
- The T position being searched for peaks.threshold
- The pixel value threshold for peak detection.minimumDistance
- The minimum allowed distance between peaks.findNegativePeaks
- Whether to search for negative peaks.public static <T extends net.imglib2.type.numeric.RealType<T>> net.imglib2.RandomAccessibleInterval<net.imglib2.type.numeric.real.FloatType> dogFilter(net.imglib2.RandomAccessibleInterval<T> img, double dogFilterRadius)
T
- Image type.img
- 2D image that will be dog filtered.dogFilterRadius
- Radius to use for dog filtering.public static <T extends net.imglib2.type.numeric.RealType<T>> net.imglib2.RandomAccessibleInterval<net.imglib2.type.numeric.real.FloatType> dogFilter(net.imglib2.RandomAccessibleInterval<T> img, double dogFilterRadius, int numThreads)
T
- Image type.img
- 2D image that will be dog filtered.dogFilterRadius
- Radius to use for dog filtering.numThreads
- The number of threads to use.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> java.util.List<Peak> fitPeaks(net.imglib2.RandomAccessible<T> img, net.imglib2.Interval interval, java.util.List<Peak> peaks, int radius, double initialSize, boolean findNegativePeaks, double RsquaredMin)
T
- Image type.img
- 2D image containing peaks.interval
- The interval to use for peak fitting.peaks
- The list of Peaks to fit with subpixel accuracy.radius
- The radius of the square region of pixels to use for fitting.initialSize
- A starting guess for the peak size.findNegativePeaks
- Whether negative peaks are being fit.RsquaredMin
- The minimum allowed R-squared value below which fits
are rejected.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> java.util.List<Peak> fitPeaks(net.imglib2.RandomAccessible<T> img, net.imglib2.Interval interval, java.util.List<Peak> peaks, int radius, double initialSize, double fitRegionThreshold, boolean findNegativePeaks)
T
- Image type.img
- 2D image containing peaks.interval
- The interval to use for peak fitting.peaks
- The list of Peaks to fit with subpixel accuracy.radius
- The radius of the square region of pixels to use for fitting.initialSize
- A starting guess for the peak size.fitRegionThreshold
- The threshold pixel value for the region to fit.findNegativePeaks
- Whether negative peaks are being fit.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> double calcR2(net.imglib2.RandomAccess<T> ra, int radius, Gaussian2D gauss)
T
- Image type.ra
- 2D image containing peak used for the R-squared calculation.radius
- The radius of the square region used for the R-squared
calculation.gauss
- The 2D gaussian from fitting to use for the R-squared
calculation.public static java.util.List<Peak> removeNearestNeighbors(java.util.List<Peak> peaks, int minimumDistance)
peaks
- The list of peaks that nearest neighbors should be removed
from.minimumDistance
- The smallest allowed distance between peaks in
pixels.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> void integratePeaks(net.imglib2.RandomAccessible<T> img, net.imglib2.Interval interval, java.util.List<Peak> peaks, int innerRadius, int outerRadius)
T
- Image type.img
- 2D image containing peaks.interval
- The interval to mirror at the edges during integration.peaks
- The Peaks to integrate.innerRadius
- The region to integrate.outerRadius
- The outer radius of the region used to calculate the
background.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> void integratePeaks(net.imglib2.RandomAccessible<T> img, net.imglib2.Interval interval, java.util.List<Peak> peaks, int innerRadius, int outerRadius, boolean verbose)
T
- Image type.img
- 2D image containing peaks.interval
- The interval to mirror at the edges during integration.peaks
- The Peaks to integrate.innerRadius
- The region to integrate.outerRadius
- The outer radius of the region used to calculate the
background.verbose
- Whether to include all values.public static <T extends net.imglib2.type.numeric.RealType<T> & net.imglib2.type.NativeType<T>> net.imglib2.RandomAccessibleInterval<T> get2DHyperSlice(net.imagej.ImgPlus<T> img, int z, int c, int t)
T
- Image type.img
- ImgPlus provide a view from.z
- The Z axis position.c
- The C axis position.t
- The T axis position.public static boolean intervalContains(net.imglib2.Interval interval, double... location)