Home > phiwave > @phiw_wvimg > same_wtinfo.m

same_wtinfo

PURPOSE ^

returns 1 if wtinfo structure matches wvobj

SYNOPSIS ^

function tf = same_wtinfo(wvobj, test_wtinfo)

DESCRIPTION ^

 returns 1 if wtinfo structure matches wvobj
 FORMAT tf = same_wtinfo(wvobj, test_wtinfo)
 
 Input 
 wvobj          - phiw_wvimg object
 test_wtinfo    - wtinfo structure with none or more fields
                   scales
                   wavelet
                   wtprefix

 The function only compares fields passed, so test_wtinfo can contain only
 'scales', or only 'wavelet', for example.  

 Function returns 0 if test_wtinfo is empty

 $Id: same_wtinfo.m,v 1.3 2005/04/06 22:34:01 matthewbrett Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function tf = same_wtinfo(wvobj, test_wtinfo)
0002 % returns 1 if wtinfo structure matches wvobj
0003 % FORMAT tf = same_wtinfo(wvobj, test_wtinfo)
0004 %
0005 % Input
0006 % wvobj          - phiw_wvimg object
0007 % test_wtinfo    - wtinfo structure with none or more fields
0008 %                   scales
0009 %                   wavelet
0010 %                   wtprefix
0011 %
0012 % The function only compares fields passed, so test_wtinfo can contain only
0013 % 'scales', or only 'wavelet', for example.
0014 %
0015 % Function returns 0 if test_wtinfo is empty
0016 %
0017 % $Id: same_wtinfo.m,v 1.3 2005/04/06 22:34:01 matthewbrett Exp $
0018 
0019 tf = 0;
0020 if nargin < 2
0021   error('Need wtinfo to compare');
0022 end
0023 if isempty(test_wtinfo), return, end
0024 
0025 o_wtinfo = wtinfo(wvobj);
0026 fns = fieldnames(test_wtinfo);
0027 for fn = 1:length(fns)
0028   f = fns{fn};
0029   if isfield(o_wtinfo, f)
0030     if getfield(o_wtinfo, f) ~= getfield(test_wtinfo, f), return, end
0031   end
0032 end
0033 tf = 1;

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