function img = InvCurvWrapPyramid(cpyr) % CurvWrapPyramid - returns an image containing the curvelet coefficients pyramid and the locations of the 4 cardinal angular sectors. % All angular wedge are packed into one angular subband. All atoms are normalized to a unit l2 norm. % % Inputs % pyr Cell array of angular sectors pyramid (EAST, WEST, NORTH, SOUTH). % % Outputs % img Recontructed image % nbscales = length(cpyr); m = cpyr{end}{2}(1); n = cpyr{end}{2}(2); % Compute norm of curvelets (exact) F = ones(m,n); X = fftshift(ifft2(F)) * sqrt(prod(size(F))); % Appropriately normalized Dirac C = fdct_wrapping(X,1,nbscales); % Get the curvelets E = cell(size(C)); for j=1:length(C) E{j} = cell(size(C{j})); for w=1:length(C{j}) A = C{j}{w}; E{j}{w} = sqrt(sum(sum(A.*conj(A))) / prod(size(A))); end end C{1} = cpyr{end}; for sc=2:nbscales nd = length(C{sc})/4; wcnt = 0; [p,q] = size(cpyr{sc-1}.NORTH); for w=1:nd C{sc}{wcnt+w} = cpyr{sc-1}.NORTH(:,(w-1)*q/nd+1:w*q/nd); end wcnt = wcnt+nd; for w=1:nd C{sc}{wcnt+w} = cpyr{sc-1}.EAST((w-1)*q/nd+1:w*q/nd,:); end wcnt = wcnt+nd; for w=1:nd C{sc}{wcnt+w} = cpyr{sc-1}.SOUTH(:,q-w*q/nd+1:q-(w-1)*q/nd); end wcnt = wcnt+nd; for w=1:nd C{sc}{wcnt+w} = cpyr{sc-1}.WEST(q-w*q/nd+1:q-(w-1)*q/nd,:); end wcnt = wcnt+nd; for w = 1:length(C{sc}) C{sc}{w} = C{sc}{w}*E{sc}{w}; %imagesc(C{sc}{w}-Cori{sc}{w});axis image;rmaxis;colorbar; %title(sprintf('sc=%d w=%d',sc,w)); %drawnow %pause end end img = real(ifdct_wrapping(C,1,nbscales)); % % Part of DBlockToolbox Version:100 % Written by: Jalal Fadili, GREYC CNRS ENSICAEN % Christophe Chesneau, LMNO University of Caen % Jean-Luc Starck, CEA-CNRS % Created June 2008 % This material is distributed under CeCiLL licence. % E-mail: Jalal.Fadili@greyc.ensicaen.fr %