0001 function R = subsref(obj, s)
0002
0003
0004
0005
0006 if nargin < 2
0007 error('Crazy no of args')
0008 end
0009
0010 switch s(1).type
0011 case '.'
0012
0013 if strcmp(s(1).subs, 'img') & ~isproc(obj)
0014 error('The object is not processed yet')
0015 end
0016
0017 R = builtin('subsref', obj, s);
0018 case '{}'
0019
0020
0021 error('Cell subscripting not valid for wvimg objects')
0022 case '()'
0023
0024 if length(s) > 1
0025 error('Complicated subscripting')
0026 end
0027
0028
0029 if ~isproc(obj)
0030 error('The object is not processed yet')
0031 end
0032
0033 nsubs = length(s.subs);
0034 if all([s.subs{:}]==':')
0035 R = obj.img;
0036 if nsubs ~= 3
0037 R = R(:);
0038 end
0039 return
0040 elseif nsubs == 3
0041 R = subsref(obj.img,s);
0042 return
0043 end
0044 [blks s.subs sz] = pr_procsubs(obj.wavelet,obj.wvol.dim(1:3),obj.scales, ...
0045 s.subs);
0046 R = zeros(sum(sz),1);
0047 iR = 1;
0048 for b = 1:length(blks)
0049 e = iR + sz(b);
0050 R(iR:e-1) = subsref(obj.img, phiw_lims('subs', blks{b}));
0051 iR = e;
0052 end
0053 end