Beispiel #1
0
def test_as_point():
    p = as_point([1, 2, 3, 4, 5, 6, 7])
    nt.ok_(p.x == 1)
    nt.ok_(p.y == 2)
    nt.ok_(p.z == 3)
    nt.ok_(p.r == 4)
    nt.ok_(p.t == 5)
Beispiel #2
0
def test_as_point():
    p = as_point([1, 2, 3, 4, 5, 6, 7])
    nt.ok_(p.x == 1)
    nt.ok_(p.y == 2)
    nt.ok_(p.z == 3)
    nt.ok_(p.r == 4)
    nt.ok_(p.t == 5)
Beispiel #3
0
 def get_point(self, idx):
     '''Get point data for element idx'''
     idx = self._apply_offset(idx)
     p = as_point(self.data_block[idx]) if idx > ROOT_ID else None
     return p
Beispiel #4
0
 def get_point(self, idx):
     '''Get point data for element idx'''
     idx = self._apply_offset(idx)
     p = as_point(self.data_block[idx]) if idx > ROOT_ID else None
     return p
Beispiel #5
0
    init_seg_ids = get_initial_segment_ids(rd)

    trees = [make_tree(rd, sg) for sg in init_seg_ids]

    soma = neuron.make_soma([rd.get_row(si) for si in get_soma_ids(rd)])

    for tr in trees:
        for p in point_iter(tree.ipreorder(tr)):
            print p

    print 'Initial segment IDs:', init_seg_ids

    nrn = neuron.Neuron(soma, trees)

    print 'Neuron soma raw data', [r for r in nrn.soma.iter()]
    print 'Neuron soma points', [as_point(p) for p in nrn.soma.iter()]

    print 'Neuron tree init points, types'
    for tt in nrn.neurites:
        print tt.value[COLS.ID], tt.value[COLS.TYPE]

    print 'Making neuron 2'
    nrn2 = make_neuron(rd)
    print 'Neuron 2 soma points', [r for r in nrn2.soma.iter()]
    print 'Neuron 2 soma points', [as_point(p) for p in nrn2.soma.iter()]
    print 'Neuron 2 tree init points, types'
    for tt in nrn2.neurites:
        print tt.value[COLS.ID], tt.value[COLS.TYPE]

    print 'Print neuron leaves as points'
    for tt in nrn2.neurites:
Beispiel #6
0
    init_seg_ids = get_initial_segment_ids(rd)

    trees = [make_tree(rd, sg) for sg in init_seg_ids]

    soma = neuron.make_soma([rd.get_row(si) for si in get_soma_ids(rd)])

    for tr in trees:
        for p in point_iter(tree.ipreorder(tr)):
            LOG.debug(p)

    LOG.info('Initial segment IDs: %s', init_seg_ids)

    nrn = neuron.Neuron(soma, trees)

    LOG.info('Neuron soma raw data % s', [r for r in nrn.soma.iter()])
    LOG.info('Neuron soma points %s', [as_point(p)
                                       for p in nrn.soma.iter()])

    LOG.info('Neuron tree init points, types')
    for tt in nrn.neurites:
        LOG.info('%s, %s', tt.value[COLS.ID], tt.value[COLS.TYPE])

    LOG.info('Making neuron 2')
    nrn2 = make_neuron(rd)
    LOG.debug('Neuron 2 soma points %s', [r for r in nrn2.soma.iter()])
    LOG.debug('Neuron 2 soma points %s', [as_point(p)
                                          for p in nrn2.soma.iter()])
    LOG.info('Neuron 2 tree init points, types')
    for tt in nrn2.neurites:
        LOG.info('%s %s', tt.value[COLS.ID], tt.value[COLS.TYPE])
Beispiel #7
0
    init_seg_ids = get_initial_segment_ids(rd)

    trees = [make_tree(rd, sg) for sg in init_seg_ids]

    soma = neuron.make_soma([rd.get_row(si) for si in get_soma_ids(rd)])

    for tr in trees:
        for p in point_iter(tree.ipreorder(tr)):
            print p

    print 'Initial segment IDs:', init_seg_ids

    nrn = neuron.Neuron(soma, trees)

    print 'Neuron soma raw data', [r for r in nrn.soma.iter()]
    print 'Neuron soma points', [as_point(p)
                                 for p in nrn.soma.iter()]

    print 'Neuron tree init points, types'
    for tt in nrn.neurites:
        print tt.value[COLS.ID], tt.value[COLS.TYPE]

    print 'Making neuron 2'
    nrn2 = make_neuron(rd)
    print 'Neuron 2 soma points', [r for r in nrn2.soma.iter()]
    print 'Neuron 2 soma points', [as_point(p)
                                   for p in nrn2.soma.iter()]
    print 'Neuron 2 tree init points, types'
    for tt in nrn2.neurites:
        print tt.value[COLS.ID], tt.value[COLS.TYPE]
Beispiel #8
0
    init_seg_ids = get_initial_segment_ids(rd)

    trees = [make_tree(rd, sg) for sg in init_seg_ids]

    soma = neuron.make_soma([rd.get_row(si) for si in get_soma_ids(rd)])

    for tr in trees:
        for p in point_iter(tree.ipreorder(tr)):
            LOG.debug(p)

    LOG.info('Initial segment IDs: %s', init_seg_ids)

    nrn = neuron.Neuron(soma, trees)

    LOG.info('Neuron soma raw data % s', [r for r in nrn.soma.iter()])
    LOG.info('Neuron soma points %s', [as_point(p) for p in nrn.soma.iter()])

    LOG.info('Neuron tree init points, types')
    for tt in nrn.neurites:
        LOG.info('%s, %s', tt.value[COLS.ID], tt.value[COLS.TYPE])

    LOG.info('Making neuron 2')
    nrn2 = make_neuron(rd)
    LOG.debug('Neuron 2 soma points %s', [r for r in nrn2.soma.iter()])
    LOG.debug('Neuron 2 soma points %s',
              [as_point(p) for p in nrn2.soma.iter()])
    LOG.info('Neuron 2 tree init points, types')
    for tt in nrn2.neurites:
        LOG.info('%s %s', tt.value[COLS.ID], tt.value[COLS.TYPE])

    LOG.debug('Print neuron leaves as points')