function [] = applyVideo(dataloc, savedir, vidname, datName, searchstr) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Apply the registration coordinates to a video within a folder % 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 = fullfile(vidname, 'Green'); %Generate the output video names outputName = fullfile(savedir, strcat(vidname(1:(endloc+4)), '_appliedRegistration.h5')); a = dir(outputName); %Apply registration to the video if isempty(a) regMatName = dir(strcat(savedir, vidname(1:endloc), '*', searchstr)); regMatName = strcat(savedir, regMatName.name); applyIterativeReg(vidname, datName, regMatName, outputName) end end