From a1c23fe9851ecdc8e5c91aabdf8e4713ecc2e6f8 Mon Sep 17 00:00:00 2001 From: IgorTatarnikov Date: Fri, 8 Dec 2023 16:18:13 +0000 Subject: [PATCH] Fixed bug related to issue #293, amended tests to check in the future --- brainrender/actors/points.py | 2 +- tests/test_integration.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/brainrender/actors/points.py b/brainrender/actors/points.py index e71f73f4..73920e71 100644 --- a/brainrender/actors/points.py +++ b/brainrender/actors/points.py @@ -144,5 +144,5 @@ def __init__( .alpha([0, 0.9]) .mode(1) ) # returns a vedo Volume - volume.mirror("z") + Actor.__init__(self, volume, name=name, br_class="density") diff --git a/tests/test_integration.py b/tests/test_integration.py index 023f9a03..8155e092 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -198,6 +198,13 @@ def test_cell_density(scene): check_bounds(points_bounds, root_bounds) check_bounds(points_density_bounds, root_bounds) + ids = points_density.mesh.isosurface().inside_points( + coordinates, return_ids=True + ) + + # Check that at least 75% of the points are inside the mesh + assert len(ids) >= 0.75 * len(coordinates) + def test_gene_expression(scene): gene = "Gpr161"