function [] = groupSimVal(simFolder, regFolder, saveName) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Validation for NoRMCorre on simulated data by comparing to the ground %truth % Inputs: % - simFolder: Folder containing the simulated videos % - regFolder: str of the folder name containing the registered version % of the video % - saveName: name of the .mat file to save the data to % Outputs: (none) % - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cd(simFolder) simVid = dir('simulated data*.mat'); % Go through each video and calculate the difference between the ground % truth movement and the movement calculated using NoRMCorre. for fn = 1:length(simVid) simdata = strcat(simFolder, simVid(fn).name); simName = simVid(fn).name; IDind = strfind(simName, '_'); cd(regFolder) ID{fn} = simName((IDind+1):(end-4)); regName = dir(strcat('*', ID{fn}, '*associated.mat')); regdata = strcat(regFolder, regName(1).name); [X{fn}, Y{fn}, eucdist{fn}, MSEeu{fn}, timeoff{fn}, maxErr{fn}] = validateSimulationRegistration(simdata, regdata); save(saveName, 'X', 'Y', 'simVid', 'eucdist', 'MSEeu', 'timeoff', 'maxErr', 'ID'); end end