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
b0af8759
Commit
b0af8759
authored
2 weeks ago
by
Kai Schleicher
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused function and imports
parent
e3e5ee76
No related branches found
Branches containing commit
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
+0
-31
0 additions, 31 deletions
2d_spots_in_fibers.py
with
0 additions
and
31 deletions
2d_spots_in_fibers.py
+
0
−
31
View file @
b0af8759
...
...
@@ -29,11 +29,6 @@ from loci.plugins.in import ImporterOptions
from
loci.formats
import
ImageReader
,
MetadataTools
,
Memoizer
# MorpholibJ imports
from
inra.ijpb.binary
import
BinaryImages
# imglib2 imports
from
net.imglib2.img.display.imagej
import
ImageJFunctions
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
,
Rois2Labels
# python imports
...
...
@@ -288,32 +283,6 @@ def save_image_as_IJtif(imp, filename, suffix, target):
IJ
.
saveAs
(
imp
,
"
Tiff
"
,
savepath
)
def
convert_labelimage_to_imglib2regions
(
imp
):
"""
Convert a ImagePlus label image to imglib2 regions
Parameters
----------
imp : ImagePlus
the input label image
Returns
-------
Imglib2 LabelRegions
the imglib2 label regions
"""
# fist convert ImagePlus to img as suggested by curtis:
# from https://forum.image.sc/t/how-to-wrap-any-kind-of-imageplus-to-an-imglib2-img-floattype/178/6
wrapImg
=
ImageJFunctions
.
wrap
(
imp
)
# workaround to convert a label image into an imglib2 ImgLabeling (which contains not only an image)
img_labeling
=
ops
.
labeling
().
cca
(
wrapImg
,
ConnectedComponents
.
StructuringElement
.
EIGHT_CONNECTED
)
# img = img_labeling.getIndexImg() # the img label image
# ImageJFunctions.show(img)
regions
=
LabelRegions
(
img_labeling
)
return
regions
def
convert_labelimage_to_binary
(
label_imp
,
scale_binary
=
True
):
"""
Convert a label image to a mask / binary image
...
...
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