def testThreePointSoma(self): mtree = MorphTree(os.path.join(MORPHOLOGIES_PATH_PREFIX, 'threepoint_soma.swc')) for n, idx in zip(mtree, [1,4,5]): assert n.index == idx idxs = [1,2,3,4,5] for ii, n in enumerate(mtree.__iter__(skip_inds=[])): assert n.index == idxs[ii] s_surface = 2. * np.pi * 5. * 5. + \ 2. * np.pi * 5. * 5. s_radius = np.sqrt(s_surface / (4.*np.pi)) assert mtree[1].R == s_radius
def testMultiCylinderSoma(self): mtree = MorphTree(os.path.join(MORPHOLOGIES_PATH_PREFIX, 'multicylinder_soma.swc')) for n, idx in zip(mtree, [1,7,8,9,10]): assert n.index == idx idxs = [1,2,3,7,8,9,10] for ii, n in enumerate(mtree.__iter__(skip_inds=[])): assert n.index == idxs[ii] s_radius = np.sqrt(2.*np.pi*10. * 5. / (4.*np.pi)) assert mtree[1].R == s_radius assert np.allclose(mtree[1].xyz, np.array([0.,2.5,0.]))
def testThreePointSoma(self): mtree = MorphTree('test_morphologies/threepoint_soma.swc') for n, idx in zip(mtree, [1,4,5]): assert n.index == idx idxs = [1,2,3,4,5] for ii, n in enumerate(mtree.__iter__(skip_inds=[])): assert n.index == idxs[ii] s_surface = 2. * np.pi * 5. * 5. + \ 2. * np.pi * 5. * 5. s_radius = np.sqrt(s_surface / (4.*np.pi)) assert mtree[1].R == s_radius