% close all;
% clear all;
% alpha1 = 1;
% alpha2 = 1;
% lsi53 = {'p', [-0.5 -0.5], [1], [0];'u', [0.25 0.25], [0], [0]; [alpha1], [alpha2], [], []};
% filename = 'barbara.pgm';
% J = 5;
% imagedata = double(imread(filename));
% % imagedata = zeros(256,256);
% 
% y = Lifting2D(imagedata, J, lsi53);
% coeff53 = dwtcell2arr(y, J);
% M = max(max(abs(coeff53)))
% fid = fopen('e:\\coeff','w');
% fwrite(fid, coeff53', 'int32');
% fclose(fid);

% fid = fopen('e:\\coeff_r','r');
% coeff_r = fread(fid,[512,512],'int32');
% coeff_r=coeff_r';
% fclose(fid);

% y_r = dwtarr2cell(coeff53, J);

% y{J}{1}(15,5)=0;
% y{J}{2}(15,15)=100;
% y{J}{3}(15,25)=100;
% y_r = y;
% 
recimage = iLifting2D(y_r, J, lsi53);
% psnr = calcpsnr(recimage, imagedata)
figure;
imshow(recimage, [])