Re: 1D autocorrelation function

Posted by Michael Schmid on
URL: http://imagej.273.s1.nabble.com/1D-autocorrelation-function-tp3692494p3692506.html

Hi Larry,

ok, so what you need is related to the Radial Distribution Function  
(RDF).

For the correlation of the pair distribution of particle *centers* (H-
H or O-O in the water example) you can use my RDF plugin - it was  
somewhere in this mailing list, but I have uploaded it now to the  
documentation wiki:
   http://imagejdocu.tudor.lu/doku.php?
id=macro:radial_distribution_function.

For the correlation, simply scale your binary image (it must be  
square) to a size of 2^n*2^n and use Process>FFT>FD Math for  
correlation (both inputs are the same, and check "do inverse  
transform"). You need holes/particles that are much smaller than the  
image size, otherwise the periodic boundary conditions inherent to  
any FFT function will limit the accuracy.

Then normalize the result: divide the image by the pixel value at  
size/2, size/2, and you will get the correlation between equal  
pixels. Use the Radial_Profile plugin from the ImageJ web site if  
only the distance is important (i.e., if you have an isotropic sample).

The correlation between unequal pairs is 1 minus the correlation  
between equal pairs.

Michael
________________________________________________________________

On 6 Apr 2009, at 15:35, Larry Anovitz wrote:

> HI
>     The correlation function is not a projection of the image.
> Rather, it is a measure of the spatial distribution of, and within
> particles in it.  It is sometimes called a pair distribution function
> Or a radial distribution function. You may have seen these in various
> types of computation chemistry or X-ray measurements where one plots
> concentration as a function of distance, and there a peaks in the  
> curves
> That correspond to, say, in water, the average H-H, O-H and O-O  
> distances.
> In this case of a sample with pore space, this gives the  
> correlations of
> distances within a given pore, and between pores.
>
> Summarizing from Ioannidis et al (I tried to attach it, just fyi,  
> in case my
> description is not clear enough, but the system won't let me.  
> Please contact
> Me directly at the address below, and I'll forward the paper if  
> anyone needs
> it)
>
> 1) let's describe the binary image by a phase function (Z(r)),  
> which takes
> the values zero or one, depending on whether what pixel is white (a  
> grain)
> or black (a pore)
>
> 2)The structure of a statistically homogeneous medium can be  
> described by
> the first two statistical moments of this function, the porosity (f) -
> actually phi, but I've no idea how to put such symbols in an e-
> mail, and the
> Autocorrelation function R(u) these are given by the averages <>
>
> F = <Z(r)>
>
> R(u) = ( <Z(r) - f>•<Z(r+u)-f> )/ abs(f - f^2)
>
> So what does all this mean for a plugin programmer and a two-
> dimensional
> image
>
> One first calculates f for the image
> Then one starts at the first pixel (0,0) and finds its Z(r) value and,
> Or each of the other pixels relative to that one, finds the  
> distance (u),
> The Z(r) value for the second pixel (called Z(r+u) above, and  
> calculates
> The value of R.  One does this for all pairs of pixels in the  
> image, and
> sums the results for each value of (u) to get R(u).  (I'm not 100%  
> sure, but
> I think Ioannidis et al. only actually do this along x-and y-
> directions from
> each pixel, not radially)
>
> Does this make any sense ? Can anyone help ?
>
> --larry
>
> --
> Dr. Lawrence M. Anovitz
> MS 6110 PO Box 2008
> Aqueous and Geochemistry Group
> Oak Ridge National Laboratory
> Oak Ridge, Tennessee 37831-6110
>
> 865-574-5034 : phone
> 865-574-4961 : fax
>
> [hidden email]
>
>
>
>
>
> On 4/4/09 7:58 AM, "Gluender" <[hidden email]> wrote:
>
>> Larry,
>>
>> without reading the papers (not my job)...
>>
>> Could you please explain what happens with the second coordinate of
>> an image during the 1-D autocorrelation? Is the image projected in
>> one direction or is the desired result a series of 1-D
>> autocorrelation functions?
>>
>> As far as I know imagej does'nt provide neither 1-D
>> Fourier-transformation nor 1-D autocorrelation which in general is
>> computed by Fourier-retransformation of the power spectrum.
>>
>> However there are numerous applications for data/signal analyses that
>> allow the computation of both, autocorrelation and power spectrum of
>> 1-D signals. Hence you may export the 1-D data from imagej to one of
>> these applications and then perform the desired computations.
>>
>>
>>> Hi
>>>   I am looking for a plug-in for ImageJ that will calculate the 1-D
>>> autocorrelation function from a binary image.
>>>
>>> As per
>>>
>>> Journal of Petroleum Science and Engineering 16 (1996) 251-261
>>> Statistical analysis of the porous microstructure as a method for
>>> estimating reservoir permeability
>>> M.A. Ioannidis, M.J. Kwiecien, I. Chatzis
>>>
>>> A fourier transform of this curve will then be used to extend my  
>>> neutron
>>> scattering data to
>>> Lower Q values as per
>>
>> Because the Fourier transform of the autocorrelation function is the
>> power spectrum, I don't quite grasp why the latter isn't directly
>> computed, but I think I'm missing some essential information that you
>> may perhaps kindly provide.
>>
>>> Radlinski et al. (2004) Angstron-to-millimeter characterization of
>>> sedimentary rock microstructure.
>>> J Colloid and Interface Sci. 247, 607-612.
>>>
>>> Can anyone suggest what the correct  plug-in might be ?
>>> Thanks.
>>>
>>> --Larry
>>> --
>>> Dr. Lawrence M. Anovitz
>>> MS 6110 PO Box 2008
>>> Aqueous and Geochemistry Group
>>> Oak Ridge National Laboratory
>>> Oak Ridge, Tennessee 37831-6110
>>>
>>> 865-574-5034 : phone
>>> 865-574-4961 : fax
>>>
>>> [hidden email]
>>
>> HTH