Is this a potential bug in the new "obliqueslice" function?
5 views (last 30 days)
Show older comments
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);
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!