%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Check that the directory is valid, 
% i.e. it has Original and Processed
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [validDir] = checkSATDir(d)
validDir = 0;
[cwd, direc] = fileparts(d);
if length(direc)<4
    return;
end
if strcmp(direc(1:4), 'SAP_') & exist('Processed', 'dir') & exist('Original', 'dir')
    validDir = 1;
end
return;