示例#1
0
    def test_calc_lfp_soma_as_point_moi_doubling(self):
        """
        Test that slice with zero conductivity in MEA region (z<0) has twice
        the potential as in vivo case at MEA electrode plane
        """
        sigma_T = 0.3
        sigma_G = 0.0
        sigma_S = 0.3
        h = 200
        steps = 3

        cell = TestCell()
        cell.zstart[0] = 50
        cell.zmid[0] = 50
        cell.zend[0] = 50

        in_vivo = lfpcalc.calc_lfp_soma_as_point(cell,
                                x=50., y=0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)
        in_vitro = lfpcalc.calc_lfp_soma_as_point_moi(cell,
                                x=50, y=0, z=0, sigma_T=sigma_T,
                                sigma_G=sigma_G, sigma_S=sigma_S,
                                r_limit=cell.diam/2, h=h, steps=steps)

        np.testing.assert_almost_equal(2*in_vivo, in_vitro, decimal=9)
    def test_calc_lfp_soma_as_point_moi_doubling(self):
        """
        Test that slice with zero conductivity in MEA region (z<0) has twice
        the potential as in vivo case at MEA electrode plane
        """
        sigma_T = 0.3
        sigma_G = 0.0
        sigma_S = 0.3
        h = 200
        steps = 3

        cell = DummyCell()
        cell.zstart[0] = 50
        cell.zmid[0] = 50
        cell.zend[0] = 50

        in_vivo = lfpcalc.calc_lfp_soma_as_point(cell,
                                x=50., y=0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)
        in_vitro = lfpcalc.calc_lfp_soma_as_point_moi(cell,
                                x=50, y=0, z=0, sigma_T=sigma_T,
                                sigma_G=sigma_G, sigma_S=sigma_S,
                                r_limit=cell.diam/2, h=h, steps=steps)

        np.testing.assert_almost_equal(2*in_vivo, in_vitro, decimal=9)
示例#3
0
    def test_calc_lfp_soma_as_point_moi_too_close(self):
        """
        Very close to point source, in vivo and in vitro have similar results,
        e.g., the positions should be adjusted similarly.
        """
        sigma_T = 0.3
        sigma_G = 0.0
        sigma_S = 1.5
        h = 2000
        steps = 20
        cell = TestCell()
        cell.zmid[0] = 0
        cell.zstart[0] = 0
        cell.zend[0] = 0

        in_vivo = lfpcalc.calc_lfp_soma_as_point(cell,
                                                 x=0.0,
                                                 y=0,
                                                 z=0,
                                                 sigma=sigma_T,
                                                 r_limit=cell.diam / 2)
        in_vitro = lfpcalc.calc_lfp_soma_as_point_moi(cell,
                                                      x=0.0,
                                                      y=0,
                                                      z=0,
                                                      sigma_T=sigma_T,
                                                      sigma_G=sigma_G,
                                                      sigma_S=sigma_S,
                                                      r_limit=cell.diam / 2,
                                                      h=h,
                                                      steps=steps)

        np.testing.assert_almost_equal(2 * in_vivo, in_vitro, 4)
示例#4
0
    def test_calc_lfp_soma_as_point_moi_too_close(self):
        """
        Very close to point source, in vivo and in vitro have similar results,
        e.g., the positions should be adjusted similarly.
        """
        sigma_T = 0.3
        sigma_G = 0.0
        sigma_S = 1.5
        h = 2000
        steps = 20
        cell = TestCell()
        cell.zmid[0] = 0
        cell.zstart[0] = 0
        cell.zend[0] = 0

        in_vivo = lfpcalc.calc_lfp_soma_as_point(cell,
                                x=0.0, y=0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)
        in_vitro = lfpcalc.calc_lfp_soma_as_point_moi(cell,
                                x=0.0, y=0, z=0, sigma_T=sigma_T,
                                sigma_G=sigma_G, sigma_S=sigma_S,
                                r_limit=cell.diam/2, h=h, steps=steps)

        np.testing.assert_almost_equal(2*in_vivo, in_vitro, 4)