Convert a xyz surface into a 3D array?

조회 수: 2 (최근 30일)
Nathan Orloff
Nathan Orloff 2014년 2월 20일
편집: Sean de Wolski 2014년 2월 20일
I have a the following input:
surface = struct('vertices', [....],'faces',[....];
Which I can draw as:
patch(surface)
But what I need is a 3D logical array, where the contained volumes are true.
Is there a quick way to do this?

채택된 답변

Sean de Wolski
Sean de Wolski 2014년 2월 20일
편집: Sean de Wolski 2014년 2월 20일
Edit per clarification
Use this utility from the File Exchange:
  댓글 수: 2
Nathan Orloff
Nathan Orloff 2014년 2월 20일
Thanks for the comment.
I use:
Then I create a structure:
mysurface = struct('vertices', n_verts,'faces',n_faces);
Where n_verts and n_faces are vectors. n_verts are the xyz points for all of the vertices. n_verts is a 3 x N vector where N is the number of vertices. n_faces is also a 3 x N vector. When I call:
patch(mysurface)
It creates 3D image of my surface.
I want to create a 3D logical array where the 1's are the regions contained in the surface. This way I can use bwlabel and all the other image processing tricks on my surface.
Is this clear?
Sean de Wolski
Sean de Wolski 2014년 2월 20일
편집: Sean de Wolski 2014년 2월 20일
Ahh, gotcha. I was thinking the other direction (i.e. given a logical volume, get the struct).
See edits

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by