Apply a imgaussfilt with dynamic sigma

조회 수: 4 (최근 30일)
Måns
Måns 2023년 2월 7일
댓글: Jonas 2023년 2월 8일
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
Jonas
Jonas 2023년 2월 8일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by