diff --git a/extensions/chaeo/zmask.py b/extensions/chaeo/zmask.py index 900ab02ed268817f5237425ac35ef91b61ad2bec..3089a58e4fffce45cc977845325e3643d6c3f062 100644 --- a/extensions/chaeo/zmask.py +++ b/extensions/chaeo/zmask.py @@ -9,7 +9,7 @@ from sklearn.linear_model import LinearRegression from extensions.chaeo.annotators import draw_boxes_on_3d_image from extensions.chaeo.products import export_patches_from_zstack, export_multichannel_patches_from_zstack, export_patch_masks_from_zstack, get_patches_from_zmask_meta, get_patch_masks_from_zmask_meta -from extensions.chaeo.params import AnnotatedZStackParams, PatchParams, RoiFilter, RoiSetMetaParams, RoiSetExportParams +from extensions.chaeo.params import RoiFilter, RoiSetMetaParams, RoiSetExportParams from extensions.chaeo.process import mask_largest_object from model_server.accessors import GenericImageDataAccessor, InMemoryDataAccessor, write_accessor_data_to_file from model_server.models import InstanceSegmentationModel @@ -26,9 +26,10 @@ class RoiSet(object): self.zmask, self.zmask_meta, self.df, self.interm = build_zmask_from_object_mask( acc_mask, acc_raw, - filters=params.filters, - mask_type=params.mask_type, - expand_box_by=params.expand_box_by + params=params, + # filters=params.filters, + # mask_type=params.mask_type, + # expand_box_by=params.expand_box_by ) self.acc_raw = acc_raw @@ -138,9 +139,7 @@ class RoiSet(object): def build_zmask_from_object_mask( obmask: GenericImageDataAccessor, zstack: GenericImageDataAccessor, - filters=None, - mask_type='contours', - expand_box_by=(0, 0), + params: RoiSetMetaParams, ): """ Given a 2D mask of objects, build a 3D mask, where each object's z-position is determined by the index of @@ -164,7 +163,9 @@ def build_zmask_from_object_mask( label_map: np.ndarray (h x w) where each unique object has an integer label argmax: np.ndarray (h x w x 1 x 1) z-index of highest intensity in zstack """ - + filters = params.filters + mask_type = params.mask_type + expand_box_by = params.expand_box_by # validate inputs # assert zstack.chroma == 1 assert mask_type in ('contours', 'boxes'), mask_type