beamlet3dfig11.m
来自「beamlet变化的工具箱」· M 代码 · 共 110 行
M
110 行
function Beamlet3Dfig08(OpenNewWindow,HaveTitle,LoadData)
% Auxillary functions: helix Shear3D
% if you don't have the full 3D beamlets package set LoadData=1
if nargin<2
LoadData=0;
end
if nargin<2
HaveTitle=1;
end
if nargin<1
OpenNewWindow=1;
end
if OpenNewWindow
figure
end
if LoadData
load Beamlet3Dfig11
end
vw=[108 4];
vw2=[108 14];
n=32;
if ~LoadData
v=helix(n,1);
end
v1=zeros(n,n,2*n);
v1(:,:,n/2+1:3*n/2)=v;
subplot(2,2,1);
p1a=patch(reducepatch(isosurface(v1,.1),1),'facecolor','g','edgecolor','r');
p1b=patch(reducepatch(isocaps(v1,.1),1),'facecolor','g','edgecolor','r');
light
vertices2=[0-1,0-1,0-1;0-1,n+1,0-1;n+1,n+1,0-1;n+1,0-1,0-1;0-1,0-1,2*n+1;0-1,n+1,2*n+1;n+1,n+1,2*n+1;n+1,0-1,2*n+1];
vertices=[0,0,n/2;0,n,n/2;n,n,n/2;n,0,n/2;0,0,3*n/2;0,n,3*n/2;n,n,3*n/2;n,0,3*n/2];
faces=[1,2,3,4;5,6,7,8;1 2 6 5;3 4 8 7];
p1c=patch('faces',faces,'vertices',vertices,'facecolor','n','EdgeColor','b');
p1d=patch('faces',faces,'vertices',vertices2,'facecolor','n','EdgeColor','k');
axis off
axis equal
hold on
slice(v1,[],[],[19 28 37]);
set(gca,'view',vw,'Xlim',[0-1 n+1],'Ylim',[0-1 n+1],'Zlim',[0-1 2*n+1]);
if HaveTitle
title('Original Image');
end
subplot(2,2,2)
sl1=slice(v1,[],[],[19 28 37]);
set(gca,'view',vw2,'Xlim',[0-1 n+1],'Ylim',[0-1 n+1],'Zlim',[16 40]);
set(sl1,'Edgecolor',0.4*[1 1 1]);
axis off
axis equal
colormap hot
if HaveTitle
title('Slices of the original image');
end
s=1+n/4;
if ~LoadData
v2=Shear3D(v1,1,1,atan(-1+(2*s-2)/n),1);
end
svv=v2;
subplot(2,2,3);
p2a=patch(reducepatch(isosurface(v2,.1),1),'facecolor','g','edgecolor','r');
p2b=patch(reducepatch(isocaps(v2,.1),1),'facecolor','g','edgecolor','r');
light
z=((s-(n/2)-1)/(n/2))*(n/2-[n 0]);
vertices=[0,0,n/2+z(1);0,n,n/2+z(2);n,n,n/2+z(2);n,0,n/2+z(1);0,0,3*n/2+z(1);0,n,3*n/2+z(2);n,n,3*n/2+z(2);n,0,3*n/2+z(1)];
faces=[1,2,3,4;5,6,7,8;1 2 6 5;3 4 8 7];
p2c=patch('faces',faces,'vertices',vertices,'facecolor','n','EdgeColor','b');
p2d=patch('faces',faces,'vertices',vertices2,'facecolor','n','EdgeColor','k');
axis off
axis equal
hold on
slice(v2,[],[],[19 28 37]);
set(gca,'view',vw,'Xlim',[0-1 n+1],'Ylim',[0-1 n+1],'Zlim',[0-1 2*n+1]);
if HaveTitle
title('Sheared Image')
end
subplot(2,2,4)
sl2=slice(v2,[],[],[19 28 37]);
set(gca,'view',vw2,'Xlim',[0-1 n+1],'Ylim',[0-1 n+1],'Zlim',[16 40]);
set(sl2,'Edgecolor',0.4*[1 1 1]);
axis off
axis equal
cm=hot;
cm(1:10,:)=0.6;
colormap(cm)
if HaveTitle
title('Slices of the sheared image');
end
%% Part of BeamLab Version:200% Built:Friday,23-Aug-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%%% Part of BeamLab Version:200% Built:Saturday,14-Sep-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?