File Exchange

image thumbnail

Polar Onion Peeling

version 1.6 (15.9 MB) by

Apply polar onion peeling method for analyzing velocity map imaging (VMI) data.



View License

The code implements the method shown at "Toward real-time charged-particle image reconstruction using polar onion-peeling" by G.M. Roberts et-al, Rev. Sci. Instr. 80, 053104 (2009). It supports images of up to 4K and accepts arbitrary (even) beta parameters. Specific quadrants of the image can be selected in the analysis in case of image asymmetries. NaN values can be used for masking unwanted pixels or areas.
For more info regarding the method see:

Comments and Ratings (7)


Natan (view profile)

Hi Bennet, Can you please send me a sample of the code you are using, I manage to get the iradeconExp info... I'll also soon update the code with a more current version that allows for masking with NaN...

Bennet Krebs

Hi Natan, your code is very useful and i appreciate the time you took making it public.
My problem it with the "experimental image". I cannot seem to get your code to work with the 'exp' parameter, the following error occurs:

Error using POP>t2f (line 294)
Not enough input arguments.

Error in POP (line 249)

Error in TESTBED (line 2)
s=POP(im,2:2:4, 1:4, 'exp');

I tired it with multiple of my own VMI-Spectra and your testfile, which all work perfect with the 'sim' setting.
I'm currently reading through your refereed paper and the code itself, so maybe I find the answer in there.


Thanks Natan for the inversion code. Hopefully it works for me. I will try it on my ion/electron raw images. :)


Natan (view profile)

Your data is probably all zeros in some radius, so the interpolation is not possible. Just add to your data a negligible const value, like: data=data+eps; to solve it. I'll update the code with a try\catch case in that loop for this case in the future.


Pengju (view profile)

The code is very cool!
I tried my images, it works very well and fast.
It can also give higher order beta, amazing.
But still some of my images meet one error as:
??? Error using ==> interp1 at 184
There should be at least two data points.

Error in ==> POP at 234

My image size is 990*990 (double)as .mat file.

Would you please give me some advice?


Natan (view profile)

@Luis, if you press "Download Submission" you'll get a zip file ( that contains also delta_lut.mat ...


Luis (view profile)

Tried to test it but couldn't find delta_lut.mat, thanks



Support in NaN values for masking the raw images was added, the code is restructured for better readability and a sample script to demonstrate how it works was added.


The code supports images of up to 4K. bld_lut.m was added for radial basis set generation of arbitrary size. Code improvements include applying better matrix inversion method, avoiding divergences at the origin artifacts and other minor improvements.


Faster code, some minor debugging for the case of all zeros data, improved support in higher Legendre polynomials up to the floating point accuracy limit.


added Matlab version control to use the proper interpolator name.


Added support in specific image quadrants analysis in case of image asymmetries. Improved documentation and warnings\errors handling.


The code now supports higher order Legendre polynomials, this was done with the help of Adam Chatterley.

MATLAB Release
MATLAB 8.2 (R2013b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today