public abstract class FloatArrayUtil
extends java.lang.Object
Constructor and Description |
---|
FloatArrayUtil() |
Modifier and Type | Method and Description |
---|---|
static float[] |
add(float[] sum,
float toAdd)
Adds a constant to the first array
|
static void |
add(float[] sum,
float[] toAdd)
Adds one array to the first array
|
static float |
computeAverageIncrement(float[] array)
Computes the average increment of the array
|
static float |
computeMean(float[] array)
Computes the mean value of a given array
|
static float |
computeMean(float[] values,
int start,
int end)
computes the mean of the array "values" on the interval [start, end].
|
static float |
computeMeanSquareError(float[] x,
float[] y)
computes the mean square error of array x to array y
|
static float |
computeRootMeanSquareError(float[] x,
float[] y)
computes the root mean square error of array x to array y
|
static float |
computeSSIMArrays(float[] x,
float[] y)
computes the correlation coefficient between two arrays after Pearson
|
static float |
computeStddev(float[] array,
float mean)
Computes the standard deviation given an array and its mean value
|
static float |
computeStddev(float[] array,
float mean,
int start,
int end) |
static float |
concordanceCorrelateArrays(float[] x,
float[] y)
computes the concordance correlation coefficient between two arrays
|
static float[] |
convolve(float[] input,
float[] kernel)
Performs a 1-D convolution of the input array with the kernel array.
New array will be only of size |
static float |
correlateArrays(float[] x,
float[] y)
computes the correlation coefficient between two arrays after Pearson
|
static float |
covarianceOfArrays(float[] x,
float[] y)
computes the covariance between two arrays
|
static float[] |
divide(float[] array,
float divident)
Divides all entries of array by divident.
|
static float[] |
divide(float[] array,
float[] divident)
Divides all entries of the two arrays element by element.
Works in place and overwrites array. |
static void |
exp(float[] array)
Uses Math.exp() on all elements of the array
Works in place and overwrites array.
|
static int |
findClosestIndex(float x,
float[] array)
returns the closest index in the array to the given value
|
static void |
forceSymmetryComplexDoubleArray(float[] array)
Forces an complex float array to be symmetric.
|
static void |
forceSymmetryRealArray(float[] array)
Forces a real float array to be symmetric.
|
static float[] |
gaussianFilter(float[] weights,
float sigma)
Gaussian smoothing of the elements of the array "weights"
|
static boolean |
isNaN(float[] array)
tests if any of the values in the given array is NaN
|
static void |
log(float[] array)
Uses Math.log() on all elements of the array
Works in place and overwrites array.
|
static float[] |
meanFilter(float[] weights,
int context)
Performs mean filtering of the array.
|
static float[] |
min(float[] array,
float min) |
static float[] |
minAndMaxOfArray(float[] array)
Returns the minimal and the maximal value in a given array
|
static float |
minOfArray(float[] array)
Returns the minimal value in a given array
|
static float[] |
multiply(float[] array,
float factor)
Multiplies all entries of array by factor.
|
static void |
multiply(float[] array,
float[] array2)
Multiplies all entries of the two arrays element by element.
Works in place and overwrites array. |
static float[] |
pow(float[] array,
float exp)
calls Math.pow for each element of the array
|
static void |
print(float[] array)
Prints the array on standard out.
|
static void |
print(float[] array,
java.text.NumberFormat nf)
Prints the contents of the float array on standard out.
|
static void |
print(java.lang.String name,
float[] array)
Prints the array on standard out.
|
static void |
print(java.lang.String name,
float[] array,
java.text.NumberFormat nf)
Prints the array on standard out and denotes the arrays name.
|
static void |
removeOutliers(float[] weights,
float threshold)
Removes outliers from the array which differ more than threshold from the last value.
|
static void |
saveForVisualization(int imageNumber,
float[] array)
Stores an array for later visualization at index imageNumber
|
static void |
suppressCenter(float[] weights,
int threshold) |
static java.lang.String |
toString(float[] array)
Converts the array to a String representation.
|
static java.lang.String |
toString(float[] array,
java.lang.String delimiter)
Converts the array to a String representation.
|
static ij.ImagePlus |
visualizeBufferedArrays(java.lang.String title)
Displays the arrays stored with "saveForVisualization" as ImagePlus.
|
public static void saveForVisualization(int imageNumber, float[] array)
imageNumber
- the numberarray
- the arraypublic static float[] convolve(float[] input, float[] kernel)
output.lenght = input.length - (2 * (kernel.length/2));(Note that integer arithmetic is used here)
input
- the array to be convolvedkernel
- the kernelpublic static ij.ImagePlus visualizeBufferedArrays(java.lang.String title)
title
- the title of the ImagePlussaveForVisualization(int imageNumber, float [] array)
public static void forceSymmetryComplexDoubleArray(float[] array)
array
- the complex arraypublic static boolean isNaN(float[] array)
array
- public static void forceSymmetryRealArray(float[] array)
array
- the real arraypublic static int findClosestIndex(float x, float[] array)
x
- the valuearray
- the arraypublic static float covarianceOfArrays(float[] x, float[] y)
x
- the one arrayy
- the other arraypublic static float correlateArrays(float[] x, float[] y)
x
- the one arrayy
- the other arraypublic static float computeSSIMArrays(float[] x, float[] y)
x
- the one arrayy
- the other arraypublic static float concordanceCorrelateArrays(float[] x, float[] y)
x
- the one arrayy
- the other arraypublic static float computeMeanSquareError(float[] x, float[] y)
x
- the one arrayy
- the other arraypublic static float computeRootMeanSquareError(float[] x, float[] y)
x
- the one arrayy
- the other arraypublic static void suppressCenter(float[] weights, int threshold)
public static void removeOutliers(float[] weights, float threshold)
weights
- the weightthreshold
- the thresholdpublic static float computeMean(float[] values, int start, int end)
values
- the arraystart
- the start indexend
- the end indexpublic static float computeAverageIncrement(float[] array)
array
- the arraypublic static float[] meanFilter(float[] weights, int context)
weights
- the arraycontext
- the context to be used for smoothing (from -context/2 to context/2)public static float[] gaussianFilter(float[] weights, float sigma)
weights
- the arraysigma
- the standard deviationpublic static float computeStddev(float[] array, float mean)
array
- the arraymean
- the mean value of the arraypublic static float computeStddev(float[] array, float mean, int start, int end)
public static float computeMean(float[] array)
array
- the arraypublic static float[] minAndMaxOfArray(float[] array)
array
- the arraypublic static float minOfArray(float[] array)
array
- the arraypublic static void add(float[] sum, float[] toAdd)
sum
- the first arraytoAdd
- the array to addpublic static float[] add(float[] sum, float toAdd)
sum
- the first arraytoAdd
- the constant to addpublic static float[] divide(float[] array, float divident)
array
- the arraydivident
- the number used for division.public static float[] multiply(float[] array, float factor)
array
- the arrayfactor
- the number used for multiplication.public static void multiply(float[] array, float[] array2)
array
- the arrayarray2
- the other array.public static void exp(float[] array)
array
- the arraypublic static float[] divide(float[] array, float[] divident)
array
- the arraydivident
- the other array.public static void log(float[] array)
array
- the arraypublic static void print(float[] array, java.text.NumberFormat nf)
array
- nf
- the NumberFormatpublic static void print(java.lang.String name, float[] array, java.text.NumberFormat nf)
name
- the namearray
- the arraynf
- the number formatpublic static void print(java.lang.String name, float[] array)
name
- the namearray
- the arraypublic static void print(float[] array)
array
- the arraypublic static float[] pow(float[] array, float exp)
array
- exp
- the exponent.public static float[] min(float[] array, float min)
public static java.lang.String toString(float[] array)
array
- the arraytoString(float[],String)
public static java.lang.String toString(float[] array, java.lang.String delimiter)
array
- the arraydelimiter
- the delimiter