[191c94]: wavelets / wfbtmanip / nodesDForder.m Maximize Restore History

Download this file

nodesDForder.m    31 lines (27 with data), 711 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function nodesIdxs = nodesDForder(wt,varargin)
%NODESBFORDER Nodes in the Breadth-First search order
% Usage: nodesIdxs = nodesBForder(treeStruct)
%
% Input parameters:
% treeStruct : Structure containing description of the filter tree.
%
% Output parameters:
% nodesIdxs : Node indexes in the Breadth-First search order.
%
% `nodesBForder(treeStruct)` For definition of the structure see
% `wfbinit`.
%
% Supported flags:
%
% 'ord','rev'
%
% See also: wfbtinit
%
%find root
nodeNo = find(wt.parents==0);
nodesIdxs = [nodeNo,nodeSubtreeDF(nodeNo,wt)];
if(~isempty(varargin))
if(strcmpi(varargin{1},'rev'))
nodesIdxs = nodesIdxs(end:-1:1);
end
end