def test_get_number_of_neurites(self): nt.assert_equal(_nrt.n_neurites(self.sec_nrn), get('number_of_neurites', self.ref_nrn)[0]) for t in NeuriteType: nt.assert_equal( _nrt.n_neurites(self.sec_nrn, neurite_type=t), get('number_of_neurites', self.ref_nrn, neurite_type=t)[0])
def test_get_number_of_neurites(self): assert _nrt.n_neurites(self.sec_nrn) == get('number_of_neurites', self.ref_nrn)[0] for t in NeuriteType: assert (_nrt.n_neurites(self.sec_nrn, neurite_type=t) == get('number_of_neurites', self.ref_nrn, neurite_type=t)[0])
def test_n_neurites(): n_neurites = _nf.n_neurites(SIMPLE) nt.eq_(n_neurites, 2)
# 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))
def test_n_neurites(): n_neurites = _nf.n_neurites(SIMPLE) assert n_neurites == 2