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
655fbb62
Commit
655fbb62
authored
9 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
RoiSet can now return and export two-channel images as both TIFs and PNGs
parent
16875cd2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model_server/base/roiset.py
+1
-1
1 addition, 1 deletion
model_server/base/roiset.py
tests/test_roiset.py
+2
-2
2 additions, 2 deletions
tests/test_roiset.py
with
3 additions
and
3 deletions
model_server/base/roiset.py
+
1
−
1
View file @
655fbb62
...
...
@@ -427,7 +427,7 @@ class RoiSet(object):
def
_export_patch
(
roi
):
patch
=
InMemoryDataAccessor
(
roi
.
patch
)
ext
=
'
tif
'
if
make_3d
or
patch
.
chroma
>
3
else
'
png
'
ext
=
'
tif
'
if
make_3d
or
patch
.
chroma
>
3
or
kwargs
.
get
(
'
force_tif
'
)
else
'
png
'
fname
=
f
'
{
prefix
}
-la
{
roi
.
label
:
04
d
}
-zi
{
roi
.
zi
:
04
d
}
.
{
ext
}
'
if
patch
.
dtype
is
np
.
dtype
(
'
uint16
'
):
...
...
This diff is collapsed.
Click to expand it.
tests/test_roiset.py
+
2
−
2
View file @
655fbb62
...
...
@@ -304,7 +304,7 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
self
.
assertEqual
(
result
.
chroma
,
1
)
def
test_multichannel_to_color_2d_patches
(
self
):
chs
=
[
0
,
2
,
4
,
1
]
chs
=
[
0
,
2
,]
where
=
output_path
/
'
multichannel
'
/
'
color_2d_patches
'
self
.
assertGreater
(
self
.
roiset
.
acc_raw
.
chroma
,
1
)
patches_acc
=
self
.
roiset
.
get_patches_acc
(
channels
=
chs
)
...
...
@@ -316,11 +316,11 @@ class TestRoiSetMultichannelProducts(BaseTestRoiSetMonoProducts, unittest.TestCa
draw_bounding_box
=
True
,
expanded
=
True
,
pad_to
=
256
,
force_tif
=
True
,
)
result
=
generate_file_accessor
(
where
/
df_res
.
patch_path
.
iloc
[
0
])
self
.
assertEqual
(
result
.
chroma
,
len
(
chs
))
def
test_multichannnel_to_mono_2d_patches_rgb_bbox
(
self
):
where
=
output_path
/
'
multichannel
'
/
'
mono_2d_patches_rgb_bbox
'
df_res
=
self
.
roiset
.
export_patches
(
...
...
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