Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SVLT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ALMF
SVLT
Commits
e90b47c6
Commit
e90b47c6
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Consolidated more parameters into pydantic models
parent
6a24b7e2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extensions/chaeo/zmask.py
+9
-8
9 additions, 8 deletions
extensions/chaeo/zmask.py
with
9 additions
and
8 deletions
extensions/chaeo/zmask.py
+
9
−
8
View file @
e90b47c6
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment