필터 지우기
필터 지우기

How to create a isosurface with 3D binary array?

조회 수: 6 (최근 30일)
Camilo Costa
Camilo Costa 2016년 4월 5일
편집: darova 2021년 3월 22일
Dears friends,
How do I create a isosurface using a 3D matrix? I spent a whole week and it still did not get . ehehehehhe My code is:
% Start here clearvars close all clc
A(:,:,1) = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1];
A(:,:,2) = [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0];
A(:,:,3) = [0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0];
A(:,:,4) = [0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0];
A(:,:,5) = [0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
[m,n,p] = size(A); [X,Y,Z] = meshgrid(1:n,1:m,1:p); p = patch(isosurface(X,Y,Z,A,0.999)); isonormals(X,Y,Z,A,p) % end
I was hoping to see a straight up plan. Best Regards!!!

답변 (2개)

Sabrina Smith
Sabrina Smith 2018년 9월 11일
hi! did you ever solve this problem? I have the same thing!

Francesca Lorenzutti
Francesca Lorenzutti 2021년 3월 19일
I'm going to answer just in case someone else needs it.
In my case I solved this problem by choosing an isovalue=0.5 instead of 1 (or something very close to 1).
  댓글 수: 2
darova
darova 2021년 3월 21일
I'd love to see the solution. Please post it
Francesca Lorenzutti
Francesca Lorenzutti 2021년 3월 22일
편집: darova 2021년 3월 22일
There you go, tiff_stack is my mask:
[nX,nY,nZ] = size(tiff_stack);
[X,Y,Z] = meshgrid(1:nX,1:nY,1:nZ);
[f v] = isosurface(X,Y,Z,tiff_stack,0.5);
patch('Faces',f,'Vertices',v)

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

카테고리

Help CenterFile Exchange에서 Scalar Volume Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by