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
74961b83
Commit
74961b83
authored
10 months ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue0038' into 'staging'
Issue0038 See merge request
rhodes/model_server!46
parents
e4dcfbfb
39e79145
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/clients/ilastik_map_objects.py
+2
-2
2 additions, 2 deletions
model_server/clients/ilastik_map_objects.py
model_server/clients/imagej/adapter.py
+10
-1
10 additions, 1 deletion
model_server/clients/imagej/adapter.py
with
12 additions
and
3 deletions
model_server/clients/ilastik_map_objects.py
+
2
−
2
View file @
74961b83
...
...
@@ -9,7 +9,7 @@ def main(request_func, in_abspath, params):
:param params:
pixel_classifier_path: (str) absolute path to ilastik project file that defines a pixel classifier
object_classifier_path: (str) absolute path to ilastik project file that defines an object classifier
channel: (int) channel of the input image to process
channel
(optional)
: (int) channel of the input image to process
, use all channels if not specified
:return: (str) absolute path where a new object map is written
"""
...
...
@@ -18,7 +18,7 @@ def main(request_func, in_abspath, params):
px_ilp
=
params
[
'
pixel_classifier_path
'
]
ob_ilp
=
params
[
'
object_classifier_path
'
]
channel
=
params
[
'
channel
'
]
channel
=
getattr
(
params
,
'
channel
'
,
None
)
mip
=
params
.
get
(
'
mip
'
,
False
)
# configure input and output paths
...
...
This diff is collapsed.
Click to expand it.
model_server/clients/imagej/adapter.py
+
10
−
1
View file @
74961b83
...
...
@@ -13,18 +13,27 @@ HOST = '127.0.0.1'
PORT
=
6221
uri
=
'
http://{}:{}/
'
.
format
(
HOST
,
PORT
)
def
hit_endpoint
(
method
,
endpoint
,
params
=
None
,
body
=
None
):
def
hit_endpoint
(
method
,
endpoint
,
params
=
None
,
body
=
None
,
drop_none
=
True
):
"""
Python 2.7 implementation of HTTP client
:param method: (str) either
'
GET
'
or
'
PUT
'
:param endpoint: (str) endpoint of HTTP request
:param params: (dict) of parameters that are embedded in client request URL
:param body: (dict) of parameters that JSON-encoded and attached as payload in request
:param drop_none: (bool) remove (presumably optional) parameters with value equal to None
:return: (dict) of response status and content, formatted as dict if request is successful
"""
connection
=
httplib
.
HTTPConnection
(
HOST
,
PORT
)
if
not
method
in
[
'
GET
'
,
'
PUT
'
]:
raise
Exception
(
'
Can only handle GET and PUT requests
'
)
k_pop
=
[]
if
drop_none
and
params
is
not
None
:
for
k
,
v
in
params
.
items
():
if
v
is
None
:
k_pop
.
append
(
k
)
for
ki
in
k_pop
:
params
.
pop
(
ki
)
if
params
:
url
=
endpoint
+
'
?
'
+
urllib
.
urlencode
(
params
)
else
:
...
...
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