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
ce4bdb63
Commit
ce4bdb63
authored
1 year ago
by
Christopher Randolph Rhodes
Browse files
Options
Downloads
Patches
Plain Diff
Made ImageJ example script a bit more user-friendly
parent
af869360
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
model_server/clients/imagej/example_simple_ilastik.py
+21
-16
21 additions, 16 deletions
model_server/clients/imagej/example_simple_ilastik.py
with
21 additions
and
16 deletions
model_server/clients/imagej/example_simple_ilastik.py
+
21
−
16
View file @
ce4bdb63
import
os
import
sys
from
ij
import
IJ
from
ij.plugin.filter
import
ParticleAnalyzer
from
ij.plugin.frame
import
Recorder
,
RoiManager
from
os.path
import
join
,
expanduser
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
path
.
expanduser
(
'
~
'
),
'
model_server
'
,
'
source
'
,
'
model_server
'
,
'
clients
'
)
)
# top-level directory <user>/model_server that contains codebase
root
=
join
(
expanduser
(
'
~
'
),
'
model_server
'
)
from
imagej.adapter
import
run_request_sequence
import
ilastik_map_objects_simple
from
ij
import
IJ
# USER: change this to look for ilastik models in some place other than <user>/model_server/ilastik
classifier_directory
=
join
(
root
,
'
ilastik
'
)
# USER: set filenames and channels to build ilastik pipeline
params
=
{
'
pixel_classifier
_path
'
:
'
c:/Users/rhodes/projects/proj0011-plankton-seg/exp0019/
px-03.ilp
'
,
'
object_classifier
_path
'
:
'
c:/Users/rhodes/projects/proj0011-plankton-seg/exp0019/
obj-07.ilp
'
,
'
pixel_classifier
'
:
'
px-03.ilp
'
,
'
object_classifier
'
:
'
obj-07.ilp
'
,
'
debug
'
:
True
,
'
channel
'
:
4
,
# zero-index
'
object_class
'
:
3
}
# load ImageJ API then Jython dependencies that are maintained in model_server codebase
import
sys
from
ij
import
IJ
from
ij.plugin.frame
import
Recorder
,
RoiManager
sys
.
path
.
append
(
join
(
root
,
'
source
'
,
'
model_server
'
,
'
clients
'
))
from
imagej.adapter
import
run_request_sequence
import
ilastik_map_objects_simple
# call the server to run ilastik analysis
params
[
'
pixel_classifier_path
'
]
=
join
(
classifier_directory
,
params
[
'
pixel_classifier
'
])
params
[
'
object_classifier_path
'
]
=
join
(
classifier_directory
,
params
[
'
object_classifier
'
])
IJ
.
run
(
'
Remove Overlay
'
)
imp_czi
=
IJ
.
getImage
()
...
...
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