Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
myosoft-imcf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
imcf
myosoft-imcf
Commits
d8310623
Commit
d8310623
authored
2 weeks ago
by
Kai Schleicher
Browse files
Options
Downloads
Patches
Plain Diff
Add function to convert ijrois to labelimage
parent
c32ebcbe
No related branches found
No related tags found
1 merge request
!2
Initial commit
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2d_spots_in_fibers.py
+28
-1
28 additions, 1 deletion
2d_spots_in_fibers.py
with
28 additions
and
1 deletion
2d_spots_in_fibers.py
+
28
−
1
View file @
d8310623
...
...
@@ -36,7 +36,7 @@ from net.imglib2.roi import Regions
from
net.imglib2.roi.labeling
import
LabelRegions
from
net.imglib2.algorithm.labeling
import
ConnectedComponents
# BIOP imports
from
ch.epfl.biop.ij2command
import
Labels2Rois
from
ch.epfl.biop.ij2command
import
Labels2Rois
,
Rois2Labels
# python imports
import
os
...
...
@@ -707,6 +707,33 @@ def save_labelimage_as_ijroiset(label_imp, filename, suffix, target):
rm
.
reset
()
def
load_rois_from_zip
(
path
):
"""
Load ROIs from the given zip file and add them to the RoiManager.
Parameters
----------
path : string
Path to the ROI zip file.
"""
rm
=
RoiManager
.
getInstance
()
if
not
rm
:
rm
=
RoiManager
()
rm
.
reset
()
rm
.
runCommand
(
"
Open
"
,
path
)
def
convert_rois_to_labelimage
(
imp
):
rm
=
RoiManager
.
getInstance
()
if
not
rm
:
rm
=
RoiManager
()
label_imp
=
command
.
run
(
Rois2Labels
,
False
,
'
imp
'
,
imp
,
'
rm
'
,
rm
).
get
().
getOutput
(
"
label_imp
"
)
rm
.
reset
()
# TODO: should be optional but can be default
return
label_imp
def
close_images
(
list_of_imps
):
"""
Close given ImagePlus images
...
...
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