Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
model_server
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
Christopher Randolph Rhodes
model_server
Commits
315062e6
Commit
315062e6
authored
11 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Bypass init with factory method that takes 2d object identities map
parent
9b5fec53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!18
Completed (de)serialization of RoiSet
,
!16
Completed (de)serialization of RoiSet
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_server/base/roiset.py
+9
-1
9 additions, 1 deletion
model_server/base/roiset.py
tests/test_roiset.py
+2
-2
2 additions, 2 deletions
tests/test_roiset.py
with
11 additions
and
3 deletions
model_server/base/roiset.py
+
9
−
1
View file @
315062e6
...
...
@@ -109,7 +109,6 @@ class RoiSet(object):
:param params: optional arguments that influence the definition and representation of ROIs
"""
assert
acc_obj_ids
.
chroma
==
1
assert
acc_obj_ids
.
nz
==
1
self
.
acc_obj_ids
=
acc_obj_ids
self
.
acc_raw
=
acc_raw
self
.
params
=
params
...
...
@@ -191,6 +190,15 @@ class RoiSet(object):
)
return
df
@staticmethod
def
from_2d_obj_ids
(
acc_raw
:
GenericImageDataAccessor
,
acc_obj_ids
:
GenericImageDataAccessor
,
params
:
RoiSetMetaParams
=
RoiSetMetaParams
()
):
assert
acc_obj_ids
.
nz
==
1
return
RoiSet
(
acc_raw
,
acc_obj_ids
,
params
)
@staticmethod
def
filter_df
(
df
:
pd
.
DataFrame
,
filters
:
RoiFilter
=
None
)
->
pd
.
DataFrame
:
...
...
This diff is collapsed.
Click to expand it.
tests/test_roiset.py
+
2
−
2
View file @
315062e6
...
...
@@ -23,7 +23,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
def
_make_roi_set
(
self
,
mask_type
=
'
boxes
'
,
**
kwargs
):
id_map
=
_get_label_ids
(
self
.
seg_mask
)
roiset
=
RoiSet
(
roiset
=
RoiSet
.
from_2d_obj_ids
(
self
.
stack_ch_pa
,
id_map
,
params
=
RoiSetMetaParams
(
...
...
@@ -60,7 +60,7 @@ class TestRoiSetMonoProducts(BaseTestRoiSetMonoProducts, unittest.TestCase):
self
.
assertEqual
(
acc_zstack_slice
.
nz
,
1
)
id_map
=
_get_label_ids
(
self
.
seg_mask
)
roiset
=
RoiSet
(
acc_zstack_slice
,
id_map
,
params
=
RoiSetMetaParams
(
mask_type
=
'
boxes
'
))
roiset
=
RoiSet
.
from_2d_obj_ids
(
acc_zstack_slice
,
id_map
,
params
=
RoiSetMetaParams
(
mask_type
=
'
boxes
'
))
zmask
=
roiset
.
get_zmask
()
zmask_acc
=
InMemoryDataAccessor
(
zmask
)
...
...
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