Package gov.nih.mipav.model.algorithms
Class AlgorithmTextureAnalysis
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.AlgorithmTextureAnalysis
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.WindowListener
,java.lang.Runnable
,java.util.EventListener
public class AlgorithmTextureAnalysis extends AlgorithmBase
Overview This code contains the texture analysis functions for the paper `Texture Analysis and Segmentation Using Modulation Features, Generative Models, and Weighted Curve Evolution', by I. Kokkinos, G. Evangelopoulos and P. Maragos, appearing in IEEE Transactions on Pattern Analysis and Machine Intelligence, Volume 31, Issue 1, Jan. 2009 Page(s):142 - 157. This toolbox was originally developed in and written for MATLAB, with emphasis on efficient algorithm implementations for multiband image filtering, demodulation in amplitude (AM) and frequency (FM) signals via the regularized 2D discrete energy separation algorithm and probabilistic localization of texture, edge, smooth image regions. Author of the original MATLAB toolbox is Iasonas Kokkinos, currently Assistant Professor at Ecole Centrale Paris, with partial contributions from Georgios Evangelopoulos. The original MATLAB toolbox has been ported from MATLAB to Java by William Gandler. The original MATLAB toolbox can be found at http://cvsp.cs.ntua.gr/software/texture/. Permission to port the original code was generously granted by Iasonas Kokkinos. The provided functions include: multi-scale & orientation filterbanks for gabors and edges projection on the basis elements of the underlying generative models demodulation with regularized/complex esa channel selection based on the amplitude/teager/mdl criterion texture/edge/smooth classification based on mdl criterion Parameters are primarily related to the filterbank construction and the final classification stage. References: 1.) I. Kokkinos, G. Evangelopoulos and P. Maragos, Texture Analysis and Segmentation using Modulation Features, Generative Models and Weighted Curve Evolution, IEEE Transactions on Pattern Analysis & Machine Intelligence, vol. 31, no. 1, pp. 142-157, Jan. 2009. 2.) G. Evangelopoulos, I. Kokkinos and P. Maragos, Advances in Variational Image Segmentation using AM-FM Models: Regularized Demodulation and Probabilistic Cue Integration, Proc. Int' l Workshop on Variational and Level Set Methods (VLSM-05), Beijing, China, Oct. 2005, Springer LNCS, vol. 3275, pp. 121-136. 3.) I. Kokkinos, G. Evangelopoulos and P. Maragos, Advances in Texture Analysis: Energy Dominant Component and Multiple Hypothesis Testing, Proc. IEEE Int' l Conf. on Image Processing (ICIP-04), Singapore, Oct. 2004, vol. 3, pp. 1509-1512. 4.) I. Kokkinos, G. Evangelopoulos and P. Maragos, Modulation-Feature Based Textured Image Segmentation Using Curve Evolution, Proc. IEEE Int' l Conf. on Image Processing (ICIP-04), Singapore, Oct. 2004, vol. 2, pp. 1204-1207.
-
-
Field Summary
Fields Modifier and Type Field Description private ModelImage[]
destImage
private boolean
displayFilters
private ModelImage
edgetd2Image
private ModelImage
edgetd3Image
private double
epsilon
private ModelImage
gImage
private boolean
scaleImage
private ModelImage
texttd2Image
private ModelImage
texttd3Image
-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description AlgorithmTextureAnalysis(ModelImage[] destImage, ModelImage srcImage, boolean scaleImage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double[]
conv(double[] A, double[] B, double[] Cout)
private void
conv2(double[][] A, double[][] B, double[][] Cout)
private double[][]
deriv_x_left(double[][] buf)
private double[][]
deriv_x_right(double[][] buf)
private double[][]
deriv_y_down(double[][] buf)
private double[][]
deriv_y_up(double[][] buf)
private double[][]
enop2D(double[][] im)
private void
fftshift(double[][] mtx)
private void
filter2(double[][] A, double[][] B, double[][] C)
private void
filterbank_DCA_2D(double[][] omegas, double[][] amplitudes, double[] filterAngle, double[] sigmaX, int nscales, java.lang.String filterType, int ndirs, double sig2omega, double radianStart, double radianEnd)
private void
freqz2(double[][] hout, double[][] houtImag, double[][] a, int n1, int n2)
private void
ifft2(double[][] buf, double[][] bufI)
private void
ifftshift(double[][] mtx)
private void
rot180(double[][] mtx)
void
runAlgorithm()
Starts the program.private void
T1_responses(double[][] omegas, double[][] amplitudes, double[] filterAngle, double[] sigmaX, double[][][] td1, double[][][] td2, double[][][] td3, double[][][] td22, double[][][] td23, double[][][] td33, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, double[] sigmas, int[] ps, int nscales, int ndirs, double sig2omega, double radianStart, double radianEnd, int inputXDim, int inputYDim, java.lang.String filterType, java.lang.String[] domain)
private void
T1z2_get_filter_struct(double[][][] td1, double[][][] td2, double[][][] td3, double[][][] td22, double[][][] td23, double[][][] td33, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX, java.lang.String domain, double[][] xfreq, double[][] yfreq, int index)
private void
T1z2a_convert_filter(double[] omegasOut, double[] amplitudesOut, double[] amplitudesOutImag, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX, int conj)
private double[][]
T1z2b_time_resp(double[] omegas, double[] amplitudes, double[] amplitudesImag, double filterAngle, double sigmaX)
private void
T2z0_projection_terms(double[][][][][] invDes, double[][][] td1, double[][][] td2, double[][][] td3, double[][][] td22, double[][][] td23, double[][][] td33, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, int[] ps, int nscales, int ndirs, java.lang.String[] filtDomain, ModelImage inputImage)
private double[][][][]
T2z0a_invert_design(double[][] Sc1, double[][] Sc2, double[][] Sc3, double[][] Sc22, double[][] Sc23, double[][] Sc33)
private void
T2z1_filter(double[][] A, double[][] ph, double[][] Fx, double[][] Fy, int[][] idx, double[][] en, double[][] critDCA, double[][] omegas, double[][] amplitudes, double[] filterAngle, double[] sigmaX, double[][][] td1, double[][][] td2, double[][][] td3, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, int[] ps, java.lang.String[] domain, int[] scaleswt, int ndirs, ModelImage inputImage, double[][][][][] invDes, java.lang.String DCAmethod, java.lang.String esameth, double[] sgx, double invVariance2, double factorSharpness, double factorMdl)
private void
T2z1a_make_image_structure(double[] fftImagePatch, double[] fftImagePatchImag, double[] fftSupportPatch, double[] fftSupportPatchImag, double[][] input, int patchSize)
private void
T2z1b_get_responses_freq(double[][] preComputedIc1, double[][] preComputedIc2, double[][] preComputedIc3, double[][] preComputedSc1, double[][] preComputedsm, double[][] Sc1, double[][] Sc2, double[][] Sc3, double[][] Sc22, double[][] Sc23, double[][] Sc33, double[] fftSupportPatch, double[] fftSupportPatchImag, int patchSize, double[] fftImagePatch, double[] fftImagePatchImag, double[][] fd1, double[][] fd1Imag, double[][] fd2, double[][] fd2Imag, double[][] fd3, double[][] fd3Imag, double[][] fd22, double[][] fd22Imag, double[][] fd23, double[][] fd23Imag, double[][] fd33, double[][] fd33Imag, int findNorm)
private void
T2z1b_get_responses_time(double[][] preComputedIc1, double[][] preComputedIc2, double[][] preComputedIc3, double[][] preComputedSc1, double[][] preComputedsm, double[][] Sc1, double[][] Sc2, double[][] Sc3, double[][] Sc22, double[][] Sc23, double[][] Sc33, double[][] td1, double[][] td2, double[][] td3, double[][] td22, double[][] td23, double[][] td33, double[][] inputIm, int findNorm)
private void
T2z1d_esa2D(double[][] A, double[][] Wx, double[][] Wy, double[][] freqr, double[][] Anonorm, double[][] Eo, double[][] imInSrc, double[][] imInSrcImag, int signChange, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX, double ct, int diffType)
private void
T2z1dI_get_responses_freq_gabor(double[][] Fx, double[][] FxImag, double[][] Fy, double[][] FyImag, double[][] Fxx, double[][] FxxImag, double[][] Fyy, double[][] FyyImag, double[][] Fxy, double[][] FxyImag, double[][] V2Fx, double[][] V2FxImag, double[][] V2Fy, double[][] V2FyImag, double[][] imIn, double[][] imInImag, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX)
private void
test_T2z0a_invert_design()
private void
testconv2()
private void
testfreqz2()
private void
Tzz_freq_resp(double[][] hout, double[][] omegax, double[][] omegay, double sigmaX, double filterAngle, double[] omegas, double[] amplitudes)
-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
destImage
private ModelImage[] destImage
-
scaleImage
private final boolean scaleImage
-
epsilon
private final double epsilon
-
displayFilters
private boolean displayFilters
-
texttd2Image
private ModelImage texttd2Image
-
texttd3Image
private ModelImage texttd3Image
-
edgetd2Image
private ModelImage edgetd2Image
-
edgetd3Image
private ModelImage edgetd3Image
-
gImage
private ModelImage gImage
-
-
Constructor Detail
-
AlgorithmTextureAnalysis
public AlgorithmTextureAnalysis(ModelImage[] destImage, ModelImage srcImage, boolean scaleImage)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Starts the program.- Specified by:
runAlgorithm
in classAlgorithmBase
-
T2z1_filter
private void T2z1_filter(double[][] A, double[][] ph, double[][] Fx, double[][] Fy, int[][] idx, double[][] en, double[][] critDCA, double[][] omegas, double[][] amplitudes, double[] filterAngle, double[] sigmaX, double[][][] td1, double[][][] td2, double[][][] td3, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, int[] ps, java.lang.String[] domain, int[] scaleswt, int ndirs, ModelImage inputImage, double[][][][][] invDes, java.lang.String DCAmethod, java.lang.String esameth, double[] sgx, double invVariance2, double factorSharpness, double factorMdl)
-
T2z1d_esa2D
private void T2z1d_esa2D(double[][] A, double[][] Wx, double[][] Wy, double[][] freqr, double[][] Anonorm, double[][] Eo, double[][] imInSrc, double[][] imInSrcImag, int signChange, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX, double ct, int diffType)
-
enop2D
private double[][] enop2D(double[][] im)
-
deriv_x_right
private double[][] deriv_x_right(double[][] buf)
-
deriv_x_left
private double[][] deriv_x_left(double[][] buf)
-
deriv_y_up
private double[][] deriv_y_up(double[][] buf)
-
deriv_y_down
private double[][] deriv_y_down(double[][] buf)
-
T2z1dI_get_responses_freq_gabor
private void T2z1dI_get_responses_freq_gabor(double[][] Fx, double[][] FxImag, double[][] Fy, double[][] FyImag, double[][] Fxx, double[][] FxxImag, double[][] Fyy, double[][] FyyImag, double[][] Fxy, double[][] FxyImag, double[][] V2Fx, double[][] V2FxImag, double[][] V2Fy, double[][] V2FyImag, double[][] imIn, double[][] imInImag, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX)
-
ifft2
private void ifft2(double[][] buf, double[][] bufI)
-
T2z0_projection_terms
private void T2z0_projection_terms(double[][][][][] invDes, double[][][] td1, double[][][] td2, double[][][] td3, double[][][] td22, double[][][] td23, double[][][] td33, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, int[] ps, int nscales, int ndirs, java.lang.String[] filtDomain, ModelImage inputImage)
-
test_T2z0a_invert_design
private void test_T2z0a_invert_design()
-
T2z0a_invert_design
private double[][][][] T2z0a_invert_design(double[][] Sc1, double[][] Sc2, double[][] Sc3, double[][] Sc22, double[][] Sc23, double[][] Sc33)
-
T2z1b_get_responses_time
private void T2z1b_get_responses_time(double[][] preComputedIc1, double[][] preComputedIc2, double[][] preComputedIc3, double[][] preComputedSc1, double[][] preComputedsm, double[][] Sc1, double[][] Sc2, double[][] Sc3, double[][] Sc22, double[][] Sc23, double[][] Sc33, double[][] td1, double[][] td2, double[][] td3, double[][] td22, double[][] td23, double[][] td33, double[][] inputIm, int findNorm)
-
filter2
private void filter2(double[][] A, double[][] B, double[][] C)
-
testconv2
private void testconv2()
-
conv2
private void conv2(double[][] A, double[][] B, double[][] Cout)
-
conv
private double[] conv(double[] A, double[] B, double[] Cout)
-
T2z1b_get_responses_freq
private void T2z1b_get_responses_freq(double[][] preComputedIc1, double[][] preComputedIc2, double[][] preComputedIc3, double[][] preComputedSc1, double[][] preComputedsm, double[][] Sc1, double[][] Sc2, double[][] Sc3, double[][] Sc22, double[][] Sc23, double[][] Sc33, double[] fftSupportPatch, double[] fftSupportPatchImag, int patchSize, double[] fftImagePatch, double[] fftImagePatchImag, double[][] fd1, double[][] fd1Imag, double[][] fd2, double[][] fd2Imag, double[][] fd3, double[][] fd3Imag, double[][] fd22, double[][] fd22Imag, double[][] fd23, double[][] fd23Imag, double[][] fd33, double[][] fd33Imag, int findNorm)
-
fftshift
private void fftshift(double[][] mtx)
-
ifftshift
private void ifftshift(double[][] mtx)
-
T2z1a_make_image_structure
private void T2z1a_make_image_structure(double[] fftImagePatch, double[] fftImagePatchImag, double[] fftSupportPatch, double[] fftSupportPatchImag, double[][] input, int patchSize)
-
T1_responses
private void T1_responses(double[][] omegas, double[][] amplitudes, double[] filterAngle, double[] sigmaX, double[][][] td1, double[][][] td2, double[][][] td3, double[][][] td22, double[][][] td23, double[][][] td33, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, double[] sigmas, int[] ps, int nscales, int ndirs, double sig2omega, double radianStart, double radianEnd, int inputXDim, int inputYDim, java.lang.String filterType, java.lang.String[] domain)
-
T1z2_get_filter_struct
private void T1z2_get_filter_struct(double[][][] td1, double[][][] td2, double[][][] td3, double[][][] td22, double[][][] td23, double[][][] td33, double[][][] fd1, double[][][] fd1Imag, double[][][] fd2, double[][][] fd2Imag, double[][][] fd3, double[][][] fd3Imag, double[][][] fd22, double[][][] fd22Imag, double[][][] fd23, double[][][] fd23Imag, double[][][] fd33, double[][][] fd33Imag, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX, java.lang.String domain, double[][] xfreq, double[][] yfreq, int index)
-
Tzz_freq_resp
private void Tzz_freq_resp(double[][] hout, double[][] omegax, double[][] omegay, double sigmaX, double filterAngle, double[] omegas, double[] amplitudes)
-
testfreqz2
private void testfreqz2()
-
freqz2
private void freqz2(double[][] hout, double[][] houtImag, double[][] a, int n1, int n2)
-
rot180
private void rot180(double[][] mtx)
-
T1z2b_time_resp
private double[][] T1z2b_time_resp(double[] omegas, double[] amplitudes, double[] amplitudesImag, double filterAngle, double sigmaX)
-
T1z2a_convert_filter
private void T1z2a_convert_filter(double[] omegasOut, double[] amplitudesOut, double[] amplitudesOutImag, double[] omegas, double[] amplitudes, double filterAngle, double sigmaX, int conj)
-
filterbank_DCA_2D
private void filterbank_DCA_2D(double[][] omegas, double[][] amplitudes, double[] filterAngle, double[] sigmaX, int nscales, java.lang.String filterType, int ndirs, double sig2omega, double radianStart, double radianEnd)
-
-