In [1]:
%run nb_init.py
In [3]:
eptm = lj.Epithelium(graphXMLfile='../saved_graphs/xml/before_apoptosis.xml',
                     paramfile='../default/params.xml')
In [ ]:
def do_update():
    eptm.update_geometry()
    eptm.update_gradient()
import cProfile
cProfile.run('do_update()')
In [10]:
lj.running_local_optimum(eptm, tol=1e-3)
In [9]:
ax = lj.draw.plot_cells_sz(eptm, text=True)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-9-c4563efe857c> in <module>()
----> 1 ax = lj.draw.plot_cells_sz(eptm, text=True)

AttributeError: 'function' object has no attribute 'plot_cells_sz'
In [4]:
%run ../src/sandbox.py
In [7]:
eptm.graph.save('../saved_graphs/xml/latest.xml')
In [12]:
lj.draw(eptm)
In [12]:
import skimage as si
import skimage.io as io
import scipy.ndimage as ndi  
In [16]:
img0.shape
Out[16]:
(600, 600, 4)
In [32]:
kernel_1c = np.array([[0, 0., 1., 0, 0],
                      [0, 1., 2., 1., 0],
                      [1, 2, 3, 2, 1],
                      [0, 1, 2, 1, 0],
                      [0, 0, 1, 0, 0]])
kernel_1c /= kernel_1c.sum()

kernel = np.zeros((5, 5, 4))
kernel[..., 0] = kernel_1c
kernel[..., 1] = kernel_1c
kernel[..., 2] = kernel_1c
In [33]:
kernel
Out[33]:
array([[[ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.05263158,  0.05263158,  0.05263158,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ]],

       [[ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.05263158,  0.05263158,  0.05263158,  0.        ],
        [ 0.10526316,  0.10526316,  0.10526316,  0.        ],
        [ 0.05263158,  0.05263158,  0.05263158,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ]],

       [[ 0.05263158,  0.05263158,  0.05263158,  0.        ],
        [ 0.10526316,  0.10526316,  0.10526316,  0.        ],
        [ 0.15789474,  0.15789474,  0.15789474,  0.        ],
        [ 0.10526316,  0.10526316,  0.10526316,  0.        ],
        [ 0.05263158,  0.05263158,  0.05263158,  0.        ]],

       [[ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.05263158,  0.05263158,  0.05263158,  0.        ],
        [ 0.10526316,  0.10526316,  0.10526316,  0.        ],
        [ 0.05263158,  0.05263158,  0.05263158,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ]],

       [[ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.05263158,  0.05263158,  0.05263158,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ],
        [ 0.        ,  0.        ,  0.        ,  0.        ]]])
In [35]:
import os
dir0 = '../saved_graphs/png/apopto_vr0.90_ctr1.00_rt0.50'

all_pngs = os.listdir(dir0)
all_3ds = [fname for fname in all_pngs if '3d' in fname]
all_3ds.sort()


for fname in all_3ds:
    img0 = io.imread(os.path.join(dir0, fname))
    img1 = (img0 + ndi.convolve(img0, kernel)) / 2.
    io.imsave(os.path.join(dir0, 'comp_'+fname), img1)
    
In [36]:
from skimage import viskskimage
In [ ]:
 
In [5]:
edge_zeds, edge_sigmas, edge_rhos, raw_dsigmas = create_properties(eptm)

eptm.set_edge_state([(eptm.is_junction_edge, False)])
eptm.set_vertex_state([(eptm.is_alive, False)])

period = 2 * np.pi * edge_rhos.fa

abs_ds = np.abs(raw_dsigmas.fa)
first_period_dsigma = raw_dsigmas.fa[abs_ds < period / 2.]
first_period_ez = edge_zeds.fa[abs_ds < period / 2.]

second_period_dsigma = raw_dsigmas.fa[abs_ds > period / 2.]
second_period_ez = edge_zeds.fa[abs_ds > period / 2.]
    
eptm.set_edge_state()
eptm.set_vertex_state()
In [6]:
lj.draw.plot_cells_sz(eptm, text=False)
Out[6]:
<matplotlib.axes.AxesSubplot at 0xb566b2c>
In [12]:
figure()
eptm.set_edge_state([(eptm.is_junction_edge, False)])
eptm.set_vertex_state([(eptm.is_alive, False)])

plot(edge_zeds.fa, eptm.edge_lengths.fa, 'ko', alpha=0.8)
plot(edge_zeds.fa, np.abs(eptm.dzeds.fa), 'bo')

plot(first_period_ez, np.abs(first_period_dsigma), 'ro')
plot(second_period_ez, np.abs(second_period_dsigma), 'go')
Out[12]:
[<matplotlib.lines.Line2D at 0xc7ffc2c>]
In [16]:
figure()
h = plt.hist(eptm.edge_lengths.fa, bins=20, alpha=0.5)
h = plt.hist(np.abs(first_period_dsigma), bins=20, alpha=0.5)
h = plt.hist(np.abs(eptm.dzeds.fa), bins=20, alpha=0.5)