%% Pre-proccesing AFR2

dir = 'Z:\AYA\data\AFR2\';
ses = {'200214','190214','180214'};
files = {{'AFR2_200214_cage-1','AFR2_200214_cage2-1','AFR2_200214_trials-1'}...
        ,{'AFR2_190214_cageok-1','AFR2_190214_mazeOK-1','AFR2_190214_mazeOK2-1','AFR2_190214_mazeOK3-1','AFR2_190214_mazeOK5-1'}...
        ,{'AFR2_180214_cage_noMEC-1','AFR2_180214_cage2_noMEC-1','AFR2_180214_maze-1'}};

nChannels = 256;

for i=1:length(ses)
    for j=1:length(files{i})
    RemoveDCfromDatandReorderXml([dir ses{i} files{i}{j}]);
    ResampleBinary([dir ses{i} '\' files{i}{j} '_reo.dat'],[dir ses{i} '\' files{i}{j} '_reo.eeg'],nChannels,1,16);
    end
end

