def test_calc_lfp_linesource_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_linesource(cell,
                                x=50., y=0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)
        in_vitro = lfpcalc.calc_lfp_linesource_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)
Esempio n. 2
0
    def test_calc_lfp_linesource_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_linesource(cell,
                                x=50., y=0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)
        in_vitro = lfpcalc.calc_lfp_linesource_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)
Esempio n. 3
0
    def test_lfpcalc_calc_lfp_linesource_moi_00(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 = 0.3
        h = 200

        steps = 20
        cell = DummyCell()

        in_vivo = lfpcalc.calc_lfp_linesource(cell,
                                              x=0.5,
                                              y=0,
                                              z=0,
                                              sigma=sigma_T,
                                              r_limit=cell.d / 2)
        in_vitro = lfpcalc.calc_lfp_linesource_moi(cell,
                                                   x=0.5,
                                                   y=0,
                                                   z=0,
                                                   sigma_T=sigma_T,
                                                   sigma_G=sigma_G,
                                                   sigma_S=sigma_S,
                                                   r_limit=cell.d / 2,
                                                   h=h,
                                                   steps=steps)

        np.testing.assert_almost_equal(2 * in_vivo, in_vitro, 4)
Esempio n. 4
0
    def test_calc_lfp_linesource_too_close(self):
        """
        Test that calc_lfp_linesource method does not give infinite potential
        """
        sigma_T = 0.3
        cell = TestCell()
        cell.zmid[0] = 0.0
        cell.zstart[0] = 0.0
        cell.zend[0] = 0.0

        in_vivo = lfpcalc.calc_lfp_linesource(cell,
                                x=0.5, y=0.0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)[0]
        np.testing.assert_array_less(in_vivo, 1e12)
    def test_calc_lfp_linesource_too_close(self):
        """
        Test that calc_lfp_linesource method does not give infinite potential
        """
        sigma_T = 0.3
        cell = DummyCell()
        cell.zmid[0] = 0.0
        cell.zstart[0] = 0.0
        cell.zend[0] = 0.0

        in_vivo = lfpcalc.calc_lfp_linesource(cell,
                                x=0.5, y=0.0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)[0]
        np.testing.assert_array_less(in_vivo, 1e12)
Esempio n. 6
0
    def test_lfpcalc_calc_lfp_linesource_00(self):
        """
        Test that calc_lfp_linesource method does not give infinite potential
        """
        sigma_T = 0.3
        cell = DummyCell()

        in_vivo = lfpcalc.calc_lfp_linesource(cell,
                                              x=0.5,
                                              y=0.0,
                                              z=0,
                                              sigma=sigma_T,
                                              r_limit=cell.d / 2)[0]
        np.testing.assert_array_less(in_vivo, 1e12)
Esempio n. 7
0
    def test_calc_lfp_linesource_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 = 0.3
        h = 200

        steps = 20
        cell = TestCell()
        cell.zstart[0] = 0.0
        cell.zend[0] = 0.0

        in_vivo = lfpcalc.calc_lfp_linesource(cell,
                                x=0.5, y=0, z=0, sigma=sigma_T,
                                r_limit=cell.diam/2)
        in_vitro = lfpcalc.calc_lfp_linesource_moi(cell,
                                x=0.5, 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)