inverts wt data using wavelet transform w, up to scales FORMAT data = invert(wimg, w, scales, oimgi) Input wimg - wavelet transformed data to invert - up to 3 dimensions w - wavelet object specifying transform scales - degree of coursest scale oimgi - index limits to retrieve original data from (inverted) wimg if specified, returns data matrix in original size if not, get data embedded in wt size matrix Output data - wavelet inverted data, in resized data matrix if necessary $Id: invert.m,v 1.4 2005/06/05 04:42:22 matthewbrett Exp $
0001 function data = invert(wimg, w, scales, oimgi) 0002 % inverts wt data using wavelet transform w, up to scales 0003 % FORMAT data = invert(wimg, w, scales, oimgi) 0004 % 0005 % Input 0006 % wimg - wavelet transformed data to invert - up to 3 dimensions 0007 % w - wavelet object specifying transform 0008 % scales - degree of coursest scale 0009 % oimgi - index limits to retrieve original data from (inverted) wimg 0010 % if specified, returns data matrix in original size 0011 % if not, get data embedded in wt size matrix 0012 % 0013 % Output 0014 % data - wavelet inverted data, in resized data matrix if necessary 0015 % 0016 % $Id: invert.m,v 1.4 2005/06/05 04:42:22 matthewbrett Exp $ 0017 0018 if nargin < 4 0019 oimgi = []; % do not reembed in original matrix 0020 end 0021 0022 wdims = size(wimg); 0023 numdims = pr_ndims2(wdims); 0024 0025 % interting transform 0026 levs = levels(w, wdims, scales); 0027 for d = 1:numdims 0028 [t1 t2 RH{d} RG{d}] = get_filters(w,wdims(d)); 0029 end 0030 0031 % in (up to) 3d 0032 wimg = iwtnd(wimg, RH, RG, scales); 0033 0034 % restore to original dimensions as necessary 0035 if ~isempty(oimgi) 0036 data = subsref(wimg, phiw_lims('subs', oimgi)); 0037 else 0038 data = wimg; 0039 end 0040 0041 return 0042 0043 0044