-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeflation
27 lines (26 loc) · 868 Bytes
/
deflation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function [ mat_deflation ] = deflation( mat,steps )
%deflating the geometry mat with each step of n
%mat should in the direction of top cleat network, 1 is cleats which is the
%target phase
%%
%mat_deflation=double(mat);
for k=1:size(mat,3)
poro=sum(sum(mat(:,:,k)));
%mat(:,:,k)=imresize(matt(:,:,k),3);
mat_deflation(:,:,k)=double(mat(:,:,k));
if poro~=0
%mat(:,:,k)=imresize(matt(:,:,k),2);
%mat_deflation(:,:,k)=mat(:,:,k);
for i=1:steps
boundary=bwmorph(mat(:,:,k),'remove');
layer_deflation=mat_deflation(:,:,k);
layer_deflation(boundary)=i+1;
mat_deflation(:,:,k)=layer_deflation;
layer=mat(:,:,k);
layer(boundary)=0;
mat(:,:,k)=layer;
end
else
%mat_deflation(:,:,k)=imresize(matt(:,:,k),2);
end
end