Login  Register

Re: 1D autocorrelation function

Posted by Michael Schmid on May 14, 2009; 8:19am
URL: http://imagej.273.s1.nabble.com/1D-autocorrelation-function-tp3692494p3692500.html

Hi Larry,

if it is simply the radial distribution function that you are  
interested in you can try my macro
   http://imagejdocu.tudor.lu/doku.php?
id=macro:radial_distribution_function

It needs about half a minute (2.4 GHz Core2Duo) and 500 MB RAM for a  
2048*2048 binary image.
It uses the FFT, but does not assume periodic boundary conditions.  
Instead, it rather expands the image (in this case to 4096*4096) and  
corrects for the finite size (edge effects) of the image. So you need  
not (and should not) expand your image when using it.
---
Concerning the r resulution: For radii well above 1, there should be  
enough pixels in each zone between r and r+0.3 pixels. My macro  
simply uses the Radial Profile Plugin, which uses increments of 1 for  
the radius.
http://rsb.info.nih.gov/ij/plugins/radial-profile.html

It would be interesting to see how the results of my macro compare  
with the plugin by Dscho; if you find any significant differences or  
a bug in my macro, let me know, please.

Michael
________________________________________________________________

On 13 May 2009, at 22:47, Larry Anovitz wrote:

> Hi,
>     A few weeks back, Gabriel was kind enough to send me the  
> suggestion
> below in response to my question about a plug-in to calculate 2-point
> correlation functions.
>     Having been working with this plug-in for a few weeks now, I  
> have run
> into a couple of problems, and one query, which I hope someone can  
> help me
> solve.
>     The biggest problem is memory.  Running this plug-in takes a  
> lot.  If I
> have a 1024 x 1024 pixel image I can get it to solve if I set the  
> memory to
> 2 GB,  If I have a 2048 x 2048 image I have not yet gotten the  
> program to
> work.  Instead, it comes back with a window saying that it has used  
> up the
> available memory (I've used values as high as 4 GB, and downloaded the
> newest version of ImageJ for the Mac this afternoon). While I have  
> tried
> down-sampling the image, and this works, it does not give me the  
> resolution
> I would like, and I need to keep the overall image size large to  
> avoid edge
> effects (I'd like to go to a 4096 x 4096 image at least).
>     The second problem is that the "naïve" computation version of  
> the plug
> in does not seem to work at all.  The pop-up window does say that  
> this is
> slow, but I've left if for hours without any results.
>     Finally, a question.  The plug-in has a default radius step  
> (changeable)
> of 0.3 pixels. Since this is (obviously) less than 1 pixel, and the
> correlation has to do with the relationship between pixels, this  
> seems a bit
> odd.  I suspect it may be due to the FFT method of obtaining the
> calculation, but am not sure, and was wondering if Dsho (who wrote the
> plug-in) could enlighten me.
>
>     Many thanks in advance for help with this.
>
> --Larry
>
> I am running a Mac, with system version 10.5.6, a 2 x 3.2 GHz Quad-
> Core
> Intel Xeon processor, and 6 GB of 800 MHz DDR2 FB-DIMM memory.
>
> --Larry Anovitz
>
>
> --
> 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/6/09 10:46 AM, "Gabriel Landini" <[hidden email]> wrote:
>
>> Larry,
>> Are you sure you do not mean the "two-point correlation function"?  
>> That is a
>> commonly used technique in condensed matter physics (I have seen  
>> it several
>> times used to characterise fractal agglormerates and porous  
>> materials).
>>
>> Dsho wrote a plugin some time ago. I have not used it, though:
>>
>> http://wbgn013.biozentrum.uni-wuerzburg.de/ImageJ/two-point- 
>> correlation.html
>>
>> Cheers,
>>
>> G.