Threshold for Subvolume of figure shown below

3 次查看(过去 30 天)
Hello dear readers,
I've got a problem:
I have a figure 7 and i want to create a subvolume around the area of the maximum. I thought the area should be around x: -1 to 1 and for z: 140 to 145. Therefor i want to create isosurfaces which color the border of the threshold red. But unfortunately i do not have an idea how to figure out the value of threshold. Furthermore im not even quite sure how to declare the NaN's.
I hope you can help me.
Have a good day, everyone
Lucas
limits = [-1,1,-1,1,140,145];
[Vsub.X,Vsub.Y,Vsub.Z,E_sub] = subvolume(V.X,V.Y,V.Z,E, limits);
threshold = 1;
E_sub_angle = angle(E_sub);
E_sub_abs = abs(E_sub);
E_sub_angle(E_sub_abs<=threshold) = [NaN];
figure(10)
p1 = patch(isosurface(Vsub.X,Vsub.Y,Vsub.Z,E_sub_angle, threshold),...
'FaceColor','red','EdgeColor','none');
isonormals(Vsub.X,Vsub.Y,Vsub.Z,angle(E_sub),p1);
p2 = patch(isocaps(Vsub.X,Vsub.Y,Vsub.Z,E_sub_angle, threshold),...
'FaceColor','interp','EdgeColor','none');
view(3);
axis tight;
daspect([1 1 0.4])
colormap(hsv)
camlight right;
camlight left;
lighting gouraud
xlabel('X-Sub')
ylabel('Y-Sub')
zlabel('Z-Sub')
  2 个评论
darova
darova 2020-5-22
  • I have a figure 7 and i want to create a subvolume around the area of the maximum
Is this correct?

请先登录,再进行评论。

回答(1 个)

darova
darova 2020-5-22
Let X,Y and Z be your 3d matrices
ff = patch(isosurface(X,Y,Z,V,threshold));
v = ff.vertices; % extract data
[~,ix] = max(v(:,3)); % find maximum value of z
[x0,y0,z0] = deal(v(ix,1),v(ix,2),v(ix,3));
ind = (X-x0).^2 + (Y-y0).^2 + (Z-z0).^2 < 5^2; % find values closer to maximum R=5
plot3(X(ind),Y(ind),Z(ind),'.r')

类别

Help CenterFile Exchange 中查找有关 Volume Visualization 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by