Пример #1
0
    def setUp(self):
        xx_ele, yy_ele, zz_ele = utils.generate_electrodes(dim=3, res=5,
                                                           xlims=[0.15, 0.85],
                                                           ylims=[0.15, 0.85],
                                                           zlims=[0.15, 0.85])
        self.ele_pos = np.vstack((xx_ele, yy_ele, zz_ele)).T
        self.csd_profile = utils.gauss_3d_dipole
        pots = CSD.generate_lfp(self.csd_profile, xx_ele, yy_ele, zz_ele)
        self.pots = np.reshape(pots, (-1, 1))
        self.test_method = 'KCSD3D'
        self.test_params = {'gdx': 0.05, 'gdy': 0.05, 'gdz': 0.05,
                            'lambd': 5.10896977451e-19, 'src_type': 'step',
                            'R_init': 0.31, 'xmin': 0., 'xmax': 1., 'ymin': 0.,
                            'ymax': 1., 'zmin': 0., 'zmax': 1.}

        temp_signals = []
        for ii in range(len(self.pots)):
            temp_signals.append(self.pots[ii])
        self.an_sigs = neo.AnalogSignal(temp_signals * pq.mV,
                                       sampling_rate=1000 * pq.Hz)
        chidx = neo.ChannelIndex(range(len(self.pots)))
        chidx.analogsignals.append(self.an_sigs)
        chidx.coordinates = self.ele_pos * pq.mm

        chidx.create_relationship()
Пример #2
0
 def setUp(self):
     xx_ele, yy_ele, zz_ele = utils.generate_electrodes(dim=3)
     self.lfp = csd.generate_lfp(utils.gauss_3d_dipole,
                                 xx_ele, yy_ele, zz_ele)
     self.params = {}
     self.params['KCSD3D'] = {'gdx': 0.1, 'gdy': 0.1, 'gdz': 0.1,
                              'src_type': 'step',
                              'Rs': np.array((0.1, 0.25, 0.5))}
Пример #3
0
    def setUp(self):
        self.ele_pos = utils.generate_electrodes(dim=1).reshape(5, 1)
        self.lfp = csd.generate_lfp(utils.gauss_1d_dipole, self.ele_pos)
        self.csd_method = csd.estimate_csd

        self.params = {}  # Input dictionaries for each method
        self.params['DeltaiCSD'] = {'sigma_top': 0. * pq.S / pq.m,
                                    'diam': 500E-6 * pq.m}
        self.params['StepiCSD'] = {'sigma_top': 0. * pq.S / pq.m, 'tol': 1E-12,
                                   'diam': 500E-6 * pq.m}
        self.params['SplineiCSD'] = {'sigma_top': 0. * pq.S / pq.m,
                                     'num_steps': 201, 'tol': 1E-12,
                                     'diam': 500E-6 * pq.m}
        self.params['StandardCSD'] = {}
        self.params['KCSD1D'] = {'h': 50., 'Rs': np.array((0.1, 0.25, 0.5))}
Пример #4
0
 def setUp(self):
     self.ele_pos = utils.generate_electrodes(dim=1).reshape(5, 1)
     self.csd_profile = utils.gauss_1d_dipole
     pots = CSD.generate_lfp(self.csd_profile, self.ele_pos)
     self.pots = np.reshape(pots, (-1, 1))
     self.test_method = 'KCSD1D'
     self.test_params = {'h': 50.}
     self.an_sigs = []
     for ii in range(len(self.pots)):
         rc = neo.RecordingChannel()
         rc.coordinate = self.ele_pos[ii] * pq.mm
         asig = neo.AnalogSignal(self.pots[ii] * pq.mV,
                                 sampling_rate=1000 * pq.Hz)
         rc.analogsignals = [asig]
         rc.create_relationship()
         self.an_sigs.append(asig)
Пример #5
0
    def setUp(self):
        self.ele_pos = utils.generate_electrodes(dim=1).reshape(5, 1)
        self.csd_profile = utils.gauss_1d_dipole
        pots = CSD.generate_lfp(self.csd_profile, self.ele_pos)
        self.pots = np.reshape(pots, (-1, 1))
        self.test_method = 'KCSD1D'
        self.test_params = {'h': 50.}

        temp_signals = []
        for ii in range(len(self.pots)):
            temp_signals.append(self.pots[ii])
        self.an_sigs = neo.AnalogSignal(temp_signals * pq.mV,
                                       sampling_rate=1000 * pq.Hz)
        chidx = neo.ChannelIndex(range(len(self.pots)))
        chidx.analogsignals.append(self.an_sigs)
        chidx.coordinates = self.ele_pos * pq.mm

        chidx.create_relationship()
Пример #6
0
 def setUp(self):
     xx_ele, yy_ele = utils.generate_electrodes(dim=2, res=9,
                                                xlims=[0.05, 0.95],
                                                ylims=[0.05, 0.95])
     self.ele_pos = np.vstack((xx_ele, yy_ele)).T
     self.csd_profile = utils.large_source_2D
     pots = CSD.generate_lfp(self.csd_profile, xx_ele, yy_ele, res=100)
     self.pots = np.reshape(pots, (-1, 1))
     self.test_method = 'KCSD2D'
     self.test_params = {'gdx': 0.25, 'gdy': 0.25, 'R_init': 0.08,
                         'h': 50., 'xmin': 0., 'xmax': 1.,
                         'ymin': 0., 'ymax': 1.}
     self.an_sigs = []
     for ii in range(len(self.pots)):
         rc = neo.RecordingChannel()
         rc.coordinate = self.ele_pos[ii] * pq.mm
         asig = neo.AnalogSignal(self.pots[ii] * pq.mV,
                                 sampling_rate=1000 * pq.Hz)
         rc.analogsignals = [asig]
         rc.create_relationship()
         self.an_sigs.append(asig)
Пример #7
0
 def test_lfp3d_electrodes(self):
     ele_pos = utils.generate_electrodes(dim=3, res=3)
     xx_ele, yy_ele, zz_ele = ele_pos
     lfp = csd.generate_lfp(utils.gauss_3d_dipole, xx_ele, yy_ele, zz_ele)
     self.assertEqual(len(ele_pos), 3)
     self.assertEqual(xx_ele.shape[0], lfp.shape[1])
Пример #8
0
 def test_lfp2d_electrodes(self):
     ele_pos = utils.generate_electrodes(dim=2)
     xx_ele, yy_ele = ele_pos
     lfp = csd.generate_lfp(utils.large_source_2D, xx_ele, yy_ele)
     self.assertEqual(len(ele_pos), 2)
     self.assertEqual(xx_ele.shape[0], lfp.shape[1])
Пример #9
0
 def test_lfp1d_electrodes(self):
     ele_pos = utils.generate_electrodes(dim=1).reshape(5, 1)
     lfp = csd.generate_lfp(utils.gauss_1d_dipole, ele_pos)
     self.assertEqual(ele_pos.shape[1], 1)
     self.assertEqual(ele_pos.shape[0], lfp.shape[1])
Пример #10
0
 def setUp(self):
     xx_ele, yy_ele = utils.generate_electrodes(dim=2)
     self.lfp = csd.generate_lfp(utils.large_source_2D, xx_ele, yy_ele)
     self.params = {}  # Input dictionaries for each method
     self.params['KCSD2D'] = {'sigma': 1., 'Rs': np.array((0.1, 0.25, 0.5))}