How can I show just some slices of a 3D matrix?
조회 수: 5 (최근 30일)
이전 댓글 표시
I have a binary 3D matrix (100*100*100), which is a digital rock. In the matrix 0 and 1 represent the pores and solid area, respectively. I want to represent some slices. For example in XY plane slices 1 and 50 and 100. How can I show just some slices of the rock?
댓글 수: 0
채택된 답변
Walter Roberson
2018년 3월 5일
Use slice()
댓글 수: 2
Hassan Zhairabany
2020년 5월 28일
Hello,
Could you tell me in case I have a matrix A=randi([0,1],[256,256,5]) and I want to show the plane B=A(255,:,:) but like a top view.
imshow(B) does not work because the image of B considered Multi-plane, B is 256*1*5 double
Walter Roberson
2020년 5월 28일
(You asked this at https://www.mathworks.com/matlabcentral/answers/536135-how-i-can-show-one-plane-of-a-3d-matrix-double and have received an answer there)
추가 답변 (1개)
Rik
2018년 3월 3일
Have you tried to index them and use imshow? (so imshow(A(:,:,50)))
You can use subplot to show the separate images side by side, or you can use montage to show the entire matrix (don't forget to use permute to change your matrix from row x col x page to row x col x color x page).
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!