-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathshili61.m
115 lines (115 loc) · 3.65 KB
/
shili61.m
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
h0=figure('toolbar','none',...
'position',[198 56 450 468],...
'name','实例61');
h1=axes('parent',h0,...
'position',[0.3 0.45 0.5 0.5],...
'visible','off');
[x,y,z,v]=flow;
xmin=min(x(:));
ymin=min(y(:));
zmin=min(z(:));
xmax=max(x(:));
ymax=max(y(:));
zmax=max(z(:));
u1=uimenu('parent',h0,...
'tag','u1',...
'label','绘图',...
'background',[0.75 0.75 0.75]);
u11=uimenu('parent',u1,...
'tag','u11',...
'label','绕X轴旋转-45度',...
'background',[0.75 0.75 0.75],...
'callback',[...
'cla,',...
'hslice=surf(linspace(xmin,xmax,100),linspace(ymin,ymax,100),zeros(100));,',...
'rotate(hslice,[-1,0,0],-45),',...
'xd=get(hslice,''xdata'');,',...
'yd=get(hslice,''ydata'');,',...
'zd=get(hslice,''zdata'');']);
u12=uimenu('parent',u1,...
'tag','u12',...
'label','绕Y轴旋转-45度',...
'background',[0.75 0.75 0.75],...
'callback',[...
'cla,',...
'hslice=surf(linspace(xmin,xmax,100),linspace(ymin,ymax,100),zeros(100));,',...
'rotate(hslice,[0,-1,0],-45),',...
'xd=get(hslice,''xdata'');,',...
'yd=get(hslice,''ydata'');,',...
'zd=get(hslice,''zdata'');']);
b1=uicontrol('parent',h0,...
'style','pushbutton',...
'units','points',...
'tag','b1',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','设置颜色',...
'position',[50 120 60 25],...
'callback',[...
'delete(hslice),',...
'h=slice(x,y,z,v,xd,yd,zd);,',...
'set(h,''facecolor'',''interp'',''edgecolor'',''none'',''diffusestrength'',0.8)']);
b2=uicontrol('parent',h0,...
'style','pushbutton',...
'units','points',...
'tag','b2',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','添加切片1',...
'position',[240 120 60 25],...
'callback',[...
'hold on,',...
'hx=slice(x,y,z,v,xmax,[],[]);,',...
'set(hx,''facecolor'',''interp'',''edgecolor'',''none'')']);
b3=uicontrol('parent',h0,...
'style','pushbutton',...
'units','points',...
'tag','b3',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','添加切片2',...
'position',[240 70 60 20],...
'callback',[...
'hold on,',...
'hy=slice(x,y,z,v,ymax,[],[]);,',...
'set(hy,''facecolor'',''interp'',''edgecolor'',''none'')']);
b4=uicontrol('parent',h0,...
'style','pushbutton',...
'units','points',...
'tag','b4',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','添加切片3',...
'position',[240 20 60 20],...
'callback',[...
'hold on,',...
'hz=slice(x,y,z,v,zmax-1,[],[]);,',...
'set(hz,''facecolor'',''interp'',''edgecolor'',''none'')']);
b5=uicontrol('parent',h0,...
'style','pushbutton',...
'units','points',...
'tag','b5',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','灯光效果',...
'position',[50 70 60 20],...
'callback',[...
'daspect([1 1 1]),',...
'axis tight,',...
'box on,',...
'view(-38.5,16),',...
'camzoom(1.4),',...
'camproj perspective,',...
'lightangle(-45,45)']);
b6=uicontrol('parent',h0,...
'style','pushbutton',...
'units','points',...
'tag','b6',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','colorbar',...
'position',[50 20 60 20],...
'callback','colorbar(''horiz'')');
b7=uicontrol('parent',h0,...
'style','pushbutton',...
'units','points',...
'tag','b7',...
'backgroundcolor',[0.75 0.75 0.75],...
'string','关闭',...
'fontsize',14,...
'position',[145 75 60 20],...
'callback','close');