|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.rsl.konrad.utils.FFTUtil
public abstract class FFTUtil
This class is a wrapper for the FFT as implemented in JTransforms.
Constructor Summary | |
---|---|
FFTUtil()
|
Method Summary | |
---|---|
static double |
abs(int pos,
double[] array)
Computes the absolute value of the complex number at position pos in the array |
static double |
abs(int posx,
int posy,
double[][] array)
Computes the absolute values of the complex number at posx, posy in the 2D array array. |
static ij.process.ImageProcessor |
apply2DFilter(ij.process.ImageProcessor imp,
ij.process.ImageProcessor filter)
Applies a 2D filter to the an ImageProcessor |
static ij.process.ImageProcessor |
applyRampFilter_ECC(ij.process.ImageProcessor imp,
RampFilter ramp)
Applies a ramp filter to the an ImageProcessor |
static double[] |
applyRampFilter(double[] detectorRow,
RampFilter ramp)
Applies a ramp filter to the a detector row |
static ij.process.ImageProcessor |
applyRampFilter(ij.process.ImageProcessor imp,
RampFilter ramp)
Applies a ramp filter to the an ImageProcessor |
static double[] |
complexOneOverPiT(int width)
|
static double[] |
complexSignum(double[] array)
Computes the complex signum for the given array. |
static void |
copyRampFilter(ij.ImagePlus projections,
ij.ImagePlus filteredProjections,
double threshold,
double percent,
boolean meanFilter,
boolean showStatus)
|
static double[] |
cSignum(double[] array)
Computes the signum for the given complex array. |
static double[] |
discreteHilbertTransfrom(double[] array,
int nTimes)
|
static double[] |
divideAbsolute(double[] one,
double[] two)
Divides two arrays of complex numbers. |
static double[] |
divideComplex(double realOne,
double imagOne,
double realTwo,
double imagTwo)
Divides two complex values |
static ij.process.FloatProcessor |
estimate2DFilter(ij.ImagePlus filteredProjections,
ij.ImagePlus projections,
double threshold,
boolean showStatus)
Estimates a 2-D filter given two stacks of projections |
static double[] |
estimateFilter(ij.process.ImageProcessor after,
ij.process.ImageProcessor before,
double threshold,
boolean meanSquare)
Estimates the applied ramp filter given an input and an output image. |
static ij.process.FloatProcessor |
estimateFilter2D(ij.process.ImageProcessor before,
ij.process.ImageProcessor after,
double threshold)
Estimates the applied filter given an input and an output image. |
static double[] |
exactFiniteHilbertTransform(double[] array,
int nTimes)
Exact finite discrete Hilbert transformation after Kak SC. |
static double[] |
fft(double[] array)
|
static double[][] |
fftshift(double[][] data,
boolean bComplex,
boolean bSign)
shift zero frequency to center, or vice verse, 2D. |
static double[] |
fftshift(double[] data,
boolean bComplex,
boolean bSign)
shift zero frequency to center, or vice verse, 1D. |
static float[][] |
fftshift(float[][] data,
boolean bComplex,
boolean bSign)
shift zero frequency to center, or vice verse, 2D. |
static float[] |
fftshift(float[] data,
boolean bComplex,
boolean bSign)
shift zero frequency to center, or vice verse, 1D. |
static void |
GetLowandHighPassImage(float[][] data,
float[][] LowPassFilter,
float[][] HighPassFilter,
float[][] LowPassImage,
float[][] HighPassImage)
Get Lowpass and HighPass Images for "real" image using "real" filters |
static int |
getNextPowerOfTwo(int value)
Returns the next power of 2 given a certain integer value Code was partially taken from ij.plugin.FFT.java::pad(). |
static ij.process.ImageProcessor |
getPowerSpectrum(ij.process.ImageProcessor imp)
Returns the 2D power spectrum of a given image processor. |
static double[] |
hilbertKernel(int width)
|
static double[] |
hilbertTransform(double[] array,
int nTimes)
Computes the 1-D Hilbert Transform of the given Array. |
static void |
init1DFFT(int width)
|
static double[] |
invertRampFilter(double[] filter,
double max)
Estimates an inverse of a Ramp Filter. |
static double[] |
lowPassFilterRealDoubleArray(double[] array,
int cutOffIndex)
low pass filters the given array. |
static double[] |
multiplyAbsolute(double[] one,
double[] two)
Multiplies two arrays of complex numbers. |
static double[] |
multiplyComplex(double[] one,
double[] two)
Multiplies two arrays of complex numbers pairwise |
static double[] |
multiplyComplex(double realOne,
double imagOne,
double realTwo,
double imagTwo)
Multiplies two complex values |
static void |
printAbsolute(double[] array)
Prints the absolute values in the given array |
static void |
printComplex(double[] array)
Prints the complex values in the given array. |
static double[] |
recoverFilter(ij.ImagePlus projections,
ij.ImagePlus filteredProjections,
double threshold,
boolean showStatus)
|
static ij.process.ImageProcessor |
removeRampFilter(ij.process.ImageProcessor imp,
RampFilter ramp,
double max)
Removes a ramp filter from the ImageProcessor. |
static void |
timesComplexNumber(double[] array,
double realOne,
double imagOne)
Multiplies the array with the complex number defined as two double values; |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FFTUtil()
Method Detail |
---|
public static void init1DFFT(int width)
public static double[] fft(double[] array)
public static void copyRampFilter(ij.ImagePlus projections, ij.ImagePlus filteredProjections, double threshold, double percent, boolean meanFilter, boolean showStatus) throws java.lang.Exception
java.lang.Exception
public static double[] recoverFilter(ij.ImagePlus projections, ij.ImagePlus filteredProjections, double threshold, boolean showStatus) throws java.lang.Exception
java.lang.Exception
public static double[] complexSignum(double[] array)
array
- the arraypublic static double[] cSignum(double[] array)
array
- the arraypublic static void timesComplexNumber(double[] array, double realOne, double imagOne)
array
- the arrayrealOne
- the real part of the complex numberimagOne
- the imaginary part of the complex numberpublic static double[] complexOneOverPiT(int width)
public static double[] hilbertKernel(int width)
public static double[] hilbertTransform(double[] array, int nTimes)
array
- the arraynTimes
- the size of the zero padding:n = 1 zero pad to next power of 2 n = 2 zero pad to 2 times the next power of 2
public static double[] discreteHilbertTransfrom(double[] array, int nTimes)
public static double[] exactFiniteHilbertTransform(double[] array, int nTimes)
array
- the ArraynTimes
- Approximation for infinity
public static double[] invertRampFilter(double[] filter, double max)
filter
- the filtermax
- the maximal scaling (1.0 is a good number)
public static ij.process.ImageProcessor removeRampFilter(ij.process.ImageProcessor imp, RampFilter ramp, double max)
imp
- the filtered ImageProcessorramp
- the rampmax
- the maximum for the inverted ramp filter. (try 1.0)
public static double[] lowPassFilterRealDoubleArray(double[] array, int cutOffIndex)
array
- the real double arraycutOffIndex
- the index to start cutting
public static ij.process.ImageProcessor applyRampFilter_ECC(ij.process.ImageProcessor imp, RampFilter ramp)
imp
- the ImageProcessor to be filteredramp
- the ramp
public static ij.process.ImageProcessor applyRampFilter(ij.process.ImageProcessor imp, RampFilter ramp)
imp
- the ImageProcessor to be filteredramp
- the ramp
public static double[] applyRampFilter(double[] detectorRow, RampFilter ramp)
detectorRow
- the rowramp
- the ramp
public static ij.process.ImageProcessor apply2DFilter(ij.process.ImageProcessor imp, ij.process.ImageProcessor filter)
imp
- the ImageProcessor to be filteredfilter
- the filter
public static double[] divideComplex(double realOne, double imagOne, double realTwo, double imagTwo)
realOne
- real part oneimagOne
- imaginary part onerealTwo
- real part twoimagTwo
- imaginary part two
public static double[] divideAbsolute(double[] one, double[] two)
one
- the first arraytwo
- the second array
public static double[] multiplyComplex(double realOne, double imagOne, double realTwo, double imagTwo)
realOne
- real part oneimagOne
- imaginary part onerealTwo
- real part twoimagTwo
- imaginary part two
public static double[] multiplyComplex(double[] one, double[] two)
one
- the first arraytwo
- the second array
public static double[] multiplyAbsolute(double[] one, double[] two)
one
- the first arraytwo
- the second array
public static double[] fftshift(double[] data, boolean bComplex, boolean bSign)
data
- the double data to be shiftedbComplex
- true: complex; false: realbSign
- true: fftshift; false: ifftshift
public static float[] fftshift(float[] data, boolean bComplex, boolean bSign)
data
- the float data to be shiftedbComplex
- true: complex; false: realbSign
- true: fftshift; false: ifftshift
public static double[][] fftshift(double[][] data, boolean bComplex, boolean bSign)
data
- the double data to be shiftedbComplex
- true: complex; false: realbSign
- true: fftshift; false: ifftshift
public static float[][] fftshift(float[][] data, boolean bComplex, boolean bSign)
data
- the double data to be shiftedbComplex
- true: complex; false: realbSign
- true: fftshift; false: ifftshift
public static void GetLowandHighPassImage(float[][] data, float[][] LowPassFilter, float[][] HighPassFilter, float[][] LowPassImage, float[][] HighPassImage)
data
- image in realLowPassFilter
- Low pass filter in realHighPassFilter
- High pass filter in realLowPassImage
- Low pass image in realHighPassImage
- High Pass image in realpublic static ij.process.ImageProcessor getPowerSpectrum(ij.process.ImageProcessor imp)
imp
- the ImageProcessor
public static int getNextPowerOfTwo(int value)
value
- the input number.
public static ij.process.FloatProcessor estimate2DFilter(ij.ImagePlus filteredProjections, ij.ImagePlus projections, double threshold, boolean showStatus) throws java.lang.Exception
filteredProjections
- the projection data after filteringprojections
- the projection data before filteringthreshold
- a threshold for outliers (40.0 is not bad)showStatus
- report progress status to ImageJ
java.lang.Exception
- may happenpublic static ij.process.FloatProcessor estimateFilter2D(ij.process.ImageProcessor before, ij.process.ImageProcessor after, double threshold) throws java.lang.Exception
before
- the input imageafter
- the output imagethreshold
- the maximal value which may appear in the estimate. (to avoid outliers.)
java.lang.Exception
- may occur.public static double[] estimateFilter(ij.process.ImageProcessor after, ij.process.ImageProcessor before, double threshold, boolean meanSquare) throws java.lang.Exception
after
- the output imagebefore
- the input image
java.lang.Exception
- may occur.public static double abs(int pos, double[] array)
pos
- the positionarray
- the array which contains the values
public static double abs(int posx, int posy, double[][] array)
posx
- x positionposy
- y positionarray
- the array
public static void printAbsolute(double[] array)
array
- the array of complex valuespublic static void printComplex(double[] array)
array
- the array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |