public class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static double |
average(double[] values) |
static float |
average(float[] values) |
static double |
averageDouble(List<Double> values) |
static float |
averageFloat(List<Float> values) |
static double[] |
createGaussianKernel1DDouble(double sigma,
boolean normalize)
This method creates a gaussian kernel
|
static double |
distance(long[] position1,
long[] position2) |
static double |
distance(RealLocalizable position1,
RealLocalizable position2) |
static boolean |
equalIterationOrder(IterableInterval<?>... intervals)
Checks whether n
IterableInterval have the same iteration order. |
static <T> T[] |
genericArray(int length) |
static double[] |
getArrayFromValue(double value,
int numDimensions) |
static float[] |
getArrayFromValue(float value,
int numDimensions) |
static int[] |
getArrayFromValue(int value,
int numDimensions) |
static long[] |
getArrayFromValue(long value,
int numDimensions) |
static <T extends NativeType<T>> |
getArrayOrCellImgFactory(Dimensions targetSize,
int targetCellSize,
T type)
|
static <T extends NativeType<T>> |
getArrayOrCellImgFactory(Dimensions targetSize,
T type)
|
static int |
getSuggestedKernelDiameter(double sigma) |
static <T,F extends Interval & RandomAccessible<T>> |
getTypeFromInterval(F rai)
Gets an instance of T from the
RandomAccessibleInterval by
querying the value at the min coordinate |
static <T,F extends RealInterval & RealRandomAccessible<T>> |
getTypeFromRealInterval(F rai)
Gets an instance of T from the
RandomAccessibleInterval by
querying the value at the min coordinate |
static double |
gLog(double z,
double c) |
static float |
gLog(float z,
float c) |
static double |
gLogInv(double w,
double c) |
static double |
gLogInv(float w,
float c) |
static long[] |
int2long(int[] i) |
static boolean |
isApproxEqual(double a,
double b,
double threshold) |
static boolean |
isApproxEqual(float a,
float b,
float threshold) |
static int |
ldu(int v)
(Hopefully) fast floor log2 of an unsigned(!) integer value.
|
static double |
log2(double value) |
static int[] |
long2int(long[] a) |
static double |
max(double[] values) |
static void |
max(double[] a,
double[] b)
Writes max(a,b) into a
|
static float |
max(List<Float> values) |
static <T extends Type<T> & Comparable<T>> |
max(T value1,
T value2) |
static double |
median(double[] values) |
static float |
median(float[] values) |
static long |
median(long[] values) |
static double |
min(double[] values) |
static void |
min(double[] a,
double[] b)
Writes min(a,b) into a
|
static float |
min(List<Float> values) |
static <T extends Type<T> & Comparable<T>> |
min(T value1,
T value2) |
static double |
percentile(double[] values,
double percentile)
Computes the percentile of a collection of doubles (percentile 0.5
roughly corresponds to median)
|
static int |
pow(int a,
int b) |
static String |
printCoordinates(boolean[] value) |
static String |
printCoordinates(double[] value) |
static String |
printCoordinates(float[] value) |
static String |
printCoordinates(int[] value) |
static String |
printCoordinates(long[] value) |
static String |
printCoordinates(RealLocalizable localizable) |
static String |
printInterval(Interval interval) |
static void |
quicksort(double[] data) |
static void |
quicksort(double[] data,
int[] sortAlso,
int left,
int right) |
static void |
quicksort(double[] data,
int left,
int right) |
static void |
quicksort(float[] data) |
static void |
quicksort(float[] data,
int left,
int right) |
static void |
quicksort(long[] data,
int left,
int right) |
static long |
round(double value) |
static int |
round(float value) |
public static <T> T[] genericArray(int length)
public static double log2(double value)
public static double[] getArrayFromValue(double value, int numDimensions)
public static float[] getArrayFromValue(float value, int numDimensions)
public static int[] getArrayFromValue(int value, int numDimensions)
public static long[] getArrayFromValue(long value, int numDimensions)
public static final double distance(RealLocalizable position1, RealLocalizable position2)
public static final double distance(long[] position1, long[] position2)
public static double percentile(double[] values, double percentile)
values
- - the valuespercentile
- - the percentile [0...1]public static float average(float[] values)
public static double average(double[] values)
public static double min(double[] values)
public static double max(double[] values)
public static long median(long[] values)
public static double median(double[] values)
public static float median(float[] values)
public static void quicksort(long[] data, int left, int right)
public static void quicksort(double[] data)
public static void quicksort(double[] data, int left, int right)
public static void quicksort(float[] data)
public static void quicksort(float[] data, int left, int right)
public static void quicksort(double[] data, int[] sortAlso, int left, int right)
public static double gLog(double z, double c)
public static float gLog(float z, float c)
public static double gLogInv(double w, double c)
public static double gLogInv(float w, float c)
public static boolean isApproxEqual(float a, float b, float threshold)
public static boolean isApproxEqual(double a, double b, double threshold)
public static int round(float value)
public static long round(double value)
public static double[] createGaussianKernel1DDouble(double sigma, boolean normalize)
sigma
- Standard Derivation of the gaussian functionnormalize
- Normalize integral of gaussian function to 1 or not...public static int getSuggestedKernelDiameter(double sigma)
public static String printCoordinates(float[] value)
public static String printCoordinates(double[] value)
public static String printCoordinates(RealLocalizable localizable)
public static String printCoordinates(int[] value)
public static String printCoordinates(long[] value)
public static String printCoordinates(boolean[] value)
public static int pow(int a, int b)
public static <T extends Type<T> & Comparable<T>> T max(T value1, T value2)
public static <T extends Type<T> & Comparable<T>> T min(T value1, T value2)
public static final int[] long2int(long[] a)
public static final long[] int2long(int[] i)
public static final <T,F extends Interval & RandomAccessible<T>> T getTypeFromInterval(F rai)
RandomAccessibleInterval
by
querying the value at the min coordinateT
- - the Trai
- - the RandomAccessibleInterval
public static final <T,F extends RealInterval & RealRandomAccessible<T>> T getTypeFromRealInterval(F rai)
RandomAccessibleInterval
by
querying the value at the min coordinateT
- - the Trai
- - the RandomAccessibleInterval
public static <T extends NativeType<T>> ImgFactory<T> getArrayOrCellImgFactory(Dimensions targetSize, T type)
ArrayImgFactory
if an image of the requested
targetSize
could be held in an ArrayImg
. Otherwise
return a CellImgFactory
with as large as possible cell size.targetSize
- size of image that the factory should be able to create.type
- type of the factory.ArrayImgFactory
or a CellImgFactory
.public static <T extends NativeType<T>> ImgFactory<T> getArrayOrCellImgFactory(Dimensions targetSize, int targetCellSize, T type)
ArrayImgFactory
if an image of the requested
targetSize
could be held in an ArrayImg
. Otherwise
return a CellImgFactory
with cell size
targetCellSize
(or as large as possible if
targetCellSize
is too large).targetSize
- size of image that the factory should be able to create.targetCellSize
- if a CellImgFactory
is created, what should be the
cell size.type
- type of the factory.ArrayImgFactory
or a CellImgFactory
.public static final int ldu(int v)
v
- unsigned integerpublic static boolean equalIterationOrder(IterableInterval<?>... intervals)
IterableInterval
have the same iteration order.public static final void min(double[] a, double[] b)
a
- b
- public static final void max(double[] a, double[] b)
a
- b
- Copyright © 2009–2017 ImgLib2. All rights reserved.