%Shape adaptive DWT implementation used from QCC Pack by James E. Fowler
%http://qccpack.sourceforge.net/index.shtml

function [output, label] = inverse_SA_DWT_full_decomposition(input, original_label, number_of_decompositions)

%label = spatial_label_computation(original_label, number_of_decompositions);

[r,c,k] = size(input);
%output = zeros(r,c,k);

buffer_input = input;
output = input;

icpwrite('label.icp', original_label);
icpwrite('dwt_input.icp', buffer_input);
nl = num2str(number_of_decompositions);

dos_string = ['icptosbp ', nl, ' dwt_input.icp dwt_output.icp'];
dos(dos_string);
%write_dwt('dwt_output.icp', buffer_input, number_of_decompositions);
%nl = num2str(number_of_decompositions);
dos_string = ['imgidwt -m label.icp dwt_output.icp decomp_output.icp'];
%dos_string = ['imgidwt dwt_output.icp decomp_output.icp'];
dos(dos_string);

output = icpread('decomp_output.icp');

%label = [];
%rows_label = [];

end
