Home > phiwave > @phiw_wvimg > private > pr_procsubs.m

pr_procsubs

PURPOSE ^

returns elements and processed subs arg for indexing

SYNOPSIS ^

function [blks, subs, sz] = pr_procsubs(wvlt,imsz,scales,subs)

DESCRIPTION ^

 returns elements and processed subs arg for indexing
 FORMAT [blks, subs, sz] = pr_procsubs(wvlt,imsz,scales,subs)

 $Id: pr_procsubs.m,v 1.1 2005/06/05 04:17:42 matthewbrett Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [blks, subs, sz] = pr_procsubs(wvlt,imsz,scales,subs)
0002 % returns elements and processed subs arg for indexing
0003 % FORMAT [blks, subs, sz] = pr_procsubs(wvlt,imsz,scales,subs)
0004 %
0005 % $Id: pr_procsubs.m,v 1.1 2005/06/05 04:17:42 matthewbrett Exp $
0006 
0007 if nargin < 4
0008   error('Need four args')
0009 end
0010 
0011 % levels, quadrants
0012 [tmp qs nquads] = levels(wvlt,imsz,scales);
0013 
0014 % deal with ':', logical and indices addressing
0015 fullinds = {1:scales+1, 1:nquads-1};
0016 if length(subs) < 2
0017   subs{2} = ':';
0018 end
0019 for i = 1:2
0020   if subs{i} == ':'
0021     subs{i} = fullinds{i};
0022   end
0023   subs{i} = fullinds{i}(subs{i});
0024 end
0025 
0026 blks = [];
0027 for l = subs{1}
0028   if l > scales
0029     if any(subs{2}==1)
0030       blks = [blks qs{l}];
0031     end
0032   else
0033     for q = subs{2}
0034       blks = [blks qs{l}(q)];
0035     end
0036   end
0037 end
0038 
0039 % get size
0040 bno = length(blks);
0041 sz = zeros(bno,1);
0042 for b = 1:bno
0043   sz(b) = phiw_lims('size', blks{b});
0044 end

Generated on Wed 06-Jul-2005 18:07:21 by m2html © 2003