How to create a 3d stack of multiple images in Matlab

6 views (last 30 days)
Can someone help with creating a 3D stack in Matlab. I have used this line of codes, but it seems that my code stacks up the same image as many times as specified.
clear all;
Imatrix = [];
for i=1:500
images{i} = imread(sprintf('0001.tif',i));
Imatrix = cat(3, Imatrix, images{i});
end
I have a folder containing 500 images, and i want to stack the images serially as named.
Thanks
  4 Comments
Anand P
Anand P on 4 Jun 2019
Is there any method to visualise the stack you have created in a 3D manner

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 24 May 2016
images{i} = imread(sprintf('%04d.tif',i));

More Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 24 May 2016
Depending on how your images are named, this line of code should look like
images{i} = imread(sprintf('000%d.tif',i));

Jubilee Adeoye
Jubilee Adeoye on 24 May 2016
Thanks for your help!!

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!