%load_ext autoreload %autoreload 2 %run nb_init.py eptm = lj.Epithelium(graphXMLfile='../saved_graphs/01000_2014-02-19T14_07_40.552058/xml/after_apopto.xml', identifier='01000_2014-02-19T14_07_40.552058') eptm_before = lj.Epithelium(graphXMLfile="../saved_graphs/xml/before_apoptosis.xml", identifier='0', paramfile='../default/params.xml') anisotropies, alignments = eptm.cells.get_anisotropies() # eptm.graph.set_vertex_filter(eptm.is_cell_vert) fig, axes = plt.subplots(2, 1, sharex=True) axes[0].plot(eptm.zeds.fa, anisotropies.fa.clip(0, 4), 'ro', alpha=0.5) axes[1].plot(eptm.zeds.fa, alignments.fa, 'ro', alpha=0.5) eptm.graph.set_vertex_filter(None) axes[1] fig, axes = plt.subplots(2, 1, sharex=True) eptm_before.graph.set_vertex_filter(eptm_before.is_cell_vert) axes[0].plot(eptm_before.zeds.fa, anisotropies_before.fa, 'bo', alpha=0.5) axes[1].plot(eptm_before.zeds.fa, alignments_before.fa, 'bo', alpha=0.5) eptm_before.graph.set_vertex_filter(None) anisotropies_before, alignments_before = eptm_before.cells.get_anisotropies() eptm_before.graph.set_vertex_filter(eptm_before.is_cell_vert) print(anisotropies_before.fa.mean()) print(alignments_before.fa.mean()) eptm_before.graph.set_vertex_filter(None) lj.local_slice(eptm_before, zed_amp=1., theta_amp=np.pi/2, theta_c=0) eptm_before.sigmas.a = eptm_before.thetas.a * eptm_before.rhos.a.mean() ax = lj.draw_polygons(eptm_before, eptm_before.zeds, eptm_before.sigmas, colors=anisotropies_before, efilt=eptm_before.is_local_edge, vfilt=eptm_before.is_local_vert) lj.local_slice(eptm, zed_amp=15., theta_amp=np.pi/2, theta_c=0) #eptm.update_rhotheta() ax = lj.draw_polygons(eptm, eptm.zeds, eptm.sigmas, colors=alignments, efilt=eptm.is_local_edge, vfilt=eptm.is_local_vert) fig, ax = plt.subplots() ax.plot(eptm.zeds.a, eptm.contractile_grad.a, 'o') lj.draw_polygons(eptm, eptm.zeds, eptm.thetas, colors=eptm.contractile_grad.a) eptm.graph.set_vertex_filter(None) eptm.graph.set_vertex_filter(eptm.is_cell_vert) fig, ax = plt.subplots() ax.plot(eptm.zeds.fa, eptm.cells.areas.fa, 'o', alpha=0.4) eptm.graph.set_vertex_filter(None) eptm.set_local_mask(None) lj.running_local_optimum(eptm, 1e-4) lj.draw(eptm, output3d='tissue_2d.png')