Skip to content
Snippets Groups Projects
Commit 0a068f34 authored by Eric Wait's avatar Eric Wait
Browse files

Fixed bug in creating a ball binary mask

parent ac67d9ee
No related branches found
No related tags found
No related merge requests found
function shapeElement = MakeBallMask(radius)
nbSE = false(2*radius+1,2*radius+1,2*radius+1);
[XX,YY,ZZ] = ndgrid(1:size(nbSE,1),1:size(nbSE,2),1:size(nbSE,2));
[XX,YY,ZZ] = ndgrid(1:size(nbSE,1),1:size(nbSE,2),1:size(nbSE,3));
bInside = (((XX(:)-radius-1).^2 + (YY(:)-radius-1).^2 + (ZZ(:)-radius-1).^2) <= radius^2);
nbSE(bInside) = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment