From 25d983931a6eba570795d8f2606a1d24ed8b7cf3 Mon Sep 17 00:00:00 2001 From: meganrm Date: Wed, 11 Oct 2023 16:41:21 -0700 Subject: [PATCH] use ingredient stored for compartment --- cellpack/autopack/Environment.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cellpack/autopack/Environment.py b/cellpack/autopack/Environment.py index d2827af7..a4e586b3 100644 --- a/cellpack/autopack/Environment.py +++ b/cellpack/autopack/Environment.py @@ -3151,6 +3151,7 @@ def create_voxelization(self, image_data, image_size, voxel_size, hollow=False): channel_colors = [] for obj in self.packed_objects.get_all(): + mesh_store = None if obj.name not in image_data: image_data[obj.name] = numpy.zeros(image_size, dtype=numpy.uint8) if obj.color is not None: @@ -3159,12 +3160,9 @@ def create_voxelization(self, image_data, image_size, voxel_size, hollow=False): color = [int(col * 255) for col in obj.color] channel_colors.append(color) if obj.is_compartment: - obj_instance = self.get_compartment_object_by_name(obj.name) mesh_store = self.mesh_store - else: - obj_instance = obj.ingredient - mesh_store = None - image_data[obj.name] = obj_instance.create_voxelization( + + image_data[obj.name] = obj.ingredient.create_voxelization( image_data=image_data[obj.name], bounding_box=self.boundingBox, voxel_size=voxel_size,