How to put display multiple 3D images on montage?

3 views (last 30 days)
Hello,
I want to display multiple slices of my Image into one figure using montage but it keeps giving me an error when I get to the montage line of code "montage(Image(:,:,1:40))". How do I fix this? Thank You.
for n=1:40
Test_Image=transpose(Test_Dim(:,:,n));
Image(:,:,n)=Test_Image;
end
montage(Image(:,:,1:40)) colormap(gray) axis equal tight
  2 Comments
Juan Gallegos
Juan Gallegos on 10 Apr 2015
I realized to use montage I had to change the array into 4D so I tried to do that using cat(4,Image) but it gives me this error:
Error using getImageFromFile (line 8) The specified filename is not a string.
Error in montage>getImagesFromFiles (line 326) [img, map] = getImageFromFile(fileNames{1});
Error in montage>parse_inputs (line 225) [I,cmap] = getImagesFromFiles(varargin{1});
Error in montage (line 112) [I,cmap,mSize,indices,displayRange] = parse_inputs(varargin{:});
Error in untitled3 (line 26) montage(Image_cat)
My code:
for n=1:40
Test_Image=transpose(Test_Dim(:,:,n));
Image{n}=Test_Image;
end
Mont_cat=cat(4, Image); montage(Mont_cat(1:40)

Sign in to comment.

Answers (0)

Categories

Find more on Display Image in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!