


strCollectAttr collect frame attribute from a framesource
attr = srcCollectAttr( src, attrnames... )
src -- frame source
attrnames -- names of attributes
attr -- struct with fields corresponding to the attributes

0001 function attr = srcCollectAttr( src, varargin ) 0002 %strCollectAttr collect frame attribute from a framesource 0003 % attr = srcCollectAttr( src, attrnames... ) 0004 % src -- frame source 0005 % attrnames -- names of attributes 0006 % attr -- struct with fields corresponding to the attributes 0007 0008 if ischar(src) 0009 src = evalin(src,'caller'); 0010 end 0011 sdcr = srcGetDcr(src); 0012 for k=1:sdcr.N 0013 imgs = srcGetFr( src, k ); 0014 res = struct; 0015 for fi=1:length(varargin) 0016 fn = varargin{fi}; 0017 res = setfield( res, fn, getfield( imgs{1}.imgs(1), fn ) ); 0018 end 0019 attr(k)=res; 0020 end