mirror of
https://github.com/c-sooyoung/fold_slice.git
synced 2026-09-18 00:09:10 +09:00
initial commit
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
function [mask] = make_circular_mask(N, radius)
|
||||
%Make a circular mask. Made by YJ
|
||||
% N: size of image
|
||||
% radius: radius
|
||||
if length(N)==1
|
||||
x = linspace(-floor(N/2),ceil(N/2)-1,N);
|
||||
y = linspace(-floor(N/2),ceil(N/2)-1,N);
|
||||
else
|
||||
x = linspace(-floor(N(2)/2),ceil(N(2)/2)-1,N(2));
|
||||
y = linspace(-floor(N(1)/2),ceil(N(1)/2)-1,N(1));
|
||||
end
|
||||
[Y, X] = meshgrid(x,y);
|
||||
S = sqrt(X.^2+Y.^2);
|
||||
|
||||
mask = S <= radius;
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user