Skip to content
Snippets Groups Projects
Commit e90b47c6 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Consolidated more parameters into pydantic models

parent 6a24b7e2
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment