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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| function GUI
close all;clear all;clc;
nomfichier=[];
% Création de l'objet Figure
handles(1)=figure('units','normalized',...
'position',[0 0 1 1],...
'numbertitle','off',...
'name','Interface Graphique',...
'menubar','none',...
'tag','interface',...
'toolbar','figure');
movegui('center');
% Creation du panel
reconsttab=uipanel('units','normalized',...
'position',[0.25 0.08 0.74 0.8],...
'visible','on');
% Creation de l'axe
axeim=axes('units','normalized',...
'position',[0.25 0.15 0.7 0.75],...
'tag','image');
% Creation du tableau 3D pour la reconstruction
image_num = 30;
J=imread('C:\Documents and Settings\Utilisateur\Bureau\image stage\test.tif');
J=imresize(J,0.25);
[l c]=size(J);
D=zeros(l,c,image_num);
for j=1:image_num
M=imread('C:\Documents and Settings\Utilisateur\Bureau\image stage\test.tif',j);
M = imresize(M, 0.25);
D(:,:,j)=M;
end
imagesc(D(:,:,3))
% Creation du boutton pour reconstruire
reconst3D=uicontrol('style','pushbutton',...
'units','normalized',...
'position',[0.01 0.75 0.1 0.05],...
'string','Reconstruction 3D',...
'callback',@reconst3D_clbk);
function reconst3D_clbk(chemin,fichier) % function qui reconstruit
isoval=500
Ds = smooth3(D);
hiso = patch(isosurface(Ds,isoval),...
'FaceColor',[0,0,1],...
'EdgeColor','none','FaceLighting','phong','EdgeLighting','phong');
hcap = patch(isocaps(D,isoval),...
'FaceColor','interp',...
'EdgeColor','none','FaceLighting','phong','EdgeLighting','phong');
lightangle(45,30);
set(gcf,'Renderer','zbuffer');
isonormals(Ds,hiso)
set(hcap,'AmbientStrength',.6)
set(hiso,'SpecularColorReflectance',0,'SpecularExponent',50)
colormap(nmap)
colorbar
view(45,30)
axis tight % equal
daspect([1,1,1])
end
end |