-------------------------------------------------------------------------- Similar to imread, but read many images into an image cube EXAMPLE imCube = im_cube_read('clpsaline1bl#1',10,20); INPUT ifolder - input folder name frStart - start frame frEnd - end frame OUTPUT imCube - the image cube ( M X N X P ) SEE ALSO repmat, reshape, im_get Written by Rich Nguyen (rich.uncc@gmail.com). Version 1.0 June 2010 --------------------------------------------------------------------------
0001 function imCube = im_cube_read( ifolder, frStart, frEnd, ext) 0002 %-------------------------------------------------------------------------- 0003 %Similar to imread, but read many images into an image cube 0004 % 0005 % EXAMPLE 0006 % imCube = im_cube_read('clpsaline1bl#1',10,20); 0007 % 0008 % INPUT 0009 % ifolder - input folder name 0010 % frStart - start frame 0011 % frEnd - end frame 0012 % 0013 % OUTPUT 0014 % imCube - the image cube ( M X N X P ) 0015 % 0016 % SEE ALSO 0017 % repmat, reshape, im_get 0018 % 0019 % Written by Rich Nguyen (rich.uncc@gmail.com). 0020 % Version 1.0 June 2010 0021 %-------------------------------------------------------------------------- 0022 0023 0024 %% INIT 0025 im = im_get(ifolder, frStart, ext); 0026 n = frEnd - frStart + 1; 0027 imCube = repmat(im, [1 n]); 0028 imCube = reshape(imCube, [size(im,1) size(im,2) n]); 0029 counter = 1; 0030 %% READ IN EACH IMAGE 0031 for fr = frStart: frEnd 0032 im = im_get(ifolder, fr, ext); 0033 imCube(:,:,counter) = im; 0034 counter = counter + 1; 0035 end 0036 0037 0038 0039 0040 end