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
303f8e22
Commit
303f8e22
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Removed ImageJ demo scripts, now on its own branch
parent
d09bdffb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
imagej/infer_ilastik_by_api.py
+0
-48
0 additions, 48 deletions
imagej/infer_ilastik_by_api.py
with
0 additions
and
48 deletions
imagej/infer_ilastik_by_api.py
deleted
100644 → 0
+
0
−
48
View file @
d09bdffb
import
httplib
import
json
import
urllib
import
os
import
sys
print
(
sys
.
version
)
from
ij
import
IJ
host
=
'
127.0.0.1
'
port
=
8001
uri
=
'
http://{}:{}/
'
.
format
(
host
,
port
)
abspath
=
IJ
.
getImage
().
getProp
(
'
Location
'
)
input_filename
=
os
.
path
.
split
(
abspath
)[
-
1
]
outpath
=
'
C:
\\
Users
\\
rhodes
\\
projects
\\
proj0015-model-server
\\
resources
\\
testdata
'
def
hit_endpoint
(
method
,
endpoint
,
params
=
None
,
verbose
=
False
):
connection
=
httplib
.
HTTPConnection
(
host
,
port
)
if
not
method
in
[
'
GET
'
,
'
PUT
'
]:
raise
Exception
(
'
Can only handle GET and PUT requests
'
)
if
params
:
url
=
endpoint
+
'
?
'
+
urllib
.
urlencode
(
params
)
else
:
url
=
endpoint
connection
.
request
(
method
,
url
)
resp
=
connection
.
getresponse
()
resp_str
=
resp
.
read
()
if
verbose
:
print
(
method
+
'
'
+
url
+
'
, status
'
+
str
(
resp
.
status
)
+
'
:
\n
'
+
resp_str
)
return
json
.
loads
(
resp_str
)
#hit_endpoint('GET', '/')
#hit_endpoint('GET', '/models')
#hit_endpoint('PUT', '/bounce_back', {'par1': 'ghij'})
resp
=
hit_endpoint
(
'
PUT
'
,
'
/models/ilastik/pixel_classification/load/
'
,
{
'
project_file
'
:
'
demo_px.ilp
'
})
pxmid
=
resp
[
'
model_id
'
]
resp
=
hit_endpoint
(
'
GET
'
,
'
/models
'
,
verbose
=
True
)
infer_params
=
{
'
model_id
'
:
pxmid
,
'
input_filename
'
:
input_filename
,
'
channel
'
:
0
}
hit_endpoint
(
'
PUT
'
,
'
/infer/from_image_file
'
,
infer_params
)
\ No newline at end of file
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