stack=input('enter filename:','s');

%stack='freerun.tif';
%stack='periodicstimulation.tif';

iinfo = imfinfo(stack);

disp('original stack has this many framss:');

frames = numel(iinfo)

frames=input('how many frames to read?');

sampfreq=input('enter sample frequency');

width=iinfo(1).Width;
height=iinfo(1).Height;

for p = 1:frames;
	[stack16(:,:,p),map] = imread(stack,p);
end

%sampfreq=100

clear p iinfo map stack

