Is this a potential bug in the new "obliqueslice" function?

3 ビュー (過去 30 日間)
Lukas Glandorf
Lukas Glandorf 2022 年 9 月 19 日
コメント済み: Matt J 2022 年 9 月 19 日
Hi all,
the new "obliqueslice" function fails for me in line 184 "sliceSize = round(B1.BoundingBox);" with:
Error using round
Second argument must be a real integer scalar.
for some specific inputs because the B1.BoundingBox that is created from the regionsprops call in line 177 contains two regions. Looking at the created "sliceMaskLimit" (line 176), the problem is that one mask pixel is disjoint from the rest of the region. Looks like this edge case is not properly taken care of?
Edit: Quick & dirty fix: copy function and change line 177 from
B1 = regionprops(sliceMaskLimit,'BoundingBox');
to
B1 = regionprops(bwconvhull(sliceMaskLimit),'BoundingBox');
Problem can be recreated via:
arr = ones(201,336,336);
p = [165,232,6];
n = [0.2,1,-0.8];
obliqueslice(arr,p,n);
Error using round
Second argument must be a real integer scalar.

Error in obliqueslice (line 184)
sliceSize = round(B1.BoundingBox);
  1 件のコメント
Matt J
Matt J 2022 年 9 月 19 日
It does look like a bug to me.. I would just use griddedInterpolant.

サインインしてコメントする。

回答 (0 件)

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by