コード例 #1
0
 def test_get_n_segments(self):
     nt.assert_equal(_nrt.n_segments(self.sec_nrn),
                     get('number_of_segments', self.ref_nrn)[0])
     for t in NeuriteType:
         nt.assert_equal(
             _nrt.n_segments(self.sec_nrn, neurite_type=t),
             get('number_of_segments', self.ref_nrn, neurite_type=t)[0])
コード例 #2
0
ファイル: test_feature_compat.py プロジェクト: markovg/NeuroM
 def test_get_n_segments(self):
     assert _nrt.n_segments(self.sec_nrn) == get('number_of_segments', self.ref_nrn)[0]
     for t in NeuriteType:
         assert (_nrt.n_segments(self.sec_nrn, neurite_type=t) ==
                         get('number_of_segments', self.ref_nrn, neurite_type=t)[0])
コード例 #3
0
ファイル: test_neuritefunc.py プロジェクト: joewgraham/NeuroM
def test_n_segments():
    n_segments = _nf.n_segments(SIMPLE)
    nt.eq_(n_segments, 6)
コード例 #4
0
# pylint: disable=protected-access

import numpy as np

import neurom as nm
from neurom.features import neuritefunc as _nf

nrn_h5 = nm.load_neuron('tests/data/h5/v1/bio_neuron-001.h5')
nrn_asc = nm.load_neuron('tests/data/neurolucida/bio_neuron-001.asc')

print('h5 number of sections: %s' % nm.get('number_of_sections', nrn_h5)[0])
print('nl number of sections: %s\n' % nm.get('number_of_sections', nrn_asc)[0])
print('h5 number of segments: %s' % nm.get('number_of_segments', nrn_h5)[0])
print('nl number of segments: %s\n' % nm.get('number_of_segments', nrn_asc)[0])
print('h5 total neurite length: %s' %
      np.sum(nm.get('section_lengths', nrn_h5)))
print('nl total neurite length: %s\n' %
      np.sum(nm.get('section_lengths', nrn_asc)))
print('h5 principal direction extents: %s' %
      nm.get('principal_direction_extents', nrn_h5))
print('nl principal direction extents: %s' %
      nm.get('principal_direction_extents', nrn_asc))

print('\nNumber of neurites:')
for nt in iter(nm.NeuriteType):
    print(nt, _nf.n_neurites(nrn_h5, neurite_type=nt), _nf.n_neurites(nrn_asc, neurite_type=nt))

print('\nNumber of segments:')
for nt in iter(nm.NeuriteType):
    print(nt, _nf.n_segments(nrn_h5, neurite_type=nt), _nf.n_segments(nrn_asc, neurite_type=nt))
コード例 #5
0
def test_n_segments():
    n_segments = _nf.n_segments(SIMPLE)
    assert n_segments == 6