This program is no longer available as an isolated program but it can be accessed through ctf_estimate_from_micrograph
This program takes a Xmipp image obtained from a electron microscope, computes an spectral estimation of its CTF by means of an 2D ARMA (Auto Regressive Moving Average) model and produces an output (complex) image (which is called a Fourier Xmipp image) with the filter of the ARMA model. This filter is actually an estimation of the CTF of the micrograph. The ARMA filter can then be applied to a random image of zero mean and unitary variance to get simulated noise according to the model, or more frequently the output Xmipp Fourier Image will be used to determine the CTF parameters using Adjust_CTF
$ spARMA ...
Parameters
-i [image]
This parameter is the input image from which the ARMA model will be generated
-o [Fourier Xmipp image]
This is the filter of the ARMA model that you have to apply to a random image to get a simulated microscope noise. The filter generated has the same dimensions of the input image
-N_AR [N_AR]
The order of the AR part of the model in de rows direction
-M_AR [M_AR=N_AR]
The order of the AR part of the model in de columns direction
-N_MA [n2]
The order of the MA part of the model in de rows direction
-M_MA [M_MA=N_MA>]
The order of the MA part of the model in de columns direction
-tol
This is a rather technical parameter, related with the algorithm used to find the AR coeficients of the model. It is the allowed tolerance in the eigenvalues of the single value decomposition (SVD) of the linear system matrix used in the calculus. A value of 0 means that all the eigenvalues will be accepted, and it is the value to use in normal running. If problems are experienced in the solutions, the value of this parameter should be increased to reject those eigenvalues lower than the value chosen. This improves the stability of the algorithm an allows it to find the best solution compatible with a rather unstable linear system.
The last four parameters are better understood seeing this picture, where a pixel is represented by a box in the grid:
The support region for the AR part of the model are the first a third quadrants (cyan ones), N_AR pixels in the rows direction and M_AR pixels in the columns direction. And the suuport region for the MA part of the model are the second and fourth quadrants (red ones). The black pixel is the actual pixel considered. Summing up, the info of the surrounding pixels is considered to generate the actual value of the black pixel. In this case, the values are : N_AR = 6, M_AR = 4, N_MA = 4, M_MA = 3.
The optimal values for N_AR , M_AR, N_MA, and M_MA were found to be 20 - 30 for N_AR , M_AR, and 15 - 25 for N_MA, M_MA, a quite wide range not substantially modified by changes in size of the images or defocus of the CTF. The recommended values are 24 for AR order and 20 for MA order, as these ones were not statistically distinguishable of the best results in all the test.
Let´s see a practical example. Suppose we have an image of the microscope noise, like this one called noise.xmp
:
And we want to perform an spectral estimation. Well, we execute the spARMA program:
$ xmipp_spARMA -i noise.xmp -o ARMAfilter.fft -N_AR 40 -M_AR 40 -N_MA 20 -M_MA 20
When the program ends, ARMAfilter.fft
contains the filter of the ARMA model to apply to a random image to get the simulated noise. Actually, this filter is the transfer function (Fourier Transform) of the filter that the ARMA model represents.
You can do two things with this file:
I. Compare it with other forms of spectral estimation
Like periodogram averaging (this essentially is an averaging of the Fourier Transforms of the image divided by the number of pixels). FourierFilter program is used to generate the amplitude of the ARMA filter:
$ fourierfilter -i input.xmp -o output.xmp -fourier_mask ARMAfilter.fft -save_amplitude ARMAfilter_amplitude.xmp
The amplitude file can be seen like any other xmipp image, as it's not a complex one, but a normal one. When you save the amplitude, what is really saved is the logarithm10 of the squared amplitude plus 1. However, the ARMAfilter.fft contains values so that their square is the estimation of the spectral density function.
Here you can see the comparison between images, which represent the amplitude (log of absolute value squared) of the Periodogram averaging (left) and ARMA estimation (right) of the image.
II. Generate a simulated noise image
This is done again with FourierFilter. You have to generate a random image with zero mean and unitary variance in every pixel, of the same dimensions of the original image:
And then apply the ARMA filter:
$ fourierfilter -i random.xmp -o simulated-noise.xmp -fourier_mask ARMAfilter.fft
Here you have the simulated noise image, whose spectral density is similar to the original one from the microscope. This can be useful to simulate microscope noise in artificially generated images
$ spARMA -i noise.xmp -o ARMAfilter.fft -N_AR 40 -M_AR 40 -N_MA 0 -M_MA 0The same applies if you want a purely moving-average MA filter, set the AR parameters to zero.
R. L. Kashyap, "Characterization and Estimation of Two-Dimensional ARMA Models, " IEEE Transactions on Information Theory, Vol. IT-30, No. 5, pp. 736-745, September 1984.
Dudgeon, D. E., Russell M. Mersereau. "Multidimensional Digital Signal Processing", Section 6.5.3, pp. 325. Prentice Hall Signal Processing Series. Ed. Alan Oppenheim.