Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate polar onion peeling algorithm into PyAbel #30

Open
DanHickstein opened this issue Nov 23, 2015 · 7 comments
Open

Incorporate polar onion peeling algorithm into PyAbel #30

DanHickstein opened this issue Nov 23, 2015 · 7 comments

Comments

@DanHickstein
Copy link
Member

DanHickstein commented Nov 23, 2015

It would be nice to implement one of the inverse Abel transform methods that uses a polar basis set to allow for smooth transforms of noisy data. Polar onion peeling (POP) is one of the most popular methods for this.

There is a nice Matlab implementation of the POP algorithm here. Adi Natan, the author of that code, said that it would be fine if we ported it to python and incorporate it in to PyAbel. He also has the matlab code that generates the basis sets, so we would not be limited to the 1024x1024 basis set that comes with the program.

EDIT: Adi added the code for the basis set generation to the MATLAB site: http://www.mathworks.com/matlabcentral/fileexchange/41064-polar-onion-peeling/content/bld_lut.m

@DanHickstein DanHickstein self-assigned this Nov 23, 2015
@DanHickstein DanHickstein added this to the Version 0.8 milestone Nov 23, 2015
@rth
Copy link
Collaborator

rth commented Nov 24, 2015

That would be great! It would be interesting to see how different implementations behave with noisy data.

@DanHickstein
Copy link
Member Author

Now that #270 has added rBasex, there is probably little motivation to also add pBasex.

@MikhailRyazanov
Copy link
Collaborator

Now I need to say here that POP is not really correct. Namely, this procedure:
image
that generates the projection of an anisotropic ring is valid only if the ring is infinitely narrow (that is, br(R) → Abel[δ(R − r)]). In reality, for extended basis functions with different angular dependences, their projections have different radial parts, not just by the (R/r)n factor.

Here is a comparison of the actual projections and their POP approximations for the triangular basis functions used in rBasex (the POP article is not clear about the shape of their basis functions, but they are unlikely to be narrower than this):
POP
p6; 0(R) here is what they call b6(R) — projection of the isotropic basis function centered at r = 6, and p6; n(R) are projections of anisotropic basis functions with cosn θ angular dependences.
As can be seen, all POP approximations have noticeable errors, larger for higher angular orders.

However, for larger radii r, the relative widths of the basis functions decrease, so they become effectively narrower, and the POP approximation works better. Perhaps, for real images (with min r ≳ 100 px), the results will be reasonable enough (plus, the authors say that their method has some other problems at low radii).

One potential advantage is that they use Legendre polynomials instead of cosine powers, so the method should be more numerically stable for high angular orders. Although I don't know whether this is really true and whether this higher stability overweighs the increasing approximation errors. If somebody wants to compare, it would be interesting to see the results...

@DanHickstein
Copy link
Member Author

Okay, this is interesting stuff. Is your conclusion is the same as mine: incorporating POP might be interesting, but it's a fairly low priority to incorporate it?

@MikhailRyazanov
Copy link
Collaborator

Yes, maybe label this issue as low-priority, but I wouldn't close it.

@adinatan
Copy link

Just to add that unlike the paper mentioned, the error that is accumulated closer to the origin at small radii is dealt in the matlab code by restricting the leading beta order that can be used, which created an effective filter for the angle resolution, as well as attenuate the signal the closer it gets to the origin. In addition, this behavior is negligible for radius ~ >100 pixels, so it can be easily circumvented by resampling the domain needed such that the error is restricted to an unimportant neighborhood around the origin.

@MikhailRyazanov
Copy link
Collaborator

I guess, if this is ever implemented, it would be nice to have the reference implementation and add any possible improvements as options (maybe enabled by default). In any case, examining results from existing implementations beforehand should help in judging what to do and how. Maybe these deviations are negligible in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants