function [img,maxVal] = readTif(fName)

info = imfinfo(fName);
maxVal = 2^info(1).BitDepth-1;
nFrames = numel(info);
oneFrame = imread(fName, 1);
[nRow,nCol] = size(oneFrame);
img = zeros(nRow, nCol, nFrames, 'uint16');
for k = 1:nFrames
    img(:,:,k) = imread(fName, k);
end

end