function T1_display % Displays two plots, showing the arrangement of cells before and after a % T1 event. The cells participating in the T1 event are represented by the % variables 'nbr_slp_0' and 'nbr_slp_1' % %For bugs, comments, etc. please contact Kapil Krishan : %kkrishan@uci.edu %www.physics.uci.edu/~foams %version: I filename='image0.bmp';pathname='../images/'; [P_0,filename,pathname,Params]=centers_list(filename,pathname,struct([]),'ON'); center_positions_0=P_0(:,[2 3]); [V_0,E_0,C_0,bdry_cells_0]=vertex_edges_cells(center_positions_0); neighbor_region=30; [N_0,NN_0,NC_0]=neighbors(C_0, center_positions_0, neighbor_region); filename='image1.bmp';pathname='../images/'; [P_1,filename,pathname,Params]=centers_list(filename,pathname,Params,'ON'); center_positions_1=P_1(:,[2 3]); [V_1,E_1,C_1,bdry_cells_1]=vertex_edges_cells(center_positions_1); neighbor_region=30; [N_1,NN_1,NC_1]=neighbors(C_1, center_positions_1, neighbor_region); reg_of_motion=10*[1 1]; mapping=two_frame_mapping(P_0,P_1,reg_of_motion); mapping=elim_bdry(mapping,bdry_cells_0,bdry_cells_1); N_0=N_0(mapping(:,1),mapping(:,1)); NN_0=NN_0(mapping(:,1),mapping(:,1)); N_1=N_1(mapping(:,2),mapping(:,2)); NN_1=NN_1(mapping(:,2),mapping(:,2)); nbr_slp_0=T1_event(N_1,NN_0); nbr_slp_1=T1_event(N_0,NN_1); i_or_f=1;plot_T1(C_0,V_0,bdry_cells_0,mapping,nbr_slp_0,E_0,i_or_f); i_or_f=2;plot_T1(C_1,V_1,bdry_cells_1,mapping,nbr_slp_0,E_1,i_or_f); function plot_T1(C,V,bdry_cells,mapping,nbr_slp,E,i_or_f) col_t1=9; figure; hold on; for ic=1:size(E,1) line([V(E(ic,1),1) V(E(ic,2),1)],[V(E(ic,1),2) V(E(ic,2),2)],'color',[0 0 0]); end;drawnow; cmp=[1 1 1;1 1 1; 0 1 1;0 0.5 0; 1 1 0;0.8 0.8 0.8; 0 1 1; 1 0.5 0.2; 0.2 0.5 0.5; 1 0 0;0 0 1]; colormap(cmp); hold on; for i = 1:length(C) if all(C{i}~=1) % If at least one of the indices is 1, % then it is an open region and we can't % patch that. patch(V(C{i},1),V(C{i},2),6+0*size(C{i},2),'CDataMapping','direct'); % use color '# of sides' end end for i=bdry_cells' if all(C{i}~=1) patch(V(C{i},1),V(C{i},2),1,'CDataMapping','direct'); % use color bdry. end end for i=1:size(nbr_slp,2) if prod(size(nbr_slp{i}))>0 cell_n=mapping(i,i_or_f); patch(V(C{cell_n},1),V(C{cell_n},2),10,'CDataMapping','direct'); % use color bdry. for nbrs=mapping(nbr_slp{i},i_or_f)' patch(V(C{nbrs},1),V(C{nbrs},2),11,'CDataMapping','direct'); % use color bdry. end end end axis equal;axis([1 max(V(E,1)) 1 max(V(E,2))]);axis ij;