how to show 20 images in single figure using matlab ?

I have 20 images and I want to show them in single figure in a single axes . I am very new to matlab and I have to get this thing done by tomorrow and so I don't have time to learn to do that. I basically want to ask is when a single image is displayed it is shown with x and y axis (two directions) and if I rotate the figure using 'Rotate 3D' button , I am able to see that this image is occupying z = 0 plane . What I want is that I can display 20 images , on different xy planes , like image1 on z = 0 plane , image2 on z = 1 plane and so on ... How to achieve this please help me out.

 採用された回答

Image Analyst
Image Analyst 2015 年 7 月 8 日

0 投票

You can create a single 3D volumetric image like you said (same image at different z levels) using cat():
image3D = cat(3, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1, image1);
To display them, you can use slice() to take cutaway views, or extract slices parallel to the x, y, or z axes.

5 件のコメント

Himank Airon
Himank Airon 2015 年 7 月 8 日
編集済み: Himank Airon 2015 年 7 月 8 日
Please elaborate that how to display this 3D volumetric image ? I mean how will I view this 3D image that is created ?PLease reply with the code Thank you
Image Analyst
Image Analyst 2015 年 7 月 8 日
slice13 = image3d(:,:,13);
imshow(slice13, []);
Himank Airon
Himank Airon 2015 年 7 月 8 日
Is it possible to view that whole 3D image together ?
Image Analyst
Image Analyst 2015 年 7 月 9 日
Yes, but not very well in MATLAB. MATLAB does not have very good volume visualization capability. It's limited to surface renderings and cutaway views. For the ultimate in volume visualization you'll need to use a program like Avizo. http://www.fei.com/software/avizo3d/
Bjorn Gustavsson
Bjorn Gustavsson 2015 年 7 月 9 日
Another option for volume rendering software is:

サインインしてコメントする。

その他の回答 (2 件)

Alex
Alex 2015 年 7 月 8 日

0 投票

Does subplot(n,m,i) help?

3 件のコメント

Himank Airon
Himank Airon 2015 年 7 月 8 日
I apologize if my question was not clear to you . I basically wanted to ask is when a single image is displayed it is shown with x and y axis (two directions) and if I rotate the figure using Rotate 3D button , I am able to see that this image is occupying z = 0 plane . What I want is that I can display 20 images , on different xy planes , like image1 on z = 0 plane , image 2 on z = 1 plane and so on ... How to achieve this please help me out and I apologize again for not being clear.
Alex
Alex 2015 年 7 月 8 日
MATLAB doesn't have any function that quickly 'voxel'rize the images. The property ZAxis in functions like image/imagesc/image can't be modified.
Image Analyst
Image Analyst 2015 年 7 月 8 日
I don't know what 'voxel'rize means but you can create versions/copies of the image at different z levels using cat(), like I did in my answer, or using repmat().

サインインしてコメントする。

Steven Lord
Steven Lord 2015 年 7 月 8 日

0 投票

Displaying them all in a single axis is going to be messy, I suspect. Try the Image Processing Toolbox function MONTAGE or use SUBPLOT as Alex has suggested. If those don't do what you want, you will need to "pack" the images together and then call IMAGE or IMAGESC or something similar. I don't have an example of how to do this; you would need to determine the best approach for your data, based on their sizes, color ranges, etc.

1 件のコメント

Himank Airon
Himank Airon 2015 年 7 月 8 日
please refer to more clear statement of my problem in comments of Alex's answer . please help me in any way you can ?

サインインしてコメントする。

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by