def test_tree3d(): with get_fig_3d() as (fig, ax): tree = simple_neuron.neurites[0] view.plot_tree3d(ax, tree) xy_bounds = ax.xy_dataLim.bounds np.testing.assert_allclose(xy_bounds, (-5., 0., 11., 5.)) zz_bounds = ax.zz_dataLim.bounds np.testing.assert_allclose(zz_bounds, (0., 0., 1., 1.))
def test_one_point_branch(): test_section = Section(points=np.array([[1., 1., 1., 0.5, 2, 1, 0]])) for diameter_scale, linewidth in it.product((1.0, None), (0.0, 1.2)): with get_fig_2d() as (fig, ax): view.plot_tree(ax, test_section, diameter_scale=diameter_scale, linewidth=linewidth) with get_fig_3d() as (fig, ax): view.plot_tree3d(ax, test_section, diameter_scale=diameter_scale, linewidth=linewidth)
def test_tree3d(get_fig_3d): fig, ax = get_fig_3d tree = simple_neuron.neurites[0] view.plot_tree3d(ax, tree) xy_bounds = ax.xy_dataLim.bounds np.testing.assert_allclose(xy_bounds, (-5., 0., 11., 5.)) zz_bounds = ax.zz_dataLim.bounds np.testing.assert_allclose(zz_bounds, (0., 0., 1., 1.))
def test_tree3d(): with get_fig_3d() as (fig, ax): tree = simple_neuron.neurites[0] view.plot_tree3d(ax, tree) xy_bounds = ax.xy_dataLim.bounds assert_allclose(xy_bounds, (-5., 0., 11., 5.)) zz_bounds = ax.zz_dataLim.bounds assert_allclose(zz_bounds, (0., 0., 1., 1.))
def test_one_point_branch(): test_section = Neurite(Section(points=np.array([[1., 1., 1., 0.5, 2, 1, 0]]))) for diameter_scale, linewidth in it.product((1.0, None), (0.0, 1.2)): with get_fig_2d() as (fig, ax): view.plot_tree(ax, test_section, diameter_scale=diameter_scale, linewidth=linewidth) with get_fig_3d() as (fig, ax): view.plot_tree3d(ax, test_section, diameter_scale=diameter_scale, linewidth=linewidth)