Images to stacks

4 views (last 30 days)
Anke
Anke on 18 May 2011
Hey there!
I am totally new to mathlab, but I think what I want to do is quiet easy, so I hope someone can help me.
I have sequences of tiff images, which I want to combine into tiff stacks. The file names are numbered, so for stack one it is "name"001001 until "name"001120 and then ...002001 until ...002120 for stack two and so forth.
Right now I am importing them manually into ImageJ and make stacks and save them, but after a few 100 stacks, I am nearly getting crazy..
I searched the file exchange and also all kinds of ImageJ plugins but I am lost.
Can someone help?
Thanks for your support! Anke

Accepted Answer

Sean de Wolski
Sean de Wolski on 18 May 2011
I = zeros(nRows,nCols,nTifImages,'uint8'); %preallocate block
for ii = 1:nTiffImages %loop over image
I(:,:,ii) = imread(sprintf('name%s.tif',num2str(ii+1000,'%06i'))); Set each image to slice
end
Welcome to MATLAB and Answers!

More Answers (0)

Categories

Find more on Images 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!