function [cshift] = convertShifts(shifts) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %compares the output results from the multistage registration % Inputs: % - shifts: the output from NormCorre % Output: % - cshift: the shifts converted to a struct containing the x and y % movement and the upsampled movement %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [s1 s2 s3 s4] = size(shifts(1).shifts); nf = length(shifts); shifts_nr = cat(ndims(shifts(1).shifts)+1,shifts(:).shifts); shifts_nr = reshape(shifts_nr,[], 2, nf); cshift.x = squeeze(shifts_nr(:,2,:))'; cshift.y = squeeze(shifts_nr(:,1,:))'; end