How to depict an image in an axes?

조회 수: 4 (최근 30일)
Stelios Fanourakis
Stelios Fanourakis 2018년 6월 17일
댓글: Stelios Fanourakis 2018년 6월 18일
Let's assume I have a 4D image called 'im2'.
I want to imshow a new image called 'im3' which is equal:
im3 = permute(im2, [3 1 2 4]);
And I want the z axis to be
slice = floor(size(im2,2)/2)
So I come to
imshow(squeeze(im3(:,:,slice,:)))
What if I want to imshow the same image as above, to an axes using eg subplot but have a different index as z axis (controlled by a slider).
idx = round((get(hObject, 'Value'));
subplot(2,2,1)
imshow(squeeze(im3(:,:,idx,:)))
It works, but not the way I want. I need to keep the slice as the third dimension and at the same time to run it for times idx (which is the slider callbacks).
I have stuck. Any idea?
Please, ask me if you didn't understand my question
  댓글 수: 11
Stelios Fanourakis
Stelios Fanourakis 2018년 6월 18일
I run your Demo and I got an error line, "Multi-plane image inputs must be RGB images of size MxNx3.".
You tell me that there is no way to extract one 2D slice at one time point out of 3D volume?
Stelios Fanourakis
Stelios Fanourakis 2018년 6월 18일
Is there a way to transform that 3D volume to 2D slices and have them run on the slider? Possibly, without using Dicomwrite

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

답변 (1개)

Yuvaraj Venkataswamy
Yuvaraj Venkataswamy 2018년 6월 18일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by