2D images into a 3D stack of images

3 views (last 30 days)
Rahul Thakur
Rahul Thakur on 29 Jul 2016
Hello All,
I have lot of 2D images and would like to stack them in a 3D volumetric cube and then plot it. I have written a code which is making a 3D array of it but I am not getting a correct plot of all the stack as a 3D cube. My code is given below, please suggest the modification or idea by which I can plot the 3D cube as a stack of all the 2D images.
for i=100:259
% {} = cell array
images{i} = imread(sprintf('%d.png',i));
I{i} = (images{i});
end
myImage = cat(3,I{100:258});
image=myImage(:,:,1);
imagesc(image);
vector=reshape(image',numel(image),1);
X=ifft(image);
Although eventually the end result would need me to produce the inverse FFT of that stack. But, first concern is to produce the stack.

Answers (1)

Image Analyst
Image Analyst on 29 Jul 2016
image is a built-in function so do not try to use it as the name of one of your variables.
I have no idea what it means to "plot" a volumetric image. I only think of "visualizing" volumetric images and in that case we use Avizo: https://www.fei.com/software/avizo-3d/ because MATLAB does not have powerful 3-d visualizing capabilities - it has only simple iso surfaces and cut-away views.
For a "plot", I'm thinking of a graph or something you'd plot with the plot() function. Please explain what exactly is to be plotted from your volumetric image. Show a screenshot if you can.
  3 Comments
Image Analyst
Image Analyst on 31 Jul 2016
I didn't see anything in your code that would display anything. What code did you use to display that axes?
Ariztbe Valladolid
Ariztbe Valladolid on 2 Apr 2020
By any chance could you figure it out?
I am working in something similar but I got 1,500 pictures.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!