function [] = applyVideo_memory(dataloc, savedir, vidname, datName, searchstr) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Apply the registration coordinates to a video. Modified for use %with the pipeline where the peaks of the correlation points are all %calculated and the path drawn after running NoRMCorre. Biggest difference %is that the solution comes from a single run of NoRMCorre (rather than %combining no memory and memory results). % Inputs: % - dataloc: the directory where the data is stored % - vidname: Name of the video to be registered % - datName: Name of the directory the data is stored in if h5 % - searchstr: The string to search for to find the registration data % Output: (none) % - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cd(dataloc) display('Added directories and moved') endloc = strfind(vidname, 'Green'); %Generate the output video name outputName = strcat(savedir, vidname(1:(endloc+4)), '_appliedRegistration.h5'); a = dir(outputName); %Apply registration to the video if it hasn't already been done under the %output video name if isempty(a) regMatName = dir(strcat(savedir, vidname(1:endloc), '*', searchstr)); regMatName = strcat(savedir, regMatName.name); applyIterativeReg_memory(vidname, datName, regMatName, outputName) end end