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
cac9fc9f
Commit
cac9fc9f
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Test covering annotated multichannel z-stacks, too
parent
820cc3e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_server/extensions/chaeo/tests/test_zstack.py
+16
-6
16 additions, 6 deletions
model_server/extensions/chaeo/tests/test_zstack.py
model_server/extensions/chaeo/zmask.py
+1
-3
1 addition, 3 deletions
model_server/extensions/chaeo/zmask.py
with
17 additions
and
9 deletions
model_server/extensions/chaeo/tests/test_zstack.py
+
16
−
6
View file @
cac9fc9f
...
...
@@ -257,7 +257,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
def
test_multichannel_to_mono_2d_patches
(
self
):
files
=
export_multichannel_patches_from_zstack
(
output_path
/
'
test_
multichannel
_to_
mono_2d_patches
'
,
output_path
/
'
multichannel
'
/
'
mono_2d_patches
'
,
self
.
roiset
,
white_channel
=
3
,
draw_bounding_box
=
True
,
...
...
@@ -267,7 +267,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
def
test_multichannnel_to_mono_2d_patches_rgb_bbox
(
self
):
files
=
export_multichannel_patches_from_zstack
(
output_path
/
'
multichann
n
el
_to_
mono_2d_patches_rgb_bbox
'
,
output_path
/
'
multichannel
'
/
'
mono_2d_patches_rgb_bbox
'
,
self
.
roiset
,
white_channel
=
3
,
draw_bounding_box
=
True
,
...
...
@@ -278,7 +278,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
def
test_multichannnel_to_rgb_2d_patches_bbox
(
self
):
files
=
export_multichannel_patches_from_zstack
(
output_path
/
'
multichann
n
el
_to_
rgb_2d_patches_bbox
'
,
output_path
/
'
multichannel
'
/
'
rgb_2d_patches_bbox
'
,
self
.
roiset
,
white_channel
=
4
,
rgb_overlay_channels
=
(
3
,
None
,
None
),
...
...
@@ -291,7 +291,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
def
test_multichannnel_to_rgb_2d_patches_contour
(
self
):
files
=
export_multichannel_patches_from_zstack
(
output_path
/
'
multichann
n
el
_to_
rgb_2d_patches_contour
'
,
output_path
/
'
multichannel
'
/
'
rgb_2d_patches_contour
'
,
self
.
roiset
,
rgb_overlay_channels
=
(
3
,
None
,
None
),
draw_contour
=
True
,
...
...
@@ -303,12 +303,22 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
self
.
assertEqual
(
result
.
get_one_channel_data
(
2
).
data
.
max
(),
0
)
# blue channel is black
def
test_multichannel_to_multichannel_tif_patches
(
self
):
# roiset = self._setup_multichannel_tests()
files
=
export_multichannel_patches_from_zstack
(
output_path
/
'
multichannel
_to_
multichannel_tif_patches
'
,
output_path
/
'
multichannel
'
/
'
multichannel_tif_patches
'
,
self
.
roiset
,
)
result
=
generate_file_accessor
(
Path
(
files
[
0
][
'
location
'
])
/
files
[
0
][
'
patch_filename
'
])
self
.
assertEqual
(
result
.
chroma
,
5
)
def
test_multichannel_annotated_zstack
(
self
):
self
.
roiset
.
export_annotated_zstack
(
output_path
/
'
multichannel
'
/
'
annotated_zstack
'
,
'
test_multichannel_annotated_zstack
'
,
)
# files = export_multichannel_patches_from_zstack(
# output_path / 'multichannel_to_multichannel_tif_patches',
# self.roiset,
# )
# result = generate_file_accessor(Path(files[0]['location']) / files[0]['patch_filename'])
# self.assertEqual(result.chroma, 5)
This diff is collapsed.
Click to expand it.
model_server/extensions/chaeo/zmask.py
+
1
−
3
View file @
cac9fc9f
...
...
@@ -203,9 +203,7 @@ class RoiSet(object):
return
Multichannel3dPatchStack
(
patches
)
def
export_annotated_zstack
(
self
,
where
,
prefix
=
'
zstack
'
,
**
kwargs
):
annotated
=
InMemoryDataAccessor
(
draw_boxes_on_3d_image
(
self
,
**
kwargs
)
# draw_boxes_on_3d_image(self.acc_raw.data, self.zmask_meta, **kwargs) # TODO remove zmask_meta ref
)
annotated
=
InMemoryDataAccessor
(
draw_boxes_on_3d_image
(
self
,
**
kwargs
))
success
=
write_accessor_data_to_file
(
where
/
(
prefix
+
'
.tif
'
),
annotated
)
return
{
'
location
'
:
where
.
__str__
(),
'
filename
'
:
prefix
+
'
.tif
'
}
...
...
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