clc
clear
close all
tic
img = textread('cem973w035flocf.ima.1000.20.000'); %'cem973w035flocf.ima.1000.20.000'可替换成其他文件名
img(img~=0)=2;
imgre = reshape(img,[100,100,100]);
imgre0 = imgre(:,:,99); %共100张图,30代表第30张图
Vertex = [0 0];
L = 100;
rectangle('Position', [Vertex L L], 'LineWidth', 1, 'EdgeColor', 'k', 'FaceColor', 'k')
axis image
axis ([0 L 0 L])
hold on
for i = 0:L-1
for j = 0:L-1
%%
%
% <<FILENAME.PNG>>
%
Vertex = [j i];
x = j + 0.5;
y = i + 0.5;
if imgre0(i+1,j+1)==0
rectangle('Position', [Vertex 1 1], 'LineWidth', 1, 'EdgeColor', 'r','FaceColor','r')
end
end
getframe;
end