function disp_images(in, label,layer)

[Ny Nx rgb N_images] = size(in);
T = 1;

%zz=zeros(10, 10);
z = diag(0:9)*ones(10);
y = zeros(10);
x = z';

f = figure;
set(f, 'Color',[0 0 0 ]);
a = axes;
set(a, 'Color',[0 0 0 ]);

hold on


%for i=1:T:N_images
for i=1:T:N_images    
    alpha_map = zeros(Ny, Nx, N_images);
    for j=1:length(layer)
        ind = find(label==layer(j));
        alpha_map(ind)=1;
        ind = find(in(:,:,1,:)==0);
        alpha_map(ind)=0;
    end
    texture = in(:,:,:,i)/255;
    
    %h = warp(zz,texture);
    h = warp(x,y,z,texture);
    
    set(h, 'AlphaData',alpha_map(:,:,i),...
            'FaceAlpha','texturemap',...
            'AlphaDataMapping','none');
    %zz=zz+1;
    y=y+1;
    axis square
end
hold on
%set(gca,'XDir','reverse')
%set(gca,'YDir','reverse')
set(gca,'ZDir','reverse')
set(gca,'XGrid','on')
set(gca,'YGrid','on')
set(gca,'ZGrid','on')
%view(6,54);


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plen = ones(Ny, Nx, N_images);
% ind = find(label==layer);
% plen(ind)=-1;
% plen = show_epi(plen);
% 
% p=patch(isosurface(plen,0));
% g_level = 0.6;
% set(p,'FaceColor',[g_level, g_level, g_level],'EdgeColor','none','FaceAlpha',0.70);
% view([80,10]);
% camproj('perspective');
% 
% axis vis3d 
% camlight
% lighting gouraud;
% axis equal