function [im]=hyperRaman(filemask) filelist = dir(filemask); %get a list of date numbers datenums = cell2mat({filelist.datenum}); %sort the file order based on acquisition time [~, id] = sort(datenums); %get the number of files T = length(id); %size of the image along transverse direction X, number of steps when scanned %load the first file to determine the spectral and Y-axis size temp = readspe(filelist(1).name); L = size(temp, 1); %size of the image along longitudinal direction Y (laser line) B = size(temp, 2); %number of bands in the image %create the cube outvar = zeros(L, T, B); %for each line for x = 1:T %read a SPE file img = readspe(filelist(id(x)).name); outvar(:,x,:)= permute(img, [1 3 2]); end im=outvar; figure imagesc(outvar(:,:,150)), colorbar, axis normal, axis equal off % subplot(1,3,1),imagesc(outvar(:,:,151)), colorbar % subplot(1,3,2),imagesc(outvar(:,:,175)), colorbar % subplot(1,3,3),imagesc(outvar(:,:,291)), colorbar colormap inferno;