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
Apply a imgaussfilt with dynamic sigma
4 次查看(过去 30 天)
显示 更早的评论
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
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!