Threshold for Subvolume of figure shown below

조회 수: 2 (최근 30일)
Lucas Junghans
Lucas Junghans 2020년 5월 22일
답변: darova 2020년 5월 22일
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?
Lucas Junghans
Lucas Junghans 2020년 5월 22일
Yes. This is the area:)

댓글을 달려면 로그인하십시오.

답변 (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에서 Scalar Volume Data에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by