function [cshift] = convertPeaks(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); [d1, d2, d3, d4, d5] = size(shifts_nr); shifts_nr = reshape(shifts_nr,[], d3, 2, nf); cshift.x = squeeze(shifts_nr(:,:,2,:)); cshift.y = squeeze(shifts_nr(:,:,1,:)); end