function slice = load_slice(data_dir,mode_dir,i)
%LOAD_SLICE loads a sparse slice file
%
% Peter Turney
% October 20, 2007
%
% Copyright 2007, National Research Council of Canada
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see http://www.gnu.org/licenses/.
%
% file name
%
slice_file = sprintf('%s/%s/slice%d.mat', data_dir, mode_dir, i);
%
% load the file
%
data = load(slice_file);
%
% return the slice
%
slice = data.slice;
%