Draw a 3D array containing only 0,1 into a 3D image
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a 100*100*100 mat file with only 0 and 1 in it. Now I want to draw it as a 3D image, with 0 skeleton and 1 pore. Similar to the picture below. Ask for code! ! ! ! Ask for code! ! ! !
댓글 수: 0
채택된 답변
KSSV
2022년 8월 29일
[m,n,p] = size(A) ;
[X,Y,Z] = meshgrid(1:m,1:n,1:p) ;
x = X(:) ;
y = Y(:) ;
z = Z(:) ;
v = A(:) ;
idx = v==1 ;
scatter3(x(idx),y(idx),z(idx),[],'b','filled')
댓글 수: 0
추가 답변 (1개)
Abderrahim. B
2022년 8월 29일
Hi!
You have a volumetric data; I recommend that you use Volume Viewer to visualize it. An example below:
M = randi([0 1], 100,100,100) ;
volumeViewer(M)
Note that volumeViewer requires image processing toolbox.
Hope this helps
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!