wolffd@0: function mk_ps_from_clqs(dbn, T, cliques, dir) wolffd@0: wolffd@0: % Draw multiple copies of the DBN, wolffd@0: % and indicate the nodes in each clique by shading the nodes. wolffd@0: % Generate a series of color postscript files, wolffd@0: % or, if dir=[], displays them to the screen and pauses. wolffd@0: wolffd@0: if isempty(dir) wolffd@0: print_to_file = 0; wolffd@0: else wolffd@0: print_to_file = 1; wolffd@0: end wolffd@0: wolffd@0: if print_to_file, cd(dir), end wolffd@0: flip = 1; wolffd@0: clf; wolffd@0: [dummyx, dummyy, h] = draw_dbn(dbn.intra, dbn.inter, flip, T, -1); wolffd@0: wolffd@0: C = length(cliques); wolffd@0: wolffd@0: % nodes = []; wolffd@0: % for i=1:C wolffd@0: % cl = cliques{i}; wolffd@0: % nodes = [nodes cl(:)']; wolffd@0: % end wolffd@0: %nodes = unique(nodes); wolffd@0: ss = length(dbn.intra); wolffd@0: nodes = 1:(ss*T); wolffd@0: wolffd@0: for c=1:C wolffd@0: for i=cliques{c} wolffd@0: set(h(i,2), 'facecolor', 'r'); wolffd@0: end wolffd@0: rest = mysetdiff(nodes, cliques{c}); wolffd@0: for i=rest wolffd@0: set(h(i,2), 'facecolor', 'w'); wolffd@0: end wolffd@0: if print_to_file wolffd@0: print(gcf, '-depsc', sprintf('clq%d.ps', c)) wolffd@0: else wolffd@0: disp(['clique ' num2str(c) ' = ' num2str(cliques{c}) '; hit key for next']) wolffd@0: pause wolffd@0: end wolffd@0: end