Clear Filters
Clear Filters

Apply a imgaussfilt with dynamic sigma

2 views (last 30 days)
Måns
Måns on 7 Feb 2023
Commented: Jonas on 8 Feb 2023
Hi,
I am currently simulating a proton radiography and we are using different energies to generate the image.
The original coding uses one energy and hence one sigma, but we are trying to adopt this into several energies and therefor different sigma.
pr = imgaussfilt(pr, [sigma(1)/spacing(1) sigma(2)/spacing(2)], 'FilterDomain', 'auto', 'FilterSize', [25 25]) ;
Is the original code. Where spacing is always kept at 5mm.
pr is a matrix of 350x260x180 points where the first two vetors is describing the 2D plane of the image and 180 points is a so called bragg peak(used for describing protons but not essential to the issue).
As each energy have a spread it will affect nearby points which might have different sigma.
I tried it in a loop by:
pr(i-a:i+b,j-c:j+d,:) = imgaussfilt(pr(i-a:i+b,j-c:j+d,:), [sigma(1)/spacing(1) sigma(2)/spacing(2)], 'FilterDomain', 'auto', 'FilterSize', [25 25]);
where a,b,c,d is 12 (dynamic at the edges to not exceed the limits).
The resulting image is very wrong however and not sure how to solve this issue.
Is there a way to solve this?
If there is additional information needed to solve this please let me know.
Thank you in advance
  1 Comment
Jonas
Jonas on 8 Feb 2023
please provide some exemplary data, e.g. as mat file. and please explain a bit more how we know which sigma to use on which point in the image

Sign in to comment.

Answers (0)

Categories

Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!